From 44049ecf30b4ff1ac287270a5a21374b321dbd90 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Fri, 13 Jan 2023 22:20:18 +0100 Subject: [PATCH] all: enable WITH_VALGRIND by default --- Makefile | 3 +++ src/conf.h | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa4f8b29..a6dba611 100644 --- a/Makefile +++ b/Makefile @@ -144,6 +144,9 @@ endif ifeq ($(wildcard ./vendor/ucl/include/.),) $(error ERROR: missing git submodule; run 'git submodule update --init') endif +ifeq ($(wildcard ./vendor/valgrind/include/.),) + $(error ERROR: missing git submodule; run 'git submodule update --init') +endif ifeq ($(wildcard ./vendor/zlib/crc32.c),) $(error ERROR: missing git submodule; run 'git submodule update --init') endif diff --git a/src/conf.h b/src/conf.h index 4f66049a..515a8f39 100644 --- a/src/conf.h +++ b/src/conf.h @@ -175,8 +175,11 @@ ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) == 255) // -funsigned-char #endif // malloc debuggers -#if (WITH_VALGRIND) -# include +#ifndef WITH_VALGRIND +# define WITH_VALGRIND 1 +#endif +#if (WITH_VALGRIND) && defined(__GNUC__) && !defined(__SANITIZE_ADDRESS__) +# include #endif #if !defined(VALGRIND_MAKE_MEM_DEFINED) # define VALGRIND_MAKE_MEM_DEFINED(addr,len) 0