diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2005-01-22 17:36:17 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2005-01-22 17:36:17 +0000 |
commit | c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd (patch) | |
tree | 55b1d008e1cf3c87f4bd6accbe2299dacdb7e907 /llvm/lib/Support/FileUtilities.cpp | |
parent | e90b0c546976065cb6e09b29081e27e263159fef (diff) | |
download | llvm-c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd.zip llvm-c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd.tar.gz llvm-c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd.tar.bz2 |
Use binary mode for reading/writing bytecode files
llvm-svn: 19751
Diffstat (limited to 'llvm/lib/Support/FileUtilities.cpp')
-rw-r--r-- | llvm/lib/Support/FileUtilities.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 @@ using namespace llvm; /// 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; |