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.
This commit is contained in:
Doug Luce authored and Nicolas Williams committed 2015-06-18 19:19:15 -05:00
1 parent 0b42457929
commit 3cbefde376
3 files changed
+35 -6

No files matched your search

+17 -1
View File
@@ -10,8 +10,24 @@
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdlib.h>
#include <stddef.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#elif !defined alloca
# ifdef __GNUC__
# define alloca __builtin_alloca
# elif defined _MSC_VER
# include <malloc.h>
# define alloca _alloca
# elif !defined HAVE_ALLOCA
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
# endif
#endif
#ifndef WIN32
#include <pwd.h>
#endif