summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/rtl/source/alloc_impl.h10
-rw-r--r--sal/rtl/source/makefile.mk7
2 files changed, 9 insertions, 8 deletions
diff --git a/sal/rtl/source/alloc_impl.h b/sal/rtl/source/alloc_impl.h
index a216c6ea3..8fa379c88 100644
--- a/sal/rtl/source/alloc_impl.h
+++ b/sal/rtl/source/alloc_impl.h
@@ -242,11 +242,11 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
/** Valgrind support macros.
*/
-#if !defined(HAVE_VALGRIND_MEMCHECK_H) || (OSL_DEBUG_LEVEL == 0)
+#if !defined(HAVE_MEMCHECK_H) || (OSL_DEBUG_LEVEL == 0)
#if !defined(NVALGRIND)
#define NVALGRIND 1
#endif /* ! NVALGRIND */
-#endif /* ! HAVE_VALGRIND_MEMCHECK_H || (OSL_DEBUG_LEVEL == 0) */
+#endif /* ! HAVE_MEMCHECK_H || (OSL_DEBUG_LEVEL == 0) */
#if defined(NVALGRIND)
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
@@ -257,12 +257,12 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
#define VALGRIND_DESTROY_MEMPOOL(pool)
#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
#define VALGRIND_MEMPOOL_FREE(pool, addr)
-#elif defined(HAVE_VALGRIND_MEMCHECK_H)
-#include <valgrind/memcheck.h>
+#elif defined(HAVE_MEMCHECK_H)
+#include <memcheck.h>
#if !defined(FORCE_SYSALLOC)
#define FORCE_SYSALLOC 1
#endif /* !FORCE_SYSALLOC */
-#endif /* NVALGRIND || HAVE_VALGRIND_MEMCHECK_H */
+#endif /* NVALGRIND || HAVE_MEMCHECK_H */
#ifdef __cplusplus
}
diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk
index 80c8e736c..538a0466f 100644
--- a/sal/rtl/source/makefile.mk
+++ b/sal/rtl/source/makefile.mk
@@ -46,9 +46,10 @@ TARGETTYPE=CUI
.INCLUDE : settings.mk
-.IF "$(HAVE_VALGRIND_MEMCHECK_H)" == "TRUE"
-CDEFS+= -DHAVE_VALGRIND_MEMCHECK_H=1
-.ENDIF
+.IF "$(VALGRIND_CFLAGS)" != ""
+CFLAGS += $(VALGRIND_CFLAGS)
+CDEFS += -DHAVE_VALGRIND_MEMCHECK_H=1
+.ENDIF # VALGRIND_CFLAGS
.IF "$(ALLOC)" == "SYS_ALLOC" || "$(ALLOC)" == "TCMALLOC" || "$(ALLOC)" == "JEMALLOC"
CDEFS+= -DFORCE_SYSALLOC