On Thu, Mar 3, 2011 at 4:28 PM, Tony Finch <d...@dotat.at> wrote:
> We're preparing a release of Exim-4.75 which includes copies of valgrind.h
> and memcheck.h from valgrind-3.6.0. This mostly fixed our portability
> problems. Thanks!
>
> Heiko Schlichting reported a problem compiling on Irix. Its compiler
> doesn't support variable argument macros which means it chokes on the
> following:
>
> #if defined(NVALGRIND)
>
> #  define VALGRIND_PRINTF(...)
> #  define VALGRIND_PRINTF_BACKTRACE(...)
>
> #else /* NVALGRIND */
>
> I've stubbed it out in a fairly half-arsed manner since we don't use these
> macros. I was hoping you guys might have a better fix.

Does the patch below help ?

Index: include/valgrind.h
===================================================================
--- include/valgrind.h  (revision 11577)
+++ include/valgrind.h  (working copy)
@@ -4415,13 +4415,6 @@
    is the number of characters printed, excluding the "**<pid>** " 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)
 /* Modern GCC will optimize the static routine out if unused,
    and unused attribute will shut down warnings about it.  */
@@ -4434,6 +4427,9 @@
 #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,6 +4448,7 @@
 #endif
    va_end(vargs);
    return (int)_qzz_res;
+#endif /* NVALGRIND */
 }

 #if !defined(_MSC_VER)
@@ -4464,6 +4461,9 @@
 #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,11 +4482,10 @@
 #endif
    va_end(vargs);
    return (int)_qzz_res;
+#endif /* NVALGRIND */
 }

-#endif /* NVALGRIND */

-
 /* These requests allow control to move from the simulated CPU to the
    real CPU, calling an arbitary function.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to