From: Christian Heimes <christian@cheimes.de>
Date: Tue, 18 Jun 2013 11:22:17 +0000 (+0200)
Subject: Fix for r84195: add HAVE_ALLOCA_H to configure and only include alloca.h if it's... 
X-Git-Tag: v3.4.0a1~453^2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0400baba81579483b9763e95babd8a5e92e1ef1;p=python

Fix for r84195: add HAVE_ALLOCA_H to configure and only include alloca.h if it's available
---

diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index d0693b6c7d..ade52fd9d2 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -70,7 +70,10 @@
 
 #include <ffi.h>
 #include "ctypes.h"
+#ifdef HAVE_ALLOCA_H
+/* AIX needs alloca.h for alloca() */
 #include <alloca.h>
+#endif
 
 #if defined(_DEBUG) || defined(__MINGW32__)
 /* Don't use structured exception handling on Windows if this is defined.
diff --git a/configure b/configure
index ffa089ca54..a1b7bff2d2 100755
--- a/configure
+++ b/configure
@@ -6928,7 +6928,7 @@ sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/configure.ac b/configure.ac
index 9179fe64de..501c1da4dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1526,7 +1526,7 @@ sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h)
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h)
 CPPFLAGS=$ac_save_cppflags
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
diff --git a/pyconfig.h.in b/pyconfig.h.in
index cbbc42d99f..ba06ff4170 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -49,6 +49,9 @@
 /* Define to 1 if you have the `alarm' function. */
 #undef HAVE_ALARM
 
+/* Define to 1 if you have the <alloca.h> header file. */
+#undef HAVE_ALLOCA_H
+
 /* Define this if your time.h defines altzone. */
 #undef HAVE_ALTZONE