From 3a9088c144444f6a99347dbdce5d5430a9b6a145 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 28 Aug 2023 11:38:29 +0800 Subject: [PATCH] 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 --- include/alloca.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/alloca.h b/include/alloca.h index 80f62103d2..306559477c 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -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 */