From d6291d4d4209c974751110afdcb040896d791b4f Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 22 Nov 2023 03:27:24 +0100 Subject: [PATCH] alloca: use alloca from on NetBSD The only generally portable way to do this is to use -std=gnu99, "#include ", and write "alloca". __builtin_alloca does not seem to be available on NetBSD --- include/SDL3/SDL_stdinc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 520c7561a..50d81825c 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -41,6 +41,12 @@ # ifndef alloca # ifdef HAVE_ALLOCA_H # include +# elif defined(__NETBSD__) +# if defined(__STRICT_ANSI__) +# define SDL_DISABLE_ALLOCA +# else +# include +# endif # elif defined(__GNUC__) # define alloca __builtin_alloca # elif defined(_MSC_VER)