Skip to content

Commit d5952a0

Browse files
gonnetxnnpack-bot
authored andcommitted
Add #define alloca(s) __builtin_alloca(s) when necessary.
PiperOrigin-RevId: 811967211
1 parent bad85d3 commit d5952a0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pthreads.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@
7777
#if defined(_MSC_VER)
7878
#include <malloc.h>
7979
#define alloca _alloca
80-
#endif // defined(_MSC_VER)
80+
#elif !defined(alloca) && defined(__GNUC__)
81+
#define alloca(s) __builtin_alloca(s)
82+
#else
83+
#include <alloca.h>
84+
#endif
8185

8286
/* Public library header */
8387
#include <pthreadpool.h>

0 commit comments

Comments
 (0)