sdl2-compat: SDL_config_unix.h: Try to use __SIZEOF_POINTER__, if defined

From e6666ee871fa5b86f09121895983a94620ec550b Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Tue, 4 Feb 2025 20:16:27 +0000
Subject: [PATCH] SDL_config_unix.h: Try to use __SIZEOF_POINTER__, if defined

gcc (and presumably clang) predefines this, and if present, it seems
reasonable to treat it as authoritative.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 include/SDL2/SDL_config_unix.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/SDL2/SDL_config_unix.h b/include/SDL2/SDL_config_unix.h
index 82fae0d..2f2aac1 100644
--- a/include/SDL2/SDL_config_unix.h
+++ b/include/SDL2/SDL_config_unix.h
@@ -25,7 +25,9 @@
 #include "SDL_platform.h"
 
 /* C datatypes */
-#if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
+#if defined(__SIZEOF_POINTER__)
+#define SIZEOF_VOIDP (__SIZEOF_POINTER__)
+#elif defined(__LP64__) || defined(_LP64) || defined(_WIN64)
 #define SIZEOF_VOIDP 8
 #else
 #define SIZEOF_VOIDP 4