Skip to content

Commit

Permalink
cmake: check for alloca() in stdlib.h and malloc.h, too (bug #5316)
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Oct 13, 2020
1 parent fc795f8 commit 665cfa4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -848,7 +848,12 @@ if(LIBC)

if(NOT APPLE)
check_include_file(alloca.h HAVE_ALLOCA_H)
check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA)
check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA1)
check_symbol_exists(alloca "stdlib.h" HAVE_ALLOCA2)
check_symbol_exists(alloca "malloc.h" HAVE_ALLOCA3)
if(HAVE_ALLOCA1 OR HAVE_ALLOCA2 OR HAVE_ALLOCA3)
set(HAVE_ALLOCA 1)
endif()
else()
set(HAVE_ALLOCA_H 1)
set(HAVE_ALLOCA 1)
Expand Down

0 comments on commit 665cfa4

Please sign in to comment.