libs/alloca: add alloca implement for MSVC

Reference:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-08-28 11:38:29 +08:00 committed by Alan Carvalho de Assis
parent 01cc1687b3
commit 3a9088c144

View File

@ -32,6 +32,11 @@
# undef __alloca
# define alloca(size) __alloca(size)
# define __alloca(size) __builtin_alloca(size)
#elif defined(_MSC_VER)
# undef alloca
# undef __alloca
# define alloca(size) _alloca(size)
# define __alloca(size) _alloca(size)
#endif
#endif /* __INCLUDE_ALLOCA_H */