]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add STATIC_ASSERT. Remove VG__STRING.
authorFlorian Krohm <florian@eich-krohm.de>
Sat, 28 Mar 2015 18:48:20 +0000 (18:48 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sat, 28 Mar 2015 18:48:20 +0000 (18:48 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@3109

VEX/priv/main_util.h

index 5ef7a49e7105330c2203da26f6aad02362139754..4dcdd946d953751838530346e4b6aee73d6de4ad 100644 (file)
 #   define offsetof(type,memb) ((SizeT)(HWord)&((type*)0)->memb)
 #endif
 
-/* Stuff for panicking and assertion. */
+// Poor man's static assert
+#define STATIC_ASSERT(x)  extern int vex__unused_array[(x) ? 1 : -1]
 
-#define VG__STRING(__str)  #__str
+/* Stuff for panicking and assertion. */
 
 #define vassert(expr)                                           \
   ((void) (LIKELY(expr) ? 0 :                                   \
-           (vex_assert_fail (VG__STRING(expr),                  \
+           (vex_assert_fail (#expr,                             \
                              __FILE__, __LINE__,                \
                              __PRETTY_FUNCTION__), 0)))