summaryrefslogtreecommitdiffstats
path: root/src/util/macros.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-07-06 11:04:19 -0700
committerKenneth Graunke <[email protected]>2015-07-06 13:40:16 -0700
commit128de6f6d7cd0eb5386dcc622afc6e28a8512e7f (patch)
treeec9c075b7d47ad38ec59b131fe92db651fdb45e3 /src/util/macros.h
parent86a3557d7c95ac945eedf42ab095639b255c1bed (diff)
mesa: Add a MUST_CHECK macro for __attribute__((warn_unused_result)).
In the kernel, this is called __must_check; all our attribute macros in Mesa appear to be uppercase, so I went with that. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/util/macros.h')
-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 3b708ed6aa2..66698e72701 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -182,6 +182,12 @@ do { \
#define UNUSED
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
+#define MUST_CHECK __attribute__((warn_unused_result))
+#else
+#define MUST_CHECK
+#endif
+
/** Compute ceiling of integer quotient of A divided by B. */
#define DIV_ROUND_UP( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )