From: Argyrios Kyrtzidis Date: Mon, 29 Oct 2012 23:24:44 +0000 (+0000) Subject: [libclang] Introduce a version constant for the libclang API. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca9805a79dad01f12fa13c245f48724203699f08;p=clang [libclang] Introduce a version constant for the libclang API. rdar://12587974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 650e633940..787794ca9f 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -23,6 +23,26 @@ #include "clang-c/Platform.h" #include "clang-c/CXString.h" +#define CINDEX_VERSION_MAJOR 0 +#define CINDEX_VERSION_MINOR 1 + +#define CINDEX_VERSION_ENCODE(major, minor) ( \ + ((major) * 10000) \ + + ((minor) * 1)) + +#define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR ) + +#define CINDEX_VERSION_STRINGIZE_(major, minor) \ + #major"."#minor +#define CINDEX_VERSION_STRINGIZE(major, minor) \ + CINDEX_VERSION_STRINGIZE_(major, minor) + +#define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR) + #ifdef __cplusplus extern "C" { #endif