Add macro for unused function attribute.
authorVinson Lee <vlee@freedesktop.org>
Sat, 7 Mar 2015 22:07:10 +0000 (14:07 -0800)
committerVinson Lee <vlee@freedesktop.org>
Tue, 10 Mar 2015 00:28:39 +0000 (17:28 -0700)
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
configure.ac
scons/gallium.py
src/util/macros.h

index 90c7737148e1bee7a97113c98b4e8b8b913501f6..2954f80b401b37f250c1b6394fbac2e424320769 100644 (file)
@@ -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)
 
index 7533f0651b8ac95df4f814b43d74d9b6ea120feb..b162089f62acc706536900accfe1c279fc4b3303 100755 (executable)
@@ -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',
index 63daba37c30e8be87ba907e0d1254829625da420..6c7bda7ae018e4d752ce1b6b897bd895d60a4f3f 100644 (file)
@@ -176,5 +176,11 @@ do {                       \
 #  endif
 #endif
 
+#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
 
 #endif /* UTIL_MACROS_H */