From e1a92c370e5bd57a29f4ad66c72bae1078275f62 Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Thu, 30 Jul 2015 12:06:13 +0300 Subject: Detect presence of malloc.h, fixes anthonix/ffts#40 --- CMakeLists.txt | 5 +++++ src/ffts_internal.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b85fb1..63e636f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,17 @@ include(CMakePushCheckState) add_definitions(-DFFTS_CMAKE_GENERATED) # check existence of various headers +check_include_file(malloc.h HAVE_MALLOC_H) check_include_file(stdint.h HAVE_STDINT_H) check_include_file(stdlib.h HAVE_STDLIB_H) check_include_file(string.h HAVE_STRING_H) check_include_file(sys/mman.h HAVE_SYS_MMAN_H) check_include_file(unistd.h HAVE_UNISTD_H) +if(HAVE_MALLOC_H) + add_definitions(-DHAVE_MALLOC_H) +endif(HAVE_MALLOC_H) + if(HAVE_STDINT_H) add_definitions(-DHAVE_STDINT_H) endif(HAVE_STDINT_H) diff --git a/src/ffts_internal.h b/src/ffts_internal.h index 14d037d..30e814b 100644 --- a/src/ffts_internal.h +++ b/src/ffts_internal.h @@ -38,7 +38,10 @@ #include "ffts_attributes.h" #include "types.h" +#ifdef HAVE_MALLOC_H #include +#endif + #include #ifdef HAVE_STDINT_H -- cgit v1.1