From 995af0f1dc5cbf7a822d2640c8def0b04dfd22f8 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 29 Nov 2023 13:23:26 -0500
Subject: [PATCH] Patched to compile against older SDL2 headers.
(Headers up to the 2.0.9 release need this.)
Fixes #324.
---
src/SDL20_include_wrapper.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/SDL20_include_wrapper.h b/src/SDL20_include_wrapper.h
index 785b89e47..083dc5ea6 100644
--- a/src/SDL20_include_wrapper.h
+++ b/src/SDL20_include_wrapper.h
@@ -921,6 +921,12 @@
#error You need to compile against SDL >= 2.0.7 headers.
#endif
+#if !SDL_VERSION_ATLEAST(2,0,10)
+// SDL_PixelFormatEnum was an anonymous enum before SDL 2.0.10.
+// Force it to Uint32 if compiling on older headers.
+typedef Uint32 SDL_PixelFormatEnum;
+#endif
+
/* Missing SDL_thread.h stuff (see above) */
#if defined(_WIN32) || defined(__OS2__)
typedef struct SDL_Thread SDL_Thread;