[cfe-commits] r159484 - in /cfe/trunk: include/clang-c/CXCompilationDatabase.h test/Index/compile_commands.json tools/c-index-test/c-index-test.c tools/libclang/CIndexCompilationDB.cpp tools/libclang/CMakeLists.txt tools/libclang/libclang.exports
NAKAMURA Takumi
geek4civic at gmail.com
Sat Jun 30 04:47:14 PDT 2012
2012/6/30 Arnaud A. de Grandmaison <arnaud.adegm at gmail.com>:
> Author: aadg
> Date: Sat Jun 30 06:27:57 2012
> New Revision: 159484
>
> URL: http://llvm.org/viewvc/llvm-project?rev=159484&view=rev
> Log:
> [libclang] add CompilationDatabase support
> --- cfe/trunk/tools/c-index-test/c-index-test.c (original)
> +++ cfe/trunk/tools/c-index-test/c-index-test.c Sat Jun 30 06:27:57 2012
> @@ -1,6 +1,7 @@
> /* c-index-test.c */
>
> #include "clang-c/Index.h"
> +#include "clang-c/CXCompilationDatabase.h"
> #include <ctype.h>
> #include <stdlib.h>
> #include <stdio.h>
> @@ -25,8 +26,25 @@
>
> return((char*)path);
> }
> +char *dirname(char* path)
> +{
> + char* base1 = (char*)strrchr(path, '/');
> + char* base2 = (char*)strrchr(path, '\\');
> + if (base1 && base2)
> + if (base1 > base2)
> + *base1 = 0;
> + else
> + *base2 = 0;
> + else if (base1)
> + *base1 = 0
> + else if (base2)
> + *base2 = 0
> +
> + return path;
> +}
Oh no, why only msvc complains missing semicolons? :(
More information about the cfe-commits
mailing list