From 76ed6bdfca1f141811382a5161d03002bc490ad2 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Thu, 20 Dec 2007 06:09:35 +0000 Subject: [PATCH] Warning if runtime SDL version doesn't match compile-time version. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2876 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/sdl_common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index da6ceee8e..1ae385133 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -70,6 +70,15 @@ TFB_PreInit (void) "%d.%d.%d)", SDL_Linked_Version ()->major, SDL_Linked_Version ()->minor, SDL_Linked_Version ()->patch, SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); + if (SDL_Linked_Version ()->major != SDL_MAJOR_VERSION || + SDL_Linked_Version ()->minor != SDL_MINOR_VERSION || + SDL_Linked_Version ()->patch != SDL_PATCHLEVEL) { + log_add (log_Warning, "The used SDL library is not the same version " + "as the one used to compile The Ur-Quan Masters with! " + "If you experience any crashes, this would be an excellent " + "suspect."); + } + if ((SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) == -1)) { log_add (log_Fatal, "Could not initialize SDL: %s.", SDL_GetError ());