comparison include/SDL_version.h @ 3407:d3baf5ac4e37

Partial fix for bug #859 Header file update from Ken for improved doxygen output
author Sam Lantinga <slouken@libsdl.org>
date Mon, 19 Oct 2009 13:31:58 +0000
parents 972a69e47cd9
children f7b03b6838cb
comparison
equal deleted inserted replaced
3406:8ae607392409 3407:d3baf5ac4e37
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /** 23 /**
24 * \file SDL_version.h 24 * \file SDL_version.h
25 * 25 *
26 * This header defines the current SDL version 26 * This header defines the current SDL version.
27 */ 27 */
28 28
29 #ifndef _SDL_version_h 29 #ifndef _SDL_version_h
30 #define _SDL_version_h 30 #define _SDL_version_h
31 31
39 extern "C" { 39 extern "C" {
40 /* *INDENT-ON* */ 40 /* *INDENT-ON* */
41 #endif 41 #endif
42 42
43 /** 43 /**
44 * \struct SDL_version 44 * \brief Information the version of SDL in use.
45 * \brief Information the version of SDL in use. 45 *
46 * 46 * Represents the library's version as three levels: major revision
47 * Represents the library's version as three levels: major revision
48 * (increments with massive changes, additions, and enhancements), 47 * (increments with massive changes, additions, and enhancements),
49 * minor revision (increments with backwards-compatible changes to the 48 * minor revision (increments with backwards-compatible changes to the
50 * major revision), and patchlevel (increments with fixes to the minor 49 * major revision), and patchlevel (increments with fixes to the minor
51 * revision). 50 * revision).
52 * 51 *
53 * \sa SDL_VERSION 52 * \sa SDL_VERSION
54 * \sa SDL_GetVersion 53 * \sa SDL_GetVersion
55 */ 54 */
56 typedef struct SDL_version 55 typedef struct SDL_version
57 { 56 {
58 Uint8 major; /**< major version */ 57 Uint8 major; /**< major version */
59 Uint8 minor; /**< minor version */ 58 Uint8 minor; /**< minor version */
65 #define SDL_MAJOR_VERSION 1 64 #define SDL_MAJOR_VERSION 1
66 #define SDL_MINOR_VERSION 3 65 #define SDL_MINOR_VERSION 3
67 #define SDL_PATCHLEVEL 0 66 #define SDL_PATCHLEVEL 0
68 67
69 /** 68 /**
70 * \def SDL_VERSION(x) 69 * \brief Macro to determine SDL version program was compiled against.
71 * \brief Macro to determine SDL version program was compiled against. 70 *
72 * 71 * This macro fills in a SDL_version structure with the version of the
73 * This macro fills in a SDL_version structure with the version of the
74 * library you compiled against. This is determined by what header the 72 * library you compiled against. This is determined by what header the
75 * compiler uses. Note that if you dynamically linked the library, you might 73 * compiler uses. Note that if you dynamically linked the library, you might
76 * have a slightly newer or older version at runtime. That version can be 74 * have a slightly newer or older version at runtime. That version can be
77 * determined with SDL_GetVersion(), which, unlike SDL_VERSION, 75 * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
78 * is not a macro. 76 * is not a macro.
79 * 77 *
80 * \param x A pointer to a SDL_version struct to initialize. 78 * \param x A pointer to a SDL_version struct to initialize.
81 * 79 *
82 * \sa SDL_version 80 * \sa SDL_version
83 * \sa SDL_GetVersion 81 * \sa SDL_GetVersion
84 */ 82 */
85 #define SDL_VERSION(x) \ 83 #define SDL_VERSION(x) \
86 { \ 84 { \
87 (x)->major = SDL_MAJOR_VERSION; \ 85 (x)->major = SDL_MAJOR_VERSION; \
88 (x)->minor = SDL_MINOR_VERSION; \ 86 (x)->minor = SDL_MINOR_VERSION; \
89 (x)->patch = SDL_PATCHLEVEL; \ 87 (x)->patch = SDL_PATCHLEVEL; \
90 } 88 }
91 89
92 /* This macro turns the version numbers into a numeric value: 90 /**
93 (1,2,3) -> (1203) 91 * This macro turns the version numbers into a numeric value:
94 This assumes that there will never be more than 100 patchlevels 92 * \verbatim
95 */ 93 (1,2,3) -> (1203)
94 \endverbatim
95 *
96 * This assumes that there will never be more than 100 patchlevels.
97 */
96 #define SDL_VERSIONNUM(X, Y, Z) \ 98 #define SDL_VERSIONNUM(X, Y, Z) \
97 ((X)*1000 + (Y)*100 + (Z)) 99 ((X)*1000 + (Y)*100 + (Z))
98 100
99 /* This is the version number macro for the current SDL version */ 101 /**
102 * This is the version number macro for the current SDL version.
103 */
100 #define SDL_COMPILEDVERSION \ 104 #define SDL_COMPILEDVERSION \
101 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 105 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
102 106
103 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ 107 /**
108 * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
109 */
104 #define SDL_VERSION_ATLEAST(X, Y, Z) \ 110 #define SDL_VERSION_ATLEAST(X, Y, Z) \
105 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 111 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
106 112
107 /** 113 /**
108 * \fn void SDL_GetVersion(SDL_version *ver) 114 * \brief Get the version of SDL that is linked against your program.
109 * \brief Get the version of SDL that is linked against your program. 115 *
110 * 116 * If you are using a shared library (DLL) version of SDL, then it is
111 * If you are using a shared library (DLL) version of SDL, then it is
112 * possible that it will be different than the version you compiled against. 117 * possible that it will be different than the version you compiled against.
113 * 118 *
114 * This is a real function; the macro SDL_VERSION tells you what version 119 * This is a real function; the macro SDL_VERSION() tells you what version
115 * of SDL you compiled against: 120 * of SDL you compiled against:
116 * 121 *
117 * \code 122 * \code
118 * SDL_version compiled; 123 * SDL_version compiled;
119 * SDL_version linked; 124 * SDL_version linked;
120 * 125 *
121 * SDL_VERSION(&compiled); 126 * SDL_VERSION(&compiled);
122 * SDL_GetVersion(&linked); 127 * SDL_GetVersion(&linked);
123 * printf("We compiled against SDL version %d.%d.%d ...\n", 128 * printf("We compiled against SDL version %d.%d.%d ...\n",
124 * compiled.major, compiled.minor, compiled.patch); 129 * compiled.major, compiled.minor, compiled.patch);
125 * printf("But we linked against SDL version %d.%d.%d.\n", 130 * printf("But we linked against SDL version %d.%d.%d.\n",
126 * linked.major, linked.minor, linked.patch); 131 * linked.major, linked.minor, linked.patch);
127 * \endcode 132 * \endcode
128 * 133 *
129 * This function may be called safely at any time, even before SDL_Init(). 134 * This function may be called safely at any time, even before SDL_Init().
130 * 135 *
131 * \sa SDL_VERSION 136 * \sa SDL_VERSION
132 */ 137 */
133 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); 138 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
134 139
135 /** 140 /**
136 * \fn int SDL_GetRevision(void) 141 * \brief Get the code revision of SDL that is linked against your program.
137 * \brief Get the code revision of SDL that is linked against your program.
138 */ 142 */
139 extern DECLSPEC int SDLCALL SDL_GetRevision(void); 143 extern DECLSPEC int SDLCALL SDL_GetRevision(void);
140 144
141 /* Ends C function definitions when using C++ */ 145 /* Ends C function definitions when using C++ */
142 #ifdef __cplusplus 146 #ifdef __cplusplus