From f90e5e2003ada9b0469792ea873e5ff02827a4ef Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Sat, 28 Mar 2015 18:48:20 +0000 Subject: [PATCH] Add STATIC_ASSERT. Remove VG__STRING. git-svn-id: svn://svn.valgrind.org/vex/trunk@3109 --- VEX/priv/main_util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VEX/priv/main_util.h b/VEX/priv/main_util.h index 5ef7a49e71..4dcdd946d9 100644 --- a/VEX/priv/main_util.h +++ b/VEX/priv/main_util.h @@ -50,13 +50,14 @@ # 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))) -- 2.47.2