Skip to content

Commit f67a370

Browse files
siziousdpgeorge
authored andcommitted
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 <[email protected]>
1 parent f8f6d71 commit f67a370

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/embed/port/mpconfigport_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ typedef long mp_off_t;
3434

3535
// Need to provide a declaration/definition of alloca()
3636
#if defined(__FreeBSD__) || defined(__NetBSD__)
37+
// BSD
3738
#include <stdlib.h>
39+
#elif defined(_WIN32)
40+
// Windows
41+
#include <malloc.h>
3842
#else
43+
// Other OS
3944
#include <alloca.h>
4045
#endif
4146

0 commit comments

Comments
 (0)