Index: include/ansidecl.h |
diff --git a/include/ansidecl.h b/include/ansidecl.h |
index 23d85bf0e1617bebd508e0dbd3e0bd3748d5614b..5cd03a7d760ea2c3ae30ed0200979707ddac4639 100644 |
--- a/include/ansidecl.h |
+++ b/include/ansidecl.h |
@@ -279,8 +279,15 @@ So instead we use the macro below and test it against specific values. */ |
# endif |
#endif |
+/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend |
+ couldn't parse attributes placed after the identifier name, and now |
+ the entire compiler is built with C++. */ |
#ifndef ATTRIBUTE_UNUSED |
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
+#if GCC_VERSION >= 3004 |
+# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
+#else |
+#define ATTRIBUTE_UNUSED |
+#endif |
#endif /* ATTRIBUTE_UNUSED */ |
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the |
@@ -304,6 +311,15 @@ So instead we use the macro below and test it against specific values. */ |
# endif /* GNUC >= 3.3 */ |
#endif /* ATTRIBUTE_NONNULL */ |
+/* Attribute `returns_nonnull' was valid as of gcc 4.9. */ |
+#ifndef ATTRIBUTE_RETURNS_NONNULL |
+# if (GCC_VERSION >= 4009) |
+# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) |
+# else |
+# define ATTRIBUTE_RETURNS_NONNULL |
+# endif /* GNUC >= 4.9 */ |
+#endif /* ATTRIBUTE_RETURNS_NONNULL */ |
+ |
/* Attribute `pure' was valid as of gcc 3.0. */ |
#ifndef ATTRIBUTE_PURE |
# if (GCC_VERSION >= 3000) |