summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2011-05-25 21:25:54 +0200
committerGuillem Jover <guillem@hadrons.org>2011-05-28 10:31:06 +0200
commitde2062873f2b90bb8d09d213931ee1150ffd6b77 (patch)
treed4c922d6ee8c2c521147cef991b529b9046354c2
parent71e5db4cde2f194cc9a93d3d2e1b524bf11e7c01 (diff)
downloadlibbsd-de2062873f2b90bb8d09d213931ee1150ffd6b77.tar.gz
Define <sys/cdefs.h> attributes conditional to the supported gcc version
-rw-r--r--include/bsd/sys/cdefs.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h
index 0cd5d38..3c31b05 100644
--- a/include/bsd/sys/cdefs.h
+++ b/include/bsd/sys/cdefs.h
@@ -43,6 +43,12 @@
#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)