From 98e2ee0ec184c4c41cd0b6a633fe75a1fe40f8d3 Mon Sep 17 00:00:00 2001 From: stijn Date: Sat, 3 May 2014 10:14:16 +0200 Subject: [PATCH] py: Use for alloca() alloca() is declared in alloca.h which als happens to be included by stdlib.h. On mingw however it resides in malloc.h only. So if we include alloca.h directly, and add an alloca.h for mingw in it's port directory we can get rid of the mingw-specific define to include malloc.h and the other ports are happy as well. --- py/builtinimport.c | 6 +----- py/objfun.c | 6 +----- windows/alloca.h | 1 + 3 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 windows/alloca.h diff --git a/py/builtinimport.c b/py/builtinimport.c index 323b63ef61..f4e089b5d8 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -1,12 +1,8 @@ #include -#include #include #include #include -#ifdef __MINGW32__ -// For alloca() -#include -#endif +#include #include "mpconfig.h" #include "nlr.h" diff --git a/py/objfun.c b/py/objfun.c index e0c25771e1..2855c7452b 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -1,11 +1,7 @@ #include -#include #include #include -#ifdef __MINGW32__ -// For alloca() -#include -#endif +#include #include "mpconfig.h" #include "nlr.h" diff --git a/windows/alloca.h b/windows/alloca.h new file mode 100644 index 0000000000..f8fa6f17a0 --- /dev/null +++ b/windows/alloca.h @@ -0,0 +1 @@ +#include