cmake: check for alloca() in stdlib.h and malloc.h, too (bug #5316)

This commit is contained in:
Ozkan Sezer 2020-10-13 14:32:15 +03:00
parent fc795f89d3
commit 665cfa4981
1 changed files with 6 additions and 1 deletions

View File

@ -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)