From 3cbefde37656f2d3655e020e5922d33f44834187 Mon Sep 17 00:00:00 2001 From: Doug Luce Date: Thu, 18 Jun 2015 11:07:16 -0700 Subject: Add alloca() discovery to configure.ac The build failed on FreeBSD as there is no alloca.h. This patch is lifted from the autoconf documentation. --- builtin.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index 1e3f0854..4d538eac 100644 --- a/builtin.c +++ b/builtin.c @@ -1,10 +1,22 @@ #define _BSD_SOURCE #define _XOPEN_SOURCE #include -#ifdef WIN32 - #include -#else - #include +#include +#include +#ifdef HAVE_ALLOCA_H +# include +#elif !defined alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# elif !defined HAVE_ALLOCA +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif #endif #include #include @@ -13,7 +25,6 @@ #ifdef HAVE_ONIGURUMA #include #endif -#include #include #include #include "builtin.h" -- cgit v1.2.3