diff options
author | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-30 12:06:13 +0300 |
---|---|---|
committer | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-30 12:06:13 +0300 |
commit | e1a92c370e5bd57a29f4ad66c72bae1078275f62 (patch) | |
tree | 8d085420f10a54cf7a8dd77bcc27752bc3d9b20b | |
parent | cb35f8927bc8c6992d41efcc3b972f2d8ee318dc (diff) | |
download | ffts-e1a92c370e5bd57a29f4ad66c72bae1078275f62.zip ffts-e1a92c370e5bd57a29f4ad66c72bae1078275f62.tar.gz |
Detect presence of malloc.h, fixes anthonix/ffts#40
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/ffts_internal.h | 3 |
2 files changed, 8 insertions, 0 deletions
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 <malloc.h> +#endif + #include <stddef.h> #ifdef HAVE_STDINT_H |