[cfe-commits] r116286 - in /cfe/trunk/tools: c-index-test/c-index-test.c libclang/CIndexer.cpp

Francois Pichet pichet2000 at gmail.com
Mon Oct 11 18:01:43 PDT 2010


Author: fpichet
Date: Mon Oct 11 20:01:43 2010
New Revision: 116286

URL: http://llvm.org/viewvc/llvm-project?rev=116286&view=rev
Log:
This patch remove the Win32 XFAIL from remap-complete.c

The problem was that text files were open in text mode and Microsoft implementation of fread and write will try to do nasty line-feed conversion which make the line position no longer valid. The fix is to read and write files in binary mode.

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c
    cfe/trunk/tools/libclang/CIndexer.cpp

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=116286&r1=116285&r2=116286&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Mon Oct 11 20:01:43 2010
@@ -109,7 +109,7 @@
     }
 
     /* Open the file that we're remapping to. */
-    to_file = fopen(semi + 1, "r");
+    to_file = fopen(semi + 1, "rb");
     if (!to_file) {
       fprintf(stderr, "error: cannot open file %s that we are remapping to\n",
               semi + 1);

Modified: cfe/trunk/tools/libclang/CIndexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexer.cpp?rev=116286&r1=116285&r2=116286&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexer.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexer.cpp Mon Oct 11 20:01:43 2010
@@ -107,7 +107,8 @@
       return true;
 
     std::string ErrorInfo;
-    llvm::raw_fd_ostream OS(SavedFile.c_str(), ErrorInfo);
+    llvm::raw_fd_ostream OS(SavedFile.c_str(), ErrorInfo,
+                            llvm::raw_fd_ostream::F_Binary);
     if (!ErrorInfo.empty())
       return true;
     





More information about the cfe-commits mailing list