summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-08-10 14:42:21 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-08-10 14:42:21 +0000
commit63c9ebeaff0f238368b59cbe1cb6dc9bbf7cba7d (patch)
tree2d24ff8c5057ba0514944f87fbd7c4bab16fd16d /src
parent6b563bda433cdcb18fd4107725f77f34f050940c (diff)
fix static assertion problem for gcc (bug 4022)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/slang/slang_utility.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h
index 0240385e8d..2b040a4446 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);