mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-27 04:30:37 +02:00
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 <kenneth@whitecape.org>
This commit is contained in:
parent
456f40e18d
commit
5db2249493
2 changed files with 2 additions and 2 deletions
|
|
@ -255,7 +255,7 @@ void _ReadWriteBarrier(void);
|
|||
*/
|
||||
#define STATIC_ASSERT(COND) \
|
||||
do { \
|
||||
typedef int static_assertion_failed[(!!(COND))*2-1]; \
|
||||
(void) sizeof(char [1 - 2*!(COND)]); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue