]> mj.ucw.cz Git - libucw.git/commitdiff
Added CPP_ASSERT.
authorMartin Mares <mj@ucw.cz>
Fri, 27 Feb 2004 15:32:59 +0000 (15:32 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 27 Feb 2004 15:32:59 +0000 (15:32 +0000)
lib/lib.h

index b737c67749c012ffd15b89f97926eba67902f49e..1716303afa8e24bfe1904d382bfb054545e63ab1 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -69,6 +69,8 @@ void assert_failed(void) NONRET;
 #define ASSERT(x) do { if (__builtin_constant_p(x) && !(x)) assert_failed(); } while(0)
 #endif
 
 #define ASSERT(x) do { if (__builtin_constant_p(x) && !(x)) assert_failed(); } while(0)
 #endif
 
+#define CPP_ASSERT(name,x) typedef char _CPP_ASSERT_##name[!!(x)-1]
+
 #ifdef LOCAL_DEBUG
 #define DBG(x,y...) log(L_DEBUG, x,##y)
 #else
 #ifdef LOCAL_DEBUG
 #define DBG(x,y...) log(L_DEBUG, x,##y)
 #else