}
#undef assert
-#undef VG__STRING
+#undef STRINGIFY
-#define VG__STRING(__str) #__str
+#define STRINGIFY(__str) #__str
#define assert(expr) \
((void) ((expr) ? 0 : \
- (my_assert_fail (VG__STRING(expr), \
+ (my_assert_fail (STRINGIFY(expr), \
__FILE__, __LINE__, \
__PRETTY_FUNCTION__), 0)))
#define vg_assert(expr) \
((void) ((expr) ? 0 : \
- (VG_(core_assert_fail) (VG__STRING(expr), \
+ (VG_(core_assert_fail) (VG_STRINGIFY(expr), \
__FILE__, __LINE__, \
__PRETTY_FUNCTION__), 0)))
__attribute__ ((__noreturn__))
}
// Set redzone size for V's allocator
- vg_malloc_redzonep = dlsym(handle, STR(VG_(vg_malloc_redzone_szB)));
+ vg_malloc_redzonep = dlsym(handle, VG_STRINGIFY(VG_(vg_malloc_redzone_szB)));
if ( NULL != vg_malloc_redzonep ) {
VG_(vg_malloc_redzone_szB) = *vg_malloc_redzonep;
}
#define CHECK_NOT(var, value) \
if ((var)==(value)) { \
VG_(printf)("\nTool error: `%s' not initialised\n", \
- VG__STRING(var)); \
+ VG_STRINGIFY(var)); \
VG_(tool_panic)("Uninitialised details field\n"); \
}
/* ------------------------------------------------------------------ */
/* assert.h */
/* Asserts permanently enabled -- no turning off with NDEBUG. Hurrah! */
-#define VG__STRING(__str) #__str
+
+/* This odd definition lets us stringify VG_(x) function names to
+ "vgPlain_x". We need to do two macroexpansions to get the VG_ macro
+ expanded before stringifying. */
+#define VG_STRINGIFY_WRK(x) #x
+#define VG_STRINGIFY(x) VG_STRINGIFY_WRK(x)
#define tl_assert(expr) \
((void) ((expr) ? 0 : \
- (VG_(tool_assert_fail) (VG__STRING(expr), \
+ (VG_(tool_assert_fail) (VG_STRINGIFY(expr), \
__FILE__, __LINE__, \
__PRETTY_FUNCTION__), 0)))
/* Tool-specific ones. Note that final name still starts with "vg". */
#define TL_(str) VGAPPEND(vgTool_,str)
-/* This is specifically for stringifying VG_(x) function names. We
- need to do two macroexpansions to get the VG_ macro expanded before
- stringifying */
-#define _STR(x) #x
-#define STR(x) _STR(x)
-
#endif /* ndef __TOOL_ASM_H */
/*--------------------------------------------------------------------*/