Skip to content

Commit aa63fdf

Browse files
committed
c-index-test: Be available on Cygwin by using Win32's logic.
llvm-svn: 118479
1 parent 9169dcb commit aa63fdf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clang/tools/libclang/CIndexer.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
#include <vector>
3232
#include <sstream>
3333

34+
#ifdef __CYGWIN__
35+
#include <sys/cygwin.h>
36+
#define LLVM_ON_WIN32 1
37+
#endif
38+
3439
#ifdef LLVM_ON_WIN32
3540
#include <windows.h>
3641
#else
@@ -51,7 +56,13 @@ std::string CIndexer::getClangResourcesPath() {
5156
VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi,
5257
sizeof(mbi));
5358
GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH);
54-
59+
60+
#ifdef __CYGWIN__
61+
char w32path[MAX_PATH];
62+
strcpy(w32path, path);
63+
cygwin_conv_to_full_posix_path(w32path, path);
64+
#endif
65+
5566
llvm::sys::Path LibClangPath(path);
5667
LibClangPath.eraseComponent();
5768
#else

0 commit comments

Comments
 (0)