The only generally portable way to do this is to use -std=gnu99, "#include <stdlib.h>", and write "alloca". __builtin_alloca does not seem to be available on NetBSD
@@ -41,6 +41,12 @@
# ifndef alloca
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
+# elif defined(__NETBSD__)
+# if defined(__STRICT_ANSI__)
+# define SDL_DISABLE_ALLOCA
+# else
+# include <stdlib.h>
+# endif
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)