|
|
@@ -27,7 +27,13 @@
|
|
|
|
|
|
/* Language definitions. */
|
|
|
|
|
|
-#if defined(__GNUC__) && (__GNUC__ >= 3)
|
|
|
+#ifdef __GNUC__
|
|
|
+#define DPKG_GCC_VERSION (__GNUC__ << 8 | __GNUC_MINOR__)
|
|
|
+#else
|
|
|
+#define DPKG_GCC_VERSION 0
|
|
|
+#endif
|
|
|
+
|
|
|
+#if DPKG_GCC_VERSION >= 0x0300
|
|
|
#define DPKG_ATTR_UNUSED __attribute__((unused))
|
|
|
#define DPKG_ATTR_CONST __attribute__((const))
|
|
|
#define DPKG_ATTR_PURE __attribute__((pure))
|
|
|
@@ -45,8 +51,7 @@
|
|
|
#define DPKG_ATTR_VPRINTF(n)
|
|
|
#endif
|
|
|
|
|
|
-#if defined(__GNUC__) && \
|
|
|
- ((__GNUC__ == 3 && __GNUC_MINOR__ > 2) || __GNUC__ >= 4)
|
|
|
+#if DPKG_GCC_VERSION > 0x0302
|
|
|
#define DPKG_ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
|
|
#define DPKG_ATTR_REQRET __attribute__((warn_unused_result))
|
|
|
#else
|
|
|
@@ -54,7 +59,7 @@
|
|
|
#define DPKG_ATTR_REQRET
|
|
|
#endif
|
|
|
|
|
|
-#if defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
+#if DPKG_GCC_VERSION >= 0x0400
|
|
|
#define DPKG_ATTR_SENTINEL __attribute__((sentinel))
|
|
|
#else
|
|
|
#define DPKG_ATTR_SENTINEL
|