diff options
| author | SiZiOUS <sizious@gmail.com> | 2025-07-19 18:45:42 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-08-01 12:01:37 +1000 |
| commit | f67a3703118be7d97629130d99630996ff3cb255 (patch) | |
| tree | a01c1e2d7eac74f2d4f76bcc3b648d0c0fe58cab | |
| parent | f8f6d71940cb34c762d919a255f084d18fbcf1c1 (diff) | |
embed/port: Fix alloca include for Windows platforms.
When building the embedded port on MinGW-w64, I receive the following
error:
fatal error: alloca.h: No such file or directory
MinGW-w64 (used on MSYS2) doesn't include `alloca.h`, but `alloca()` is
provided via `malloc.h` instead. And this fix is also needed for other
Windows build systems.
Signed-off-by: SiZiOUS <sizious@gmail.com>
| -rw-r--r-- | ports/embed/port/mpconfigport_common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/embed/port/mpconfigport_common.h b/ports/embed/port/mpconfigport_common.h index 8e19859ed..aa65640fc 100644 --- a/ports/embed/port/mpconfigport_common.h +++ b/ports/embed/port/mpconfigport_common.h @@ -34,8 +34,13 @@ typedef long mp_off_t; // Need to provide a declaration/definition of alloca() #if defined(__FreeBSD__) || defined(__NetBSD__) +// BSD #include <stdlib.h> +#elif defined(_WIN32) +// Windows +#include <malloc.h> #else +// Other OS #include <alloca.h> #endif |
