summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-05-13 13:17:02 -0700
committerMatt Turner <[email protected]>2016-05-16 11:06:15 -0700
commit377ab2f2d781aef9408f26b24bb8b17426be6606 (patch)
treec8b863c2af4344c669590c3561091d13c5b66a68 /src
parent40c6d54e76c5e5859a78841ed305935b2ca6922c (diff)
util: Add ATTRIBUTE_RETURNS_NONNULL.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/util/macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/macros.h b/src/util/macros.h
index c0bfb15a47a..9ddf675965b 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -154,6 +154,12 @@ do { \
#define ATTRIBUTE_PURE
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
+#define ATTRIBUTE_RETURNS_NONNULL __attribute__((__returns_nonnull__))
+#else
+#define ATTRIBUTE_RETURNS_NONNULL
+#endif
+
#ifdef __cplusplus
/**
* Macro function that evaluates to true if T is a trivially