aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexer.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2010-11-09 03:25:16 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2010-11-09 03:25:16 +0000
commit3b35a4d21c9f6e48ee7e64fdf78fde39a61f602e (patch)
treefbfa40baa243cf7005e6c167560e4a3b0c45872f /tools/libclang/CIndexer.cpp
parent5e0fb35232366d1956647c2e01ea183242fba28c (diff)
c-index-test: Be available on Cygwin by using Win32's logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexer.cpp')
-rw-r--r--tools/libclang/CIndexer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/libclang/CIndexer.cpp b/tools/libclang/CIndexer.cpp
index baaeab3d0d..95949b899b 100644
--- a/tools/libclang/CIndexer.cpp
+++ b/tools/libclang/CIndexer.cpp
@@ -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 @@ 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