[cfe-commits] r166980 - /cfe/trunk/include/clang-c/Index.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Oct 29 16:24:44 PDT 2012


Author: akirtzidis
Date: Mon Oct 29 18:24:44 2012
New Revision: 166980

URL: http://llvm.org/viewvc/llvm-project?rev=166980&view=rev
Log:
[libclang] Introduce a version constant for the libclang API.

rdar://12587974

Modified:
    cfe/trunk/include/clang-c/Index.h

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=166980&r1=166979&r2=166980&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Mon Oct 29 18:24:44 2012
@@ -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





More information about the cfe-commits mailing list