This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
testver.c
33 lines (28 loc) · 818 Bytes
1
2
3
4
5
6
/* Test program to compare the compile-time version of SDL with the linked
version of SDL
*/
#include <stdio.h>
7
#include <stdlib.h>
8
9
#include "SDL.h"
10
#include "SDL_revision.h"
11
12
13
int
main(int argc, char *argv[])
14
{
15
SDL_version compiled;
16
SDL_version linked;
17
18
19
#if SDL_VERSION_ATLEAST(1, 3, 0)
printf("Compiled with SDL 1.3 or newer\n");
20
#else
21
printf("Compiled with SDL older than 1.3\n");
22
#endif
23
SDL_VERSION(&compiled);
24
25
26
printf("Compiled version: %d.%d.%d.%d (%s)\n",
compiled.major, compiled.minor, compiled.patch,
SDL_REVISION_NUMBER, SDL_REVISION);
27
SDL_GetVersion(&linked);
28
29
30
printf("Linked version: %d.%d.%d.%d (%s)\n",
linked.major, linked.minor, linked.patch,
SDL_GetRevisionNumber(), SDL_GetRevision());
31
32
SDL_Quit();
return (0);
33
}