ccan: Fix failtest on Fedora 16 as stdlib.h does not imply malloc.h
authorAndrew Bartlett <abartlet@samba.org>
Tue, 10 Apr 2012 22:27:14 +0000 (08:27 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 11 Apr 2012 00:30:40 +0000 (02:30 +0200)
The issue is that there are two different sources of the malloc
prototype, and they both need to be included otherwise the failtest
overrides chokes on the headers.

Andrew Bartlett

lib/ccan/failtest/failtest_override.h

index b056d538d482d31216b4dab492cb50fae5d9d7fd..7d03188ea94e7ffc335685bcc655e58f6dd4cb1e 100644 (file)
 /* Replacement of allocators. */
 #include <stdlib.h>
 
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
 #undef calloc
 #define calloc(nmemb, size)    \
        failtest_calloc((nmemb), (size), __FILE__, __LINE__)