]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Define <sys/cdefs.h> attributes conditional to the supported gcc version
authorGuillem Jover <guillem@hadrons.org>
Wed, 25 May 2011 19:25:54 +0000 (21:25 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 28 May 2011 08:31:06 +0000 (10:31 +0200)
include/bsd/sys/cdefs.h

index 0cd5d38812f090a7186eec80a8e2da691fcf30dc..3c31b05e9e023c1768f9368dd88effc419850f8b 100644 (file)
 #define _SYS_CDEFS_H
 #endif
 
+#ifdef __GNUC__
+#define LIBBSD_GCC_VERSION (__GNUC__ << 8 | __GNUC_MINOR__)
+#else
+#define LIBBSD_GCC_VERSION 0
+#endif
+
 #ifndef __dead2
 # define __dead2
 #endif
@@ -56,7 +62,7 @@
  * Disable for now. */
 #if 0
 #ifndef __unused
-# ifdef __GNUC__
+# if LIBBSD_GCC_VERSION >= 0x0300
 #  define __unused __attribute__((unused))
 # else
 #  define __unused
@@ -65,7 +71,7 @@
 #endif
 
 #ifndef __printflike
-# ifdef __GNUC__
+# if LIBBSD_GCC_VERSION >= 0x0300
 #  define __printflike(x, y) __attribute((format(printf, (x), (y))))
 # else
 #  define __printflike(x, y)