2015-06-21 09:33:46 -06:00
|
|
|
/*
|
2022-01-03 10:40:00 -07:00
|
|
|
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Test program to compare the compile-time version of SDL with the linked
|
|
|
|
version of SDL
|
|
|
|
*/
|
2022-11-26 21:43:38 -07:00
|
|
|
#include <SDL3/SDL.h>
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
SDL_version compiled;
|
|
|
|
SDL_version linked;
|
|
|
|
|
2015-11-25 13:39:28 -07:00
|
|
|
/* Enable standard application logging */
|
2015-06-21 09:33:46 -06:00
|
|
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
|
|
|
|
2022-11-21 21:28:58 -07:00
|
|
|
#if SDL_VERSION_ATLEAST(3, 0, 0)
|
|
|
|
SDL_Log("Compiled with SDL 3.0 or newer\n");
|
2015-06-21 09:33:46 -06:00
|
|
|
#else
|
2022-11-21 21:28:58 -07:00
|
|
|
SDL_Log("Compiled with SDL older than 3.0\n");
|
2015-06-21 09:33:46 -06:00
|
|
|
#endif
|
|
|
|
SDL_VERSION(&compiled);
|
2021-02-12 12:15:29 -07:00
|
|
|
SDL_Log("Compiled version: %d.%d.%d (%s)\n",
|
2015-06-21 09:33:46 -06:00
|
|
|
compiled.major, compiled.minor, compiled.patch,
|
2021-02-12 12:15:29 -07:00
|
|
|
SDL_REVISION);
|
2015-06-21 09:33:46 -06:00
|
|
|
SDL_GetVersion(&linked);
|
2021-02-12 12:15:29 -07:00
|
|
|
SDL_Log("Linked version: %d.%d.%d (%s)\n",
|
2015-06-21 09:33:46 -06:00
|
|
|
linked.major, linked.minor, linked.patch,
|
2021-02-12 12:15:29 -07:00
|
|
|
SDL_GetRevision());
|
2015-06-21 09:33:46 -06:00
|
|
|
SDL_Quit();
|
|
|
|
return (0);
|
|
|
|
}
|
2022-11-26 02:41:46 -07:00
|
|
|
|
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|