From 1e4cd682b3ff051e079bf4901c11528198e739e1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 25 Nov 2022 22:35:40 +0300
Subject: [PATCH] removed M_PI detection from cmake, removed HAVE_M_PI from
config files.
(didn't touch autofoo side for it so as not to break PR/6605)
---
CMakeLists.txt | 2 --
include/SDL_config.h.cmake | 1 -
include/SDL_config_emscripten.h | 1 -
include/SDL_config_iphoneos.h | 1 -
include/SDL_config_macosx.h | 1 -
include/SDL_config_windows.h | 6 ------
include/SDL_config_wingdk.h | 5 -----
include/SDL_config_winrt.h | 1 -
include/SDL_config_xbox.h | 5 -----
9 files changed, 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ddea68e500ad..11e1e92b72df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -996,7 +996,6 @@ if(SDL_LIBC)
set(HAVE_${_UPPER} 1)
endforeach()
set(HAVE_ALLOCA 1)
- check_symbol_exists(M_PI math.h HAVE_M_PI)
set(STDC_HEADERS 1)
else()
set(HAVE_LIBC TRUE)
@@ -1032,7 +1031,6 @@ if(SDL_LIBC)
set(STDC_HEADER_NAMES "stddef.h;stdarg.h;stdlib.h;string.h;stdio.h;wchar.h;float.h")
check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS)
- check_symbol_exists(M_PI math.h HAVE_M_PI)
# TODO: refine the mprotect check
check_c_source_compiles("#include <sys/types.h>
#include <sys/mman.h>
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index cebc9007b864..eeb72dda8f11 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -144,7 +144,6 @@
#cmakedefine HAVE_SSCANF 1
#cmakedefine HAVE_VSSCANF 1
#cmakedefine HAVE_VSNPRINTF 1
-#cmakedefine HAVE_M_PI 1
#cmakedefine HAVE_ACOS 1
#cmakedefine HAVE_ACOSF 1
#cmakedefine HAVE_ASIN 1
diff --git a/include/SDL_config_emscripten.h b/include/SDL_config_emscripten.h
index 989e1243a7bb..2198d30101b9 100644
--- a/include/SDL_config_emscripten.h
+++ b/include/SDL_config_emscripten.h
@@ -104,7 +104,6 @@
#define HAVE_SSCANF 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index 6db16eb4ccfb..0e4c1481485b 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -88,7 +88,6 @@
#define HAVE_STRCASESTR 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index e7189f3a14b0..e7cc310033b8 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -91,7 +91,6 @@
#define HAVE_STRCASESTR 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index 2ea2f9d2564e..87ca5ecb8b6f 100644
--- a/include/SDL_config_windows.h
+++ b/include/SDL_config_windows.h
@@ -217,12 +217,6 @@ typedef unsigned int uintptr_t;
#if _MSC_VER >= 1400
#define HAVE__FSEEKI64 1
#endif
-#ifdef _USE_MATH_DEFINES
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_M_PI 1
-#endif
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
diff --git a/include/SDL_config_wingdk.h b/include/SDL_config_wingdk.h
index 6f793d2aa2d8..28a890bd239d 100644
--- a/include/SDL_config_wingdk.h
+++ b/include/SDL_config_wingdk.h
@@ -155,11 +155,6 @@
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE__FSEEKI64 1
-#ifdef _USE_MATH_DEFINES
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_M_PI 1
#endif
#else
#define HAVE_STDARG_H 1
diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h
index da894c883ea7..92b6ca0fcb42 100644
--- a/include/SDL_config_winrt.h
+++ b/include/SDL_config_winrt.h
@@ -110,7 +110,6 @@
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
/* #undef HAVE_SSCANF */
-#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
diff --git a/include/SDL_config_xbox.h b/include/SDL_config_xbox.h
index 54fa1a42b54e..49bea334400f 100644
--- a/include/SDL_config_xbox.h
+++ b/include/SDL_config_xbox.h
@@ -155,11 +155,6 @@
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE__FSEEKI64 1
-#ifdef _USE_MATH_DEFINES
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_M_PI 1
#endif
#else
#define HAVE_STDARG_H 1