[cfe-commits] r118479 - /cfe/trunk/tools/libclang/CIndexer.cpp

NAKAMURA Takumi geek4civic at gmail.com
Mon Nov 8 19:25:17 PST 2010


Author: chapuni
Date: Mon Nov  8 21:25:16 2010
New Revision: 118479

URL: http://llvm.org/viewvc/llvm-project?rev=118479&view=rev
Log:
c-index-test: Be available on Cygwin by using Win32's logic.

Modified:
    cfe/trunk/tools/libclang/CIndexer.cpp

Modified: cfe/trunk/tools/libclang/CIndexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexer.cpp?rev=118479&r1=118478&r2=118479&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexer.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexer.cpp Mon Nov  8 21:25:16 2010
@@ -31,6 +31,11 @@
 #include <vector>
 #include <sstream>
 
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#define LLVM_ON_WIN32 1
+#endif
+
 #ifdef LLVM_ON_WIN32
 #include <windows.h>
 #else
@@ -51,7 +56,13 @@
   VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi,
                sizeof(mbi));
   GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH);
-  
+
+#ifdef __CYGWIN__
+  char w32path[MAX_PATH];
+  strcpy(w32path, path);
+  cygwin_conv_to_full_posix_path(w32path, path);
+#endif
+
   llvm::sys::Path LibClangPath(path);
   LibClangPath.eraseComponent();
 #else





More information about the cfe-commits mailing list