aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/compiler.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-05 07:42:31 +0100
committermarha <marha@users.sourceforge.net>2011-12-05 07:42:31 +0100
commit528f5bd58a139174170c4130c67dca30193c9057 (patch)
tree550c818095dbc607deaddf166c77116ccd91ef54 /mesalib/src/mesa/main/compiler.h
parent2cfebffb491807a465a8e5f7daca582d8aefb829 (diff)
downloadvcxsrv-528f5bd58a139174170c4130c67dca30193c9057.tar.gz
vcxsrv-528f5bd58a139174170c4130c67dca30193c9057.tar.bz2
vcxsrv-528f5bd58a139174170c4130c67dca30193c9057.zip
xserver xkeyboard-config mesa git update 5 dec 2011
Diffstat (limited to 'mesalib/src/mesa/main/compiler.h')
-rw-r--r--mesalib/src/mesa/main/compiler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h
index 921e30222..25d981053 100644
--- a/mesalib/src/mesa/main/compiler.h
+++ b/mesalib/src/mesa/main/compiler.h
@@ -310,6 +310,18 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
#endif
#endif
+
+/**
+ * Static (compile-time) assertion.
+ * Basically, use COND to dimension an array. If COND is false/zero the
+ * array size will be -1 and we'll get a compilation error.
+ */
+#define STATIC_ASSERT(COND) \
+ do { \
+ typedef int static_assertion_failed[(!!(COND))*2-1]; \
+ } while (0)
+
+
#if (__GNUC__ >= 3)
#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
#else