summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/compiler.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-04-02 09:51:47 -0700
committerPaul Berry <[email protected]>2013-04-04 09:52:18 -0700
commit5db22494934779a3e7fb7669379d1693ff19d39f (patch)
tree5e32c66dbd1817673b4d3c385fea4357c6956956 /src/mesa/main/compiler.h
parent456f40e18d39d35a6fabedf6ac4cc3d46126a517 (diff)
Avoid spurious GCC warnings in STATIC_ASSERT() macro.
GCC 4.8 now warns about typedefs that are local to a scope and not used anywhere within that scope. This produced spurious warnings with the STATIC_ASSERT() macro (which used a typedef to provoke a compile error in the event of an assertion failure). This patch switches to a simpler technique that avoids the warning. v2: Avoid GCC-specific syntax. Also update p_compiler.h. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/compiler.h')
-rw-r--r--src/mesa/main/compiler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 8b23665e689..8431534c313 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -256,7 +256,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
*/
#define STATIC_ASSERT(COND) \
do { \
- typedef int static_assertion_failed[(!!(COND))*2-1]; \
+ (void) sizeof(char [1 - 2*!(COND)]); \
} while (0)