base/ct-test.in: Don't call Valgrind macros unless we found the headers.
[catacomb] / base / ct-test.c
index b4cddc6..e0f62e5 100644 (file)
  */
 
 void ct_poison(const void *p, size_t sz)
-  { VALGRIND_MAKE_MEM_UNDEFINED(p, sz); }
+{
+#ifdef HAVE_VALGRIND_H
+  VALGRIND_MAKE_MEM_UNDEFINED(p, sz);
+#endif
+}
 
 /* --- @ct_remedy@ --- *
  *
@@ -74,6 +78,10 @@ void ct_poison(const void *p, size_t sz)
  */
 
 void ct_remedy(const void *p, size_t sz)
-  { VALGRIND_MAKE_MEM_DEFINED(p, sz); }
+{
+#ifdef HAVE_VALGRIND_H
+  VALGRIND_MAKE_MEM_DEFINED(p, sz);
+#endif
+}
 
 /*----- That's all, folks -------------------------------------------------*/