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

Latest commit

 

History

History
44 lines (37 loc) · 1.19 KB

testver.c

File metadata and controls

44 lines (37 loc) · 1.19 KB
 
Apr 8, 2011
Apr 8, 2011
1
2
3
4
5
6
7
8
9
10
11
/*
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
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.
*/
Apr 26, 2001
Apr 26, 2001
12
13
14
15
16
17
/* 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
18
#include <stdlib.h>
Apr 26, 2001
Apr 26, 2001
19
20
#include "SDL.h"
Feb 16, 2011
Feb 16, 2011
21
#include "SDL_revision.h"
Apr 26, 2001
Apr 26, 2001
22
Jul 10, 2006
Jul 10, 2006
23
24
int
main(int argc, char *argv[])
Apr 26, 2001
Apr 26, 2001
25
{
Jul 10, 2006
Jul 10, 2006
26
SDL_version compiled;
Jan 4, 2009
Jan 4, 2009
27
SDL_version linked;
Apr 26, 2001
Apr 26, 2001
28
Jan 4, 2009
Jan 4, 2009
29
30
#if SDL_VERSION_ATLEAST(1, 3, 0)
printf("Compiled with SDL 1.3 or newer\n");
Apr 26, 2001
Apr 26, 2001
31
#else
Jan 4, 2009
Jan 4, 2009
32
printf("Compiled with SDL older than 1.3\n");
Apr 26, 2001
Apr 26, 2001
33
#endif
Jul 10, 2006
Jul 10, 2006
34
SDL_VERSION(&compiled);
Feb 20, 2011
Feb 20, 2011
35
36
37
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
38
SDL_GetVersion(&linked);
Feb 20, 2011
Feb 20, 2011
39
40
41
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
42
43
SDL_Quit();
return (0);
Apr 26, 2001
Apr 26, 2001
44
}