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>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user