From ff98b64454821e35b5bdc2a1cfe349ef272b3021 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 23 Apr 2024 19:42:38 +0300 Subject: [PATCH] Include stdlib.h instead of alloca.h for alloca(3) on FreeBSD --- src/core/macros.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/macros.h b/src/core/macros.h index 32480525afc..c1419fec5bc 100644 --- a/src/core/macros.h +++ b/src/core/macros.h @@ -45,6 +45,10 @@ char (&COUNTOF_Helper(T (&array)[N]))[N]; #include #define stackalloc(T, n) reinterpret_cast(_alloca(sizeof(T) * n)) #else +#ifdef __FreeBSD__ +#include +#else #include +#endif #define stackalloc(T, n) reinterpret_cast(alloca(sizeof(T) * n)) #endif