From c03eab7793aa1e1c8eef577297b2a1c05794dd70 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 4 Mar 2011 16:55:56 +0000 Subject: [PATCH] : Made VALGRIND_PRINTF() and VALGRIND_PRINTF_BACKTRACE() definitions (with NVALGRIND defined) C89-compliant. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11580 --- include/valgrind.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/include/valgrind.h b/include/valgrind.h index 0bae0aa130..509cc4bcf2 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -4415,14 +4415,7 @@ vg_VALGRIND_DO_CLIENT_REQUEST_EXPR(uintptr_t _zzq_default, is the number of characters printed, excluding the "**** " part at the start and the backtrace (if present). */ -#if defined(NVALGRIND) - -# define VALGRIND_PRINTF(...) -# define VALGRIND_PRINTF_BACKTRACE(...) - -#else /* NVALGRIND */ - -#if !defined(_MSC_VER) +#if defined(__GNUC__) || defined(__INTEL_COMPILER) /* Modern GCC will optimize the static routine out if unused, and unused attribute will shut down warnings about it. */ static int VALGRIND_PRINTF(const char *format, ...) @@ -4434,6 +4427,9 @@ __inline #endif VALGRIND_PRINTF(const char *format, ...) { +#if defined(NVALGRIND) + return 0; +#else /* NVALGRIND */ unsigned long _qzz_res; va_list vargs; va_start(vargs, format); @@ -4452,9 +4448,10 @@ VALGRIND_PRINTF(const char *format, ...) #endif va_end(vargs); return (int)_qzz_res; +#endif /* NVALGRIND */ } -#if !defined(_MSC_VER) +#if defined(__GNUC__) || defined(__INTEL_COMPILER) static int VALGRIND_PRINTF_BACKTRACE(const char *format, ...) __attribute__((format(__printf__, 1, 2), __unused__)); #endif @@ -4464,6 +4461,9 @@ __inline #endif VALGRIND_PRINTF_BACKTRACE(const char *format, ...) { +#if defined(NVALGRIND) + return 0; +#else /* NVALGRIND */ unsigned long _qzz_res; va_list vargs; va_start(vargs, format); @@ -4482,9 +4482,8 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) #endif va_end(vargs); return (int)_qzz_res; -} - #endif /* NVALGRIND */ +} /* These requests allow control to move from the simulated CPU to the -- 2.47.2