Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / SDL / SDL_version.h
blob262aa7b5e30e4d05d78d85df402cd1de823eed6a
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2006 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 Sam Lantinga
20 slouken@libsdl.org
23 /* This header defines the current SDL version */
25 #ifndef _SDL_version_h
26 #define _SDL_version_h
28 #include "SDL_stdinc.h"
30 #include "begin_code.h"
31 /* Set up for C function definitions, even when using C++ */
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
38 #define SDL_MAJOR_VERSION 1
39 #define SDL_MINOR_VERSION 2
40 #define SDL_PATCHLEVEL 11
42 typedef struct SDL_version {
43 Uint8 major;
44 Uint8 minor;
45 Uint8 patch;
46 } SDL_version;
48 /* This macro can be used to fill a version structure with the compile-time
49 * version of the SDL library.
51 #define SDL_VERSION(X) \
52 { \
53 (X)->major = SDL_MAJOR_VERSION; \
54 (X)->minor = SDL_MINOR_VERSION; \
55 (X)->patch = SDL_PATCHLEVEL; \
58 /* This macro turns the version numbers into a numeric value:
59 (1,2,3) -> (1203)
60 This assumes that there will never be more than 100 patchlevels
62 #define SDL_VERSIONNUM(X, Y, Z) \
63 ((X)*1000 + (Y)*100 + (Z))
65 /* This is the version number macro for the current SDL version */
66 #define SDL_COMPILEDVERSION \
67 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
69 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
70 #define SDL_VERSION_ATLEAST(X, Y, Z) \
71 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
73 /* This function gets the version of the dynamically linked SDL library.
74 it should NOT be used to fill a version structure, instead you should
75 use the SDL_Version() macro.
77 extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
79 /* Ends C function definitions when using C++ */
80 #ifdef __cplusplus
82 #endif
83 #include "close_code.h"
85 #endif /* _SDL_version_h */