Check if alloca uses alloca.h

Check this because alloca() in Solaris needs alloca.h and Win32 doesn't
have the header.
This commit is contained in:
Claudio Matsuoka
2012-09-19 17:47:38 -03:00
parent b0004a9843
commit 518f688d63
2 changed files with 11 additions and 1 deletions

View File

@@ -58,7 +58,7 @@ XMP_TRY_COMPILE(whether compiler understands -fvisibility=hidden,
ac_cv_c_flag_f_visibility_hidden,
-fvisibility=hidden,[
int main(){}],
[CFLAGS="${CFLAGS} -fvisibility=hidden"
[LDFLAGS="${LDFLAGS} -fvisibility=hidden"
LD_VERSCRIPT="-Wl,--version-script,libxmp.map"])
XMP_TRY_COMPILE(whether compiler understands -Wunused-but-set-variable,
@@ -79,6 +79,12 @@ XMP_TRY_COMPILE(whether compiler understands -Warray-bounds,
int main(){}],
CFLAGS="${CFLAGS} -Wno-array-bounds")
XMP_TRY_COMPILE(whether alloca() needs alloca.h,
ac_cv_c_flag_w_have_alloca_h,,[
#include <alloca.h>
int main(){}],
AC_DEFINE(HAVE_ALLOCA_H))
AC_CHECK_LIB(m,pow)
AC_CHECK_FUNCS(popen mkstemp fnmatch strlcpy)
AC_CONFIG_FILES([Makefile])

View File

@@ -42,6 +42,10 @@ extern "C" {
// will occur from it as described above. Otherwise just pass NULL
// to use malloc()/alloca()
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
typedef struct
{
char *alloc_buffer;