summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-05-03 10:14:16 +0200
committerstijn <stinos@zoho.com>2014-05-03 10:14:53 +0200
commit98e2ee0ec184c4c41cd0b6a633fe75a1fe40f8d3 (patch)
tree88ae7f553de7826ea5f7b5ac1271d61f8ee77046 /py
parent8f472ad5778876d3d8abcfec9459c0a106f629af (diff)
downloadmicropython-98e2ee0ec184c4c41cd0b6a633fe75a1fe40f8d3.tar.gz
micropython-98e2ee0ec184c4c41cd0b6a633fe75a1fe40f8d3.zip
py: Use <alloca.h> 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.
Diffstat (limited to 'py')
-rw-r--r--py/builtinimport.c6
-rw-r--r--py/objfun.c6
2 files changed, 2 insertions, 10 deletions
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 <stdint.h>
-#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
-#ifdef __MINGW32__
-// For alloca()
-#include <malloc.h>
-#endif
+#include <alloca.h>
#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 <stdbool.h>
-#include <stdlib.h>
#include <string.h>
#include <assert.h>
-#ifdef __MINGW32__
-// For alloca()
-#include <malloc.h>
-#endif
+#include <alloca.h>
#include "mpconfig.h"
#include "nlr.h"