Author: asl Date: Mon Dec 3 08:28:26 2007 New Revision: 44533 URL: http://llvm.org/viewvc/llvm-project?rev=44533&view=rev Log: Open output file correctly. This is extremely important for windows-based hosts, where files are opened in text mode by default.
Modified: llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp Modified: llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp?rev=44533&r1=44532&r2=44533&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp Mon Dec 3 08:28:26 2007 @@ -36,7 +36,7 @@ // non-GCC. Some C++ stdlibs even have ofstream::ofstream(int fd). int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) { __gnu_cxx::stdio_filebuf<char> Buffer(FileHandle, std::ios_base::out); - std::ostream OS(&Buffer); + std::ostream OS(&Buffer, std::ios::out | std::ios::trunc | std::ios::binary); if (!OS.fail()) WriteBitcodeToFile(unwrap(M), OS); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits