summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2015-03-07 14:07:10 -0800
committerVinson Lee <[email protected]>2015-03-09 17:28:39 -0700
commit5f759836ad75360a2f4581083043a86f7a8c1e09 (patch)
treef0a41101eaceba2f48cc9c2d188156b6764cbb93
parent7aba4ab1f355ea1a5870b3deb4b295565132dfc5 (diff)
Add macro for unused function attribute.
Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r--configure.ac1
-rwxr-xr-xscons/gallium.py1
-rw-r--r--src/util/macros.h6
3 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 90c7737148e..2954f80b401 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,7 @@ AX_GCC_FUNC_ATTRIBUTE([flatten])
AX_GCC_FUNC_ATTRIBUTE([format])
AX_GCC_FUNC_ATTRIBUTE([malloc])
AX_GCC_FUNC_ATTRIBUTE([packed])
+AX_GCC_FUNC_ATTRIBUTE([unused])
AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
diff --git a/scons/gallium.py b/scons/gallium.py
index 7533f0651b8..b162089f62a 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -369,6 +369,7 @@ def generate(env):
'HAVE___BUILTIN_FFS',
'HAVE___BUILTIN_FFSLL',
'HAVE_FUNC_ATTRIBUTE_FLATTEN',
+ 'HAVE_FUNC_ATTRIBUTE_UNUSED',
# GCC 3.0
'HAVE_FUNC_ATTRIBUTE_FORMAT',
'HAVE_FUNC_ATTRIBUTE_PACKED',
diff --git a/src/util/macros.h b/src/util/macros.h
index 63daba37c30..6c7bda7ae01 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -176,5 +176,11 @@ do { \
# endif
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
#endif /* UTIL_MACROS_H */