Use AC_FUNC_ALLOC

The preferred all-inclusive method for finding alloca().

Reported-by: Richard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89762
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-03-25 13:16:56 +00:00
parent aa40f99014
commit 8f11f2bdcd
3 changed files with 15 additions and 1 deletions

View File

@ -416,7 +416,8 @@ AC_ARG_ENABLE(sna,
[SNA="$enableval"],
[SNA=auto])
AC_CHECK_HEADERS([dev/wscons/wsconsio.h alloca.h])
AC_CHECK_HEADERS([dev/wscons/wsconsio.h])
AC_FUNC_ALLOCA
AC_HEADER_MAJOR
if test "x$SNA" != "xno"; then

4
libobj/alloca.c Normal file
View File

@ -0,0 +1,4 @@
void *alloca(size_t sz)
{
return NULL;
}

View File

@ -42,6 +42,15 @@
#if HAVE_ALLOCA_H
#include <alloca.h>
#elif defined __GNUC__
#define alloca __builtin_alloca
#elif defined _AIX
#define alloca __alloca
#elif defined _MSC_VER
#include <malloc.h>
#define alloca _alloca
#else
void *alloca(size_t);
#endif
#include "sna.h"