diff options
author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2009-10-27 13:42:56 +0000 |
---|---|---|
committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2009-10-27 13:42:56 +0000 |
commit | de258b5ab959a45024c8c582df3d73468ab2cee3 (patch) | |
tree | 6960c5943845bbfbf7d4e9ab64f875ad7b97b4bc /clang/tools/c-index-test/c-index-test.c | |
parent | 59b7cf6a6df77028ddac54cc2ed0e7dfd2ecf42a (diff) | |
download | bcm5719-llvm-de258b5ab959a45024c8c582df3d73468ab2cee3.tar.gz bcm5719-llvm-de258b5ab959a45024c8c582df3d73468ab2cee3.zip |
Changes for building as a Windows DLL
llvm-svn: 85234
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index cf2a706891e..56b29ac136f 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -4,7 +4,23 @@ #include <stdio.h> #include <string.h> +#ifdef _MSC_VER +char *basename(const char* path) +{ + char* base1 = (char*)strrchr(path, '/'); + char* base2 = (char*)strrchr(path, '\\'); + if (base1 && base2) + return((base1 > base2) ? base1 + 1 : base2 + 1); + else if (base1) + return(base1 + 1); + else if (base2) + return(base2 + 1); + + return((char*)path); +} +#else extern char *basename(const char *); +#endif static void PrintCursor(CXCursor Cursor) { if (clang_isInvalid(Cursor.kind)) |