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 <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36387 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
776da0872e
commit
eef992deac
|
@ -137,4 +137,8 @@
|
||||||
#define __unused __attribute__((unused))
|
#define __unused __attribute__((unused))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef alloca
|
||||||
|
#define alloca(x) __builtin_alloca(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* COMMONLIB_HELPERS_H */
|
#endif /* COMMONLIB_HELPERS_H */
|
||||||
|
|
Loading…
Reference in New Issue