summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/test/testver.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/test/testver.c
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/test/testver.c')
-rw-r--r--src/contrib/SDL-3.2.20/test/testver.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/test/testver.c b/src/contrib/SDL-3.2.20/test/testver.c
new file mode 100644
index 0000000..b873038
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/test/testver.c
@@ -0,0 +1,41 @@
1/*
2 Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely.
11*/
12
13/* Test program to compare the compile-time version of SDL with the linked
14 version of SDL
15*/
16#include <SDL3/SDL.h>
17#include <SDL3/SDL_main.h>
18#include <SDL3/SDL_revision.h>
19
20int main(int argc, char *argv[])
21{
22 if (argc > 1) {
23 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "USAGE: %s", argv[0]);
24 return 1;
25 }
26
27#if SDL_VERSION_ATLEAST(3, 0, 0)
28 SDL_Log("Compiled with SDL 3.0 or newer");
29#else
30 SDL_Log("Compiled with SDL older than 3.0");
31#endif
32 SDL_Log("Compiled version: %d.%d.%d (%s)",
33 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION,
34 SDL_REVISION);
35 int version = SDL_GetVersion();
36 SDL_Log("Runtime version: %d.%d.%d (%s)",
37 SDL_VERSIONNUM_MAJOR(version), SDL_VERSIONNUM_MINOR(version), SDL_VERSIONNUM_MICRO(version),
38 SDL_GetRevision());
39 SDL_Quit();
40 return 0;
41}