Commit 8f11f2bd authored by Chris Wilson's avatar Chris Wilson

Use AC_FUNC_ALLOC

The preferred all-inclusive method for finding alloca().
Reported-by: 's avatarRichard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89762Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent aa40f990
......@@ -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
......
void *alloca(size_t sz)
{
return NULL;
}
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment