Shpoike/Quakespasm

What is with weird SDL version check?

etosan opened this issue · 5 comments

What is the issue with weird SDL version check?

Are not future/newer SDL version releases backwards compatible?

After recent system update my build started dying on me with following error:

Found SDL version 2.24.0

ERROR-OUT BEGIN


QUAKE ERROR: Your version of SDL library is incompatible with me.
You need a library version in the line of 2.0.0

2.24.0 is not that far from 2.0.0 why die in such case?

Quickly removing the check, allowed me to start the binary and it seems to be working:

diff --git a/quakespasm/Quake/main_sdl.c b/quakespasm/Quake/main_sdl.c
index 9284af3a..ce0d9571 100644
--- a/quakespasm/Quake/main_sdl.c
+++ b/quakespasm/Quake/main_sdl.c
@@ -74,11 +74,11 @@ static void Sys_InitSDL (void)
        {       /*reject running under older SDL versions */
                Sys_Error("You need at least v%d.%d.%d of SDL to run this game.", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
        }
-       if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) >= SDL_NEW_VERSION_REJECT)
-       {       /*reject running under newer (1.3.x) SDL */
-               Sys_Error("Your version of SDL library is incompatible with me.\n"
-                         "You need a library version in the line of %d.%d.%d\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
-       }
+//     if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) >= SDL_NEW_VERSION_REJECT)
+//     {       /*reject running under newer (1.3.x) SDL */
+//             Sys_Error("Your version of SDL library is incompatible with me.\n"
+//                       "You need a library version in the line of %d.%d.%d\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
+//     }

        if (SDL_Init(0) < 0)
        {

What would be the official approach?

The SDL version numbers jumped from 2.0.22 to 2.24.0 earlier this year without breaking ABI (https://github.com/libsdl-org/SDL/tags).

Code like this dates from when SDL 1.2 was the stable release and 1.3 was going to be an ABI break (what eventually became SDL2).

The advice from the SDL maintainer, as I interpret it, is to remove this kind of version checking:
https://discourse.libsdl.org/t/sdl-2-23-1-pre-release/37219/8

So, do you think is it safe to remove these checks in Quakespasm engine family?

I think so yeah