From eef992deacf0dd49ef9c4e1690bd7e80cf1bfcce Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Sun, 27 Oct 2019 14:02:10 -0600 Subject: commonlib/helpers: Add alloca() macro If there is no alloca() macro defined, then define it as __builtin_alloca(), as most compilers support that as an intrinsic instead, if no alloca.h is included. Change-Id: I8730d57ce7c2f323b52e7a5720c598fb7af16b44 Signed-off-by: Tim Wawrzynczak Reviewed-on: https://review.coreboot.org/c/coreboot/+/36387 Reviewed-by: Julius Werner Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/commonlib/include/commonlib/helpers.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/commonlib') diff --git a/src/commonlib/include/commonlib/helpers.h b/src/commonlib/include/commonlib/helpers.h index 4429ea41c3..f3b71d7016 100644 --- a/src/commonlib/include/commonlib/helpers.h +++ b/src/commonlib/include/commonlib/helpers.h @@ -137,4 +137,8 @@ #define __unused __attribute__((unused)) #endif +#ifndef alloca +#define alloca(x) __builtin_alloca(x) +#endif + #endif /* COMMONLIB_HELPERS_H */ -- cgit v1.2.3