Skip to content

Commit de5a1a0

Browse files
committed
api: Added SDL_MIXER_VERSION_ATLEAST macro to match other satellite libraries.
Reference Issue #709.
1 parent 07d2c63 commit de5a1a0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/SDL3_mixer/SDL_mixer.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ typedef struct MIX_Group MIX_Group;
228228
*/
229229
#define SDL_MIXER_VERSION SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_MICRO_VERSION)
230230

231+
/**
232+
* This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
233+
*
234+
* \since This macro is available since SDL_mixer 3.0.0.
235+
*/
236+
#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
237+
((SDL_MIXER_MAJOR_VERSION >= X) && \
238+
(SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION >= Y) && \
239+
(SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION > Y || SDL_MIXER_MICRO_VERSION >= Z))
240+
231241
/**
232242
* Get the version of SDL_mixer that is linked against your program.
233243
*

0 commit comments

Comments
 (0)