summaryrefslogtreecommitdiff
path: root/Xfuncproto.h.in
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2015-01-11 00:39:14 +0100
committerThomas Klausner <wiz@NetBSD.org>2015-01-13 08:56:30 +0100
commit70cf8acf06705097b009a488994b526832b0ef66 (patch)
treeaf17010ad4c8110ef46076878335dea9a701b076 /Xfuncproto.h.in
parent303b137a55bb2d092b008439570a323c89a41d70 (diff)
Use C99 compliant definition of nonnull attribute.
Fixes warning with clang. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'Xfuncproto.h.in')
-rw-r--r--Xfuncproto.h.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in
index e9e5e71..5daa83e 100644
--- a/Xfuncproto.h.in
+++ b/Xfuncproto.h.in
@@ -152,6 +152,9 @@ in this Software without prior written authorization from The Open Group.
argument macros, must be only used inside #ifdef _X_NONNULL guards, as
many legacy X clients are compiled in C89 mode still. */
#if __has_attribute(nonnull) \
+ && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
+#define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+#elif __has_attribute(nonnull) \
|| defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
#define _X_NONNULL(args...) __attribute__((nonnull(args)))
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */