]> granicus.if.org Git - clang/commitdiff
c-index-test: Be available on Cygwin by using Win32's logic.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 9 Nov 2010 03:25:16 +0000 (03:25 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 9 Nov 2010 03:25:16 +0000 (03:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118479 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndexer.cpp

index baaeab3d0d26e0b90c409843b6cc0e7b6995ce42..95949b899b2390c6b3adc8f861d8273378623f2a 100644 (file)
 #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 @@ std::string CIndexer::getClangResourcesPath() {
   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