Skip to content

Commit

Permalink
Fixed bug 2017 - Adding some version macros like for SDL
Browse files Browse the repository at this point in the history
Martin Gerhardy

It would be great to get some version macros as we have them for SDL, too.

Some function prototypes had changes for SDL_mixer 2.0, too.

/**
 *  This is the version number macro for the current SDL_mixer version.
 */
#define SDL_MIXER_COMPILEDVERSION \
    SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL)

/**
 *  This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
 */
#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
    (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
  • Loading branch information
slouken committed Oct 21, 2017
1 parent d55b3da commit 313d16e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SDL_mixer.h
Expand Up @@ -58,6 +58,18 @@ extern "C" {
#define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL
#define MIX_VERSION(X) SDL_MIXER_VERSION(X)

/**
* This is the version number macro for the current SDL_mixer version.
*/
#define SDL_MIXER_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL)

/**
* This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
*/
#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \
(SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))

/* This function gets the version of the dynamically linked SDL_mixer library.
it should NOT be used to fill a version structure, instead you should
use the SDL_MIXER_VERSION() macro.
Expand Down

0 comments on commit 313d16e

Please sign in to comment.