Skip to content

Commit ff98b64

Browse files
AMDmi3Webster Sheets
authored andcommitted
Include stdlib.h instead of alloca.h for alloca(3) on FreeBSD
1 parent d4ce2a4 commit ff98b64

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/core/macros.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ char (&COUNTOF_Helper(T (&array)[N]))[N];
4545
#include <malloc.h>
4646
#define stackalloc(T, n) reinterpret_cast<T *>(_alloca(sizeof(T) * n))
4747
#else
48+
#ifdef __FreeBSD__
49+
#include <stdlib.h>
50+
#else
4851
#include <alloca.h>
52+
#endif
4953
#define stackalloc(T, n) reinterpret_cast<T *>(alloca(sizeof(T) * n))
5054
#endif

0 commit comments

Comments
 (0)