Document SDL_VERSIONNUM as able to encode larger minor versions

Now that we've said this will be removed from SDL 3, we're free to use
any encoding that is compatible with existing SDL versions and will still
compare correctly for all SDL 2 version numbers. This allows the SDL 2
minor version to go beyond 1 digit, limited only by the size of
SDL_version.minor (which is 8 bits), making the largest possible version
number 2.255.99.

The patchlevel (micro version) is still limited to 2 digits.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-05-03 13:17:41 +01:00 committed by Sam Lantinga
parent e0daa2a530
commit ba6f96275e
1 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,10 @@ typedef struct SDL_version
\endverbatim \endverbatim
* *
* This assumes that there will never be more than 100 patchlevels. * This assumes that there will never be more than 100 patchlevels.
*
* In versions higher than 2.9.0, the minor version overflows into
* the thousands digit: for example, 2.23.0 is encoded as 4300,
* and 2.255.99 would be encoded as 25799.
* This macro will not be available in SDL 3.x. * This macro will not be available in SDL 3.x.
*/ */
#define SDL_VERSIONNUM(X, Y, Z) \ #define SDL_VERSIONNUM(X, Y, Z) \
@ -100,6 +104,8 @@ typedef struct SDL_version
/** /**
* This is the version number macro for the current SDL version. * This is the version number macro for the current SDL version.
* *
* In versions higher than 2.9.0, the minor version overflows into
* the thousands digit: for example, 2.23.0 is encoded as 4300.
* This macro will not be available in SDL 3.x. * This macro will not be available in SDL 3.x.
* *
* Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.