lib: Add GCC version macro to the header file.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 17 May 2011 13:41:34 +0000 (14:41 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 13 Jun 2011 13:17:40 +0000 (14:17 +0100)
This will be used to internally enable various GCC enhancements.
(cherry picked from commit 33adb59b60b1358656439a757f319ba8ce81e26c)

generator/generator_c.ml

index 777b5d9..4405d63 100644 (file)
@@ -365,6 +365,11 @@ extern \"C\" {
 #include <stdint.h>
 #include <stdarg.h>
 
+#ifdef __GNUC__
+# define GUESTFS_GCC_VERSION \\
+    (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif
+
 /* The handle. */
 #ifndef GUESTFS_TYPEDEF_H
 #define GUESTFS_TYPEDEF_H 1