From a575e2cf5eeb8775cdf30ee85a4eda70d2fa4f24 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 17 Jan 2022 20:56:24 +0300
Subject: [PATCH] Enable alloca on mingw/cygwin builds:
This effectively reverts commit 391d73e37b26614e2e343ca8e9d4334e07380896
Fixes https://github.com/libsdl-org/SDL/issues/5234
---
CMakeLists.txt | 4 +---
configure.ac | 8 +-------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index efaa9e34dec..a6a8a002989 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -855,9 +855,7 @@ if(SDL_LIBC)
string(TOUPPER ${_FN} _UPPER)
set(HAVE_${_UPPER} 1)
endforeach()
- if(NOT CYGWIN AND NOT MINGW)
- set(HAVE_ALLOCA 1)
- endif()
+ set(HAVE_ALLOCA 1)
set(HAVE_M_PI 1)
target_compile_definitions(sdl-build-options INTERFACE "-D_USE_MATH_DEFINES") # needed for M_PI
set(STDC_HEADERS 1)
diff --git a/configure.ac b/configure.ac
index b60a1638c81..5728ed34d86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -318,13 +318,7 @@ dnl Check for typedefs, structures, etc.
dnl Check for defines
AC_CHECK_DEFINE(M_PI, math.h)
- case "$host" in
- *-*-cygwin* | *-*-mingw*)
- ;;
- *)
- AC_FUNC_ALLOCA
- ;;
- esac
+ AC_FUNC_ALLOCA
dnl Checks for library functions.
AC_FUNC_MEMCMP