[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Proposal - Improved Version Checks



Version checks like this are very bad:

#if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>=3
(line 98 src/music.c)

This is a proposal to fix them.

They would be changed to something like this:

#if MIX_VERSION_ATLEAST(1, 2, 3)

All that needs to be done to implement this is to add this to pygame.h.

#ifndef MIX_COMPILEDVERSION
    #define MIX_COMPILEDVERSION SDL_VERSIONNUM(MIX_MAJOR_VERSION,
MIX_MINOR_VERSION, MIX_PATCHLEVEL)
#endif
#ifndef MIX_VERSION_ATLEAST
    #define MIX_VERSION_ATLEAST(X, Y, Z) (MIX_COMPILEDVERSION >=
SDL_VERSIONNUM(X, Y, Z))
#endif