]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge STR and VG__STRING macros into one, VG_STRINGIFY. Also, in
authorNicholas Nethercote <njn@valgrind.org>
Sun, 27 Mar 2005 01:25:38 +0000 (01:25 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 27 Mar 2005 01:25:38 +0000 (01:25 +0000)
valgrind-listener.c, don't use the VG_ prefix on its equivalent, because
it's a local definition.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3454

auxprogs/valgrind-listener.c
coregrind/core.h
coregrind/vg_main.c
coregrind/vg_needs.c
include/tool.h.base
include/tool_asm.h

index c44010dcef21d15cd104c6c1f886a5b154c0a8cd..dd9008167a0c6f0ed2702673d2b16290bc36723d 100644 (file)
@@ -80,12 +80,12 @@ static void my_assert_fail ( const Char* expr, const Char* file, Int line, const
 }
 
 #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)))
 
index 8108a12dbac18b96b8c223bf211149c6659257cd..b990e612a9a42ec93c919a149a48fb3d0837e58f 100644 (file)
@@ -792,7 +792,7 @@ extern void VG_(wait_for_threadstate)(Bool (*pred)(void *), void *arg);
 
 #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__))
index 81181cf2495cafa0ca79944f976a0659a01bf2e5..e48dab5239e69380b358d1979cd8e88e8965db95 100644 (file)
@@ -1244,7 +1244,7 @@ static void load_tool( const char *toolname, void** handle_out,
    }
 
    // 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;
    }
index ada4419c932631da1e62a1dda49926a35e252db8..688eb0c872b4e4454f4202e7ead90f4ecef65b98 100644 (file)
@@ -67,7 +67,7 @@ void VG_(sanity_check_needs) ( void)
 #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");     \
    }
    
index 4b5d6c64b66a796e17d211d197e3beef7c07cf48..3373277939cb1b94f8d45e6857d838c349b4d092 100644 (file)
@@ -451,11 +451,16 @@ extern Bool VG_(getcwd_alloc) ( Char** cwd );
 /* ------------------------------------------------------------------ */
 /* 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)))
 
index 61f1b0cfcee15c872b568f4c5d1af5aa04ea5d2a..8b9f52884ab69ec650dee71494cfb7cd79be6750 100644 (file)
 /* 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 */
 
 /*--------------------------------------------------------------------*/