Mercurial > sdl-ios-xcode
annotate include/SDL_version.h @ 3243:5db962a9a991
CD-ROM support is so passé :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Sep 2009 09:11:03 +0000 |
parents | 972a69e47cd9 |
children | d3baf5ac4e37 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
2859 | 3 Copyright (C) 1997-2009 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
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 | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1222
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
251
b8688cfdc232
Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
241
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
23 /** |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
24 * \file SDL_version.h |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
25 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
26 * This header defines the current SDL version |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
27 */ |
0 | 28 |
29 #ifndef _SDL_version_h | |
30 #define _SDL_version_h | |
31 | |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
32 #include "SDL_stdinc.h" |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
33 #include "SDL_revision.h" |
0 | 34 |
35 #include "begin_code.h" | |
36 /* Set up for C function definitions, even when using C++ */ | |
37 #ifdef __cplusplus | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
38 /* *INDENT-OFF* */ |
0 | 39 extern "C" { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
40 /* *INDENT-ON* */ |
0 | 41 #endif |
42 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
43 /** |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
44 * \struct SDL_version |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
45 * \brief Information the version of SDL in use. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
46 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
47 * Represents the library's version as three levels: major revision |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
48 * (increments with massive changes, additions, and enhancements), |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
49 * minor revision (increments with backwards-compatible changes to the |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
50 * major revision), and patchlevel (increments with fixes to the minor |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
51 * revision). |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
52 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
53 * \sa SDL_VERSION |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
54 * \sa SDL_GetVersion |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
55 */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
56 typedef struct SDL_version |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
57 { |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
58 Uint8 major; /**< major version */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
59 Uint8 minor; /**< minor version */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
60 Uint8 patch; /**< update version */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
61 } SDL_version; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
62 |
0 | 63 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL |
64 */ | |
65 #define SDL_MAJOR_VERSION 1 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
66 #define SDL_MINOR_VERSION 3 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
67 #define SDL_PATCHLEVEL 0 |
0 | 68 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
69 /** |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
70 * \def SDL_VERSION(x) |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
71 * \brief Macro to determine SDL version program was compiled against. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
72 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
73 * This macro fills in a SDL_version structure with the version of the |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
74 * library you compiled against. This is determined by what header the |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
75 * compiler uses. Note that if you dynamically linked the library, you might |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
76 * have a slightly newer or older version at runtime. That version can be |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
77 * determined with SDL_GetVersion(), which, unlike SDL_VERSION, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
78 * is not a macro. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
79 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
80 * \param x A pointer to a SDL_version struct to initialize. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
81 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
82 * \sa SDL_version |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
83 * \sa SDL_GetVersion |
0 | 84 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
85 #define SDL_VERSION(x) \ |
0 | 86 { \ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
87 (x)->major = SDL_MAJOR_VERSION; \ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
88 (x)->minor = SDL_MINOR_VERSION; \ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
89 (x)->patch = SDL_PATCHLEVEL; \ |
0 | 90 } |
91 | |
92 /* This macro turns the version numbers into a numeric value: | |
93 (1,2,3) -> (1203) | |
94 This assumes that there will never be more than 100 patchlevels | |
95 */ | |
96 #define SDL_VERSIONNUM(X, Y, Z) \ | |
1046
f09d5edfc7a3
Added some parentheses for a little more macro safety. Recommended by Petri
Ryan C. Gordon <icculus@icculus.org>
parents:
1024
diff
changeset
|
97 ((X)*1000 + (Y)*100 + (Z)) |
0 | 98 |
99 /* This is the version number macro for the current SDL version */ | |
100 #define SDL_COMPILEDVERSION \ | |
101 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) | |
102 | |
103 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ | |
104 #define SDL_VERSION_ATLEAST(X, Y, Z) \ | |
105 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) | |
106 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
107 /** |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
108 * \fn void SDL_GetVersion(SDL_version *ver) |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
109 * \brief Get the version of SDL that is linked against your program. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
110 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
111 * If you are using a shared library (DLL) version of SDL, then it is |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
112 * possible that it will be different than the version you compiled against. |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
113 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
114 * This is a real function; the macro SDL_VERSION tells you what version |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
115 * of SDL you compiled against: |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
116 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
117 * \code |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
118 * SDL_version compiled; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
119 * SDL_version linked; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
120 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
121 * SDL_VERSION(&compiled); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
122 * SDL_GetVersion(&linked); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
123 * printf("We compiled against SDL version %d.%d.%d ...\n", |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
124 * compiled.major, compiled.minor, compiled.patch); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
125 * printf("But we linked against SDL version %d.%d.%d.\n", |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
126 * linked.major, linked.minor, linked.patch); |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
127 * \endcode |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
128 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
129 * This function may be called safely at any time, even before SDL_Init(). |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
130 * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
131 * \sa SDL_VERSION |
0 | 132 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
133 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); |
0 | 134 |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
135 /** |
2996 | 136 * \fn int SDL_GetRevision(void) |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
137 * \brief Get the code revision of SDL that is linked against your program. |
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
138 */ |
2996 | 139 extern DECLSPEC int SDLCALL SDL_GetRevision(void); |
2982
b64c1d23039b
Make the current revision number available
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
140 |
0 | 141 /* Ends C function definitions when using C++ */ |
142 #ifdef __cplusplus | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
143 /* *INDENT-OFF* */ |
0 | 144 } |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
145 /* *INDENT-ON* */ |
0 | 146 #endif |
147 #include "close_code.h" | |
148 | |
149 #endif /* _SDL_version_h */ | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
150 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1886
diff
changeset
|
151 /* vi: set ts=4 sw=4 expandtab: */ |