From de5a1a08c176f79228cc27496b0e22134ce64624 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 24 Jul 2025 13:01:32 -0400
Subject: [PATCH] api: Added SDL_MIXER_VERSION_ATLEAST macro to match other
satellite libraries.
Reference Issue #709.
---
include/SDL3_mixer/SDL_mixer.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/SDL3_mixer/SDL_mixer.h b/include/SDL3_mixer/SDL_mixer.h
index 13206334..a018b140 100644
--- a/include/SDL3_mixer/SDL_mixer.h
+++ b/include/SDL3_mixer/SDL_mixer.h
@@ -228,6 +228,16 @@ typedef struct MIX_Group MIX_Group;
*/
#define SDL_MIXER_VERSION SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_MICRO_VERSION)
+/**
+ * This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
+ *
+ * \since This macro is available since SDL_mixer 3.0.0.
+ */
+#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
+ ((SDL_MIXER_MAJOR_VERSION >= X) && \
+ (SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION >= Y) && \
+ (SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION > Y || SDL_MIXER_MICRO_VERSION >= Z))
+
/**
* Get the version of SDL_mixer that is linked against your program.
*