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

Latest commit

 

History

History
33 lines (28 loc) · 818 Bytes

testver.c

File metadata and controls

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