[llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp

Jeff Cohen jeffc at jolt-lang.org
Sat Jan 22 09:36:30 PST 2005



Changes in directory llvm/lib/Support:

FileUtilities.cpp updated: 1.34 -> 1.35
---
Log message:

Use binary mode for reading/writing bytecode files

---
Diffs of the changes:  (+3 -2)

 FileUtilities.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Support/FileUtilities.cpp
diff -u llvm/lib/Support/FileUtilities.cpp:1.34 llvm/lib/Support/FileUtilities.cpp:1.35
--- llvm/lib/Support/FileUtilities.cpp:1.34	Wed Dec 22 04:24:43 2004
+++ llvm/lib/Support/FileUtilities.cpp	Sat Jan 22 11:36:16 2005
@@ -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;






More information about the llvm-commits mailing list