diff options
Diffstat (limited to 'src/sys/sys_main.c')
-rw-r--r-- | src/sys/sys_main.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index 32c55e37..512c43b8 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -587,21 +587,29 @@ int main( int argc, char **argv ) char commandLine[ MAX_STRING_CHARS ] = { 0 }; #ifndef DEDICATED - const SDL_version *ver = SDL_Linked_Version( ); + // SDL version check + + // Compile time +# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH) +# error A more recent version of SDL is required +# endif + + // Run time + const SDL_version *ver = SDL_Linked_Version( ); #define STRING(s) #s #define XSTRING(s) STRING(s) #define MINSDL_VERSION \ - XSTRING(MINSDL_MAJOR) "." \ - XSTRING(MINSDL_MINOR) "." \ - XSTRING(MINSDL_PATCH) - - if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) < - SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) ) - { - Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" ); - Sys_Exit( 1 ); - } + XSTRING(MINSDL_MAJOR) "." \ + XSTRING(MINSDL_MINOR) "." \ + XSTRING(MINSDL_PATCH) + + if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) < + SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) ) + { + Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" ); + Sys_Exit( 1 ); + } #endif Sys_ParseArgs( argc, argv ); |