From 63c9ebeaff0f238368b59cbe1cb6dc9bbf7cba7d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Aug 2005 14:42:21 +0000 Subject: [PATCH] fix static assertion problem for gcc (bug 4022) --- src/mesa/shader/slang/slang_utility.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 0240385e8d5..2b040a44466 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -29,7 +29,10 @@ extern "C" { #endif -#define static_assert(expr) do { int _array[(expr) ? 1 : 0]; _array[0]; } while (0) +/* Compile-time assertions. If the expression is zero, try to declare an + * array of size [-1] to cause compilation error. + */ +#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; _array[0]; } while (0) void slang_alloc_free (void *); void *slang_alloc_malloc (unsigned int); -- 2.30.2