From: NAKAMURA Takumi Date: Tue, 9 Nov 2010 03:25:16 +0000 (+0000) Subject: c-index-test: Be available on Cygwin by using Win32's logic. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b35a4d21c9f6e48ee7e64fdf78fde39a61f602e;p=clang 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 --- 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 #include +#ifdef __CYGWIN__ +#include +#define LLVM_ON_WIN32 1 +#endif + #ifdef LLVM_ON_WIN32 #include #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