[virglrenderer-devel] [PATCH v2 01/21] vrend: Add #define for unused variables

Gert Wollny gert.wollny at collabora.com
Tue Jun 5 20:10:58 UTC 2018


This is required to silence -Wunused-parameter warnings.

v2: - Use mesa-style UNUSED for unused parameters 
    - Add it it gallium/aux/os_misc.h instead of util/u_debug.h, here it seems
      a bit more apropriate
    
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
 src/gallium/auxiliary/os/os_misc.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/auxiliary/os/os_misc.h b/src/gallium/auxiliary/os/os_misc.h
index 5029ab9..53cc208 100644
--- a/src/gallium/auxiliary/os/os_misc.h
+++ b/src/gallium/auxiliary/os/os_misc.h
@@ -43,6 +43,13 @@
 #  include <unistd.h> /* getpid() */
 #endif
 
+#ifdef __GNUC__
+#define UNUSED __attribute__((unused))
+#define MAYBE_UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#define MAYBE_UNUSED
+#endif
 
 #ifdef  __cplusplus
 extern "C" {
-- 
2.16.4



More information about the virglrenderer-devel mailing list