Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
30 lines (25 loc) · 714 Bytes

testver.c

File metadata and controls

30 lines (25 loc) · 714 Bytes
 
Apr 26, 2001
Apr 26, 2001
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>
Oct 3, 2005
Oct 3, 2005
7
#include <stdlib.h>
Apr 26, 2001
Apr 26, 2001
8
9
10
#include "SDL.h"
Jul 10, 2006
Jul 10, 2006
11
12
int
main(int argc, char *argv[])
Apr 26, 2001
Apr 26, 2001
13
{
Jul 10, 2006
Jul 10, 2006
14
SDL_version compiled;
Jan 4, 2009
Jan 4, 2009
15
SDL_version linked;
Apr 26, 2001
Apr 26, 2001
16
Jan 4, 2009
Jan 4, 2009
17
18
#if SDL_VERSION_ATLEAST(1, 3, 0)
printf("Compiled with SDL 1.3 or newer\n");
Apr 26, 2001
Apr 26, 2001
19
#else
Jan 4, 2009
Jan 4, 2009
20
printf("Compiled with SDL older than 1.3\n");
Apr 26, 2001
Apr 26, 2001
21
#endif
Jul 10, 2006
Jul 10, 2006
22
SDL_VERSION(&compiled);
Jan 4, 2009
Jan 4, 2009
23
24
25
26
27
printf("Compiled version: %d.%d.%d-%d\n",
compiled.major, compiled.minor, compiled.patch, SDL_REVISION);
SDL_GetVersion(&linked);
printf("Linked version: %d.%d.%d-%d\n",
linked.major, linked.minor, linked.patch, SDL_GetRevision());
Jul 10, 2006
Jul 10, 2006
28
29
SDL_Quit();
return (0);
Apr 26, 2001
Apr 26, 2001
30
}