mirror of
https://github.com/OldUnreal/libxmp.git
synced 2026-04-02 21:37:43 -07:00
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:
@@ -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])
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user