2015-06-21 17:33:46 +02:00
|
|
|
/*
|
2024-01-01 13:15:26 -08:00
|
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 17:33:46 +02: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 20:43:38 -08:00
|
|
|
#include <SDL3/SDL.h>
|
2022-12-15 05:58:20 +01:00
|
|
|
#include <SDL3/SDL_main.h>
|
2022-10-20 18:47:17 +02:00
|
|
|
#include <SDL3/SDL_revision.h>
|
2015-06-21 17:33:46 +02:00
|
|
|
|
2022-11-30 12:51:59 -08:00
|
|
|
int main(int argc, char *argv[])
|
2015-06-21 17:33:46 +02:00
|
|
|
{
|
2015-11-25 21:39:28 +01:00
|
|
|
/* Enable standard application logging */
|
2024-05-16 10:00:50 -07:00
|
|
|
SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
2015-06-21 17:33:46 +02:00
|
|
|
|
2023-03-17 01:01:28 +01:00
|
|
|
if (argc > 1) {
|
|
|
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "USAGE: %s", argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2022-11-21 20:28:58 -08:00
|
|
|
#if SDL_VERSION_ATLEAST(3, 0, 0)
|
|
|
|
SDL_Log("Compiled with SDL 3.0 or newer\n");
|
2015-06-21 17:33:46 +02:00
|
|
|
#else
|
2022-11-21 20:28:58 -08:00
|
|
|
SDL_Log("Compiled with SDL older than 3.0\n");
|
2015-06-21 17:33:46 +02:00
|
|
|
#endif
|
2021-02-12 14:15:29 -05:00
|
|
|
SDL_Log("Compiled version: %d.%d.%d (%s)\n",
|
2024-05-14 07:47:13 -07:00
|
|
|
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION,
|
2022-11-30 12:51:59 -08:00
|
|
|
SDL_REVISION);
|
2024-05-14 07:47:13 -07:00
|
|
|
int version = SDL_GetVersion();
|
|
|
|
SDL_Log("Runtime version: %d.%d.%d (%s)\n",
|
|
|
|
SDL_VERSIONNUM_MAJOR(version), SDL_VERSIONNUM_MINOR(version), SDL_VERSIONNUM_MICRO(version),
|
2022-11-30 12:51:59 -08:00
|
|
|
SDL_GetRevision());
|
2015-06-21 17:33:46 +02:00
|
|
|
SDL_Quit();
|
2022-11-27 17:38:43 +01:00
|
|
|
return 0;
|
2015-06-21 17:33:46 +02:00
|
|
|
}
|