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:
SiZiOUS
2025-07-19 18:45:42 +02:00
committed by Damien George
parent f8f6d71940
commit f67a370311

View File

@@ -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