Use binary mode for reading/writing bytecode files
llvm-svn: 19751
diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp
index 5255df6..234cf7d 100644
--- a/llvm/lib/Support/FileUtilities.cpp
+++ b/llvm/lib/Support/FileUtilities.cpp
@@ -27,13 +27,14 @@
///
bool llvm::DiffFiles(const std::string &FileA, const std::string &FileB,
std::string *Error) {
- std::ifstream FileAStream(FileA.c_str());
+ std::ios::openmode io_mode = std::ios::in | std::ios::binary;
+ std::ifstream FileAStream(FileA.c_str(), io_mode);
if (!FileAStream) {
if (Error) *Error = "Couldn't open file '" + FileA + "'";
return true;
}
- std::ifstream FileBStream(FileB.c_str());
+ std::ifstream FileBStream(FileB.c_str(), io_mode);
if (!FileBStream) {
if (Error) *Error = "Couldn't open file '" + FileB + "'";
return true;