X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-valgrind-internal.h;h=6760b40def135dd9e55c0d40e11630e148dd5e38;hb=1200c464b6c9051340960e07f0d61a51dad71286;hp=4c972c598a2a61cefef6372e0923fb76c9286b35;hpb=b3f2ee5c6bade555630e52b8aa18fd639e047a80;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-valgrind-internal.h b/dbus/dbus-valgrind-internal.h index 4c972c5..6760b40 100644 --- a/dbus/dbus-valgrind-internal.h +++ b/dbus/dbus-valgrind-internal.h @@ -32,14 +32,34 @@ # include # include #else -# define VALGRIND_CREATE_MEMPOOL(_1, _2, _3) /* nothing */ -# define VALGRIND_DESTROY_MEMPOOL(_1) /* nothing */ -# define VALGRIND_MEMPOOL_ALLOC(_1, _2, _3) /* nothing */ -# define VALGRIND_MEMPOOL_FREE(_1, _2) /* nothing */ -# define VALGRIND_MAKE_MEM_UNDEFINED(_1, _2) (0) - -# define VALGRIND_PRINTF(...) (0) -# define VALGRIND_PRINTF_BACKTRACE(...) (0) +# define VALGRIND_CREATE_MEMPOOL(_1, _2, _3) do { } while (0) +# define VALGRIND_DESTROY_MEMPOOL(_1) do { } while (0) +# define VALGRIND_MEMPOOL_ALLOC(_1, _2, _3) do { } while (0) +# define VALGRIND_MEMPOOL_FREE(_1, _2) do { } while (0) + +/* Recent gcc will warn if you have a statement that's just a macro + * expanding to (0), but not if you have an inline stub function that + * always returns 0, so let's do the latter. */ +static inline int +VALGRIND_MAKE_MEM_UNDEFINED (void *addr, + size_t len) +{ + return 0; +} + +static inline int +VALGRIND_PRINTF (const char *format, + ...) +{ + return 0; +} + +static inline int +VALGRIND_PRINTF_BACKTRACE (const char *format, + ...) +{ + return 0; +} # define RUNNING_ON_VALGRIND 0 #endif /* WITH_VALGRIND */