My Project
Loading...
Searching...
No Matches
SDL_version.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
28#ifndef SDL_version_h_
29#define SDL_version_h_
30
31#include "SDL_stdinc.h"
32
33#include "begin_code.h"
34/* Set up for C function definitions, even when using C++ */
35#ifdef __cplusplus
36extern "C" {
37#endif
38
51typedef struct SDL_version
52{
53 Uint8 major;
54 Uint8 minor;
55 Uint8 patch;
57
58/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
59*/
60#define SDL_MAJOR_VERSION 2
61#define SDL_MINOR_VERSION 26
62#define SDL_PATCHLEVEL 4
63
79#define SDL_VERSION(x) \
80{ \
81 (x)->major = SDL_MAJOR_VERSION; \
82 (x)->minor = SDL_MINOR_VERSION; \
83 (x)->patch = SDL_PATCHLEVEL; \
84}
85
86/* TODO: Remove this whole block in SDL 3 */
87#if SDL_MAJOR_VERSION < 3
101#define SDL_VERSIONNUM(X, Y, Z) \
102 ((X)*1000 + (Y)*100 + (Z))
103
113#define SDL_COMPILEDVERSION \
114 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
115#endif /* SDL_MAJOR_VERSION < 3 */
116
120#define SDL_VERSION_ATLEAST(X, Y, Z) \
121 ((SDL_MAJOR_VERSION >= X) && \
122 (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \
123 (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z))
124
141extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
142
170extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
171
193extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
194
195
196/* Ends C function definitions when using C++ */
197#ifdef __cplusplus
198}
199#endif
200#include "close_code.h"
201
202#endif /* SDL_version_h_ */
203
204/* vi: set ts=4 sw=4 expandtab: */
DECLSPEC const char *SDLCALL SDL_GetRevision(void)
SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void)
DECLSPEC void SDLCALL SDL_GetVersion(SDL_version *ver)
Definition: SDL_version.h:52
Uint8 major
Definition: SDL_version.h:53
Uint8 minor
Definition: SDL_version.h:54
Uint8 patch
Definition: SDL_version.h:55