diff --git a/py/builtinimport.c b/py/builtinimport.c index 795d9fd5e1ace2612bbe01095ce51061df5960fd..44ba4d5541567ca8b121aebf45cd5d35ad1f4b2c 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -29,7 +29,6 @@ #include <stdio.h> #include <string.h> #include <assert.h> -#include <alloca.h> #include "mpconfig.h" #include "nlr.h" diff --git a/py/objfun.c b/py/objfun.c index 5743fa550f895a5cb52b438352e007d5e6defb23..d63acc687b6aa1df35ddf5e0618e8e92b502efee 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -28,7 +28,6 @@ #include <stdbool.h> #include <string.h> #include <assert.h> -#include <alloca.h> #include "mpconfig.h" #include "nlr.h" diff --git a/py/runtime.c b/py/runtime.c index 179b48d327b4b1b142dc8d9eb32ebe0fd5951bcc..d57bb686d1787058b085d1becd96948f26671242 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -27,7 +27,6 @@ #include <stdio.h> #include <string.h> #include <assert.h> -#include <alloca.h> #include "mpconfig.h" #include "nlr.h" diff --git a/py/vm.c b/py/vm.c index c084d8911458980d79a617aaed1afe3756f686ef..42709889cdd28bd6402e2138a239268ce91073c8 100644 --- a/py/vm.c +++ b/py/vm.c @@ -28,7 +28,6 @@ #include <stdio.h> #include <string.h> #include <assert.h> -#include <alloca.h> #include "mpconfig.h" #include "nlr.h" diff --git a/unix/modsocket.c b/unix/modsocket.c index d6f732377d3a6ecb23fc84e1ba86946afca7b401..b1a34a39b8fcb88b0640e090f3d702e100b81200 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -37,7 +37,6 @@ #include <arpa/inet.h> #include <netdb.h> #include <errno.h> -#include <alloca.h> #include "mpconfig.h" #include "nlr.h" diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index bf2cf73efd671277a8f318af46a9a8b70970e2e1..f6cef8578cf6b9f38bb4272b6fb556bed316ea36 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -99,3 +99,11 @@ extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, + + +/* We need the correct header for alloca() */ +#ifdef __FreeBSD__ +#include <stdlib.h> +#else +#include <alloca.h> +#endif diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index 94304e20d2a60167cf973d7b64565f706c62375d..831a218fbc4d6284b6fba5b2adbcdc94ca8e636e 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -114,7 +114,7 @@ void msec_sleep(double msec); #include <stddef.h> //for NULL #include <assert.h> //for assert - +#include <alloca.h> //for alloca() // Functions implemented in platform code