sdl2-compat: make SDL_GetPlatform() to return "Mac OS X" for Apple macOS.

From ff10e31b89f0bebb24b37de7c9cfeb3bdfdd871b Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 29 Apr 2025 07:47:37 +0300
Subject: [PATCH] make SDL_GetPlatform() to return "Mac OS X" for Apple macOS.

Closes https://github.com/libsdl-org/sdl2-compat/issues/473.
---
 src/sdl2_compat.c | 10 ++++++++++
 src/sdl3_syms.h   |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index ccec56a..1b92ee9 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -633,6 +633,16 @@ SDL2Compat_GetExeName(void)
     return exename;
 }
 
+SDL_DECLSPEC const char * SDLCALL
+SDL_GetPlatform(void)
+{
+#ifdef SDL_PLATFORM_MACOS
+    return "Mac OS X";
+#else
+    return SDL3_GetPlatform();
+#endif
+}
+
 static struct {
     const char *old_hint;
     const char *new_hint;
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 25baa26..ba6bd70 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -344,7 +344,7 @@ SDL3_SYM_PASSTHROUGH(Uint64,GetPerformanceFrequency,(void),(),return)
 SDL3_SYM(const SDL_PixelFormatDetails *,GetPixelFormatDetails,(SDL_PixelFormat a),(a),return)
 SDL3_SYM(SDL_PixelFormat,GetPixelFormatForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return)
 SDL3_SYM(const char*,GetPixelFormatName,(SDL_PixelFormat a),(a),return)
-SDL3_SYM_PASSTHROUGH(const char*,GetPlatform,(void),(),return)
+SDL3_SYM(const char*,GetPlatform,(void),(),return)
 SDL3_SYM(void*,GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(SDL_PowerState,GetPowerInfo,(int *a, int *b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(char*,GetPrefPath,(const char *a, const char *b),(a,b),return)