2015-06-21 09:33:46 -06:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2024-01-01 14:15:26 -07:00
|
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
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, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file SDL_version.h
|
|
|
|
*
|
2023-11-06 08:26:06 -07:00
|
|
|
* This header defines the current SDL version.
|
2015-06-21 09:33:46 -06:00
|
|
|
*/
|
|
|
|
|
2016-11-20 22:34:54 -07:00
|
|
|
#ifndef SDL_version_h_
|
|
|
|
#define SDL_version_h_
|
2015-06-21 09:33:46 -06:00
|
|
|
|
2022-11-26 21:43:38 -07:00
|
|
|
#include <SDL3/SDL_stdinc.h>
|
2015-06-21 09:33:46 -06:00
|
|
|
|
2022-12-22 09:38:59 -07:00
|
|
|
#include <SDL3/SDL_begin_code.h>
|
2015-06-21 09:33:46 -06:00
|
|
|
/* Set up for C function definitions, even when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2021-03-21 12:18:39 -06:00
|
|
|
* Information about the version of SDL in use.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* Represents the library's version as three levels: major revision
|
|
|
|
* (increments with massive changes, additions, and enhancements),
|
|
|
|
* minor revision (increments with backwards-compatible changes to the
|
|
|
|
* major revision), and patchlevel (increments with fixes to the minor
|
|
|
|
* revision).
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \sa SDL_VERSION
|
|
|
|
* \sa SDL_GetVersion
|
2015-06-21 09:33:46 -06:00
|
|
|
*/
|
|
|
|
typedef struct SDL_version
|
|
|
|
{
|
|
|
|
Uint8 major; /**< major version */
|
|
|
|
Uint8 minor; /**< minor version */
|
|
|
|
Uint8 patch; /**< update version */
|
|
|
|
} SDL_version;
|
|
|
|
|
|
|
|
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
|
|
|
*/
|
2022-11-21 21:28:58 -07:00
|
|
|
#define SDL_MAJOR_VERSION 3
|
|
|
|
#define SDL_MINOR_VERSION 0
|
2022-11-21 17:15:58 -07:00
|
|
|
#define SDL_PATCHLEVEL 0
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
/**
|
2021-03-21 12:18:39 -06:00
|
|
|
* Macro to determine SDL version program was compiled against.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* This macro fills in a SDL_version structure with the version of the
|
|
|
|
* library you compiled against. This is determined by what header the
|
|
|
|
* compiler uses. Note that if you dynamically linked the library, you might
|
|
|
|
* have a slightly newer or older version at runtime. That version can be
|
|
|
|
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
|
|
|
|
* is not a macro.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \param x A pointer to a SDL_version struct to initialize.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \sa SDL_version
|
|
|
|
* \sa SDL_GetVersion
|
2015-06-21 09:33:46 -06:00
|
|
|
*/
|
|
|
|
#define SDL_VERSION(x) \
|
|
|
|
{ \
|
|
|
|
(x)->major = SDL_MAJOR_VERSION; \
|
|
|
|
(x)->minor = SDL_MINOR_VERSION; \
|
|
|
|
(x)->patch = SDL_PATCHLEVEL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This macro turns the version numbers into a numeric value:
|
|
|
|
* \verbatim
|
2022-11-22 08:56:43 -07:00
|
|
|
(1,2,3) -> (0x1000203)
|
2015-06-21 09:33:46 -06:00
|
|
|
\endverbatim
|
|
|
|
*/
|
2022-11-22 08:56:43 -07:00
|
|
|
#define SDL_VERSIONNUM(X, Y, Z) \
|
|
|
|
((X) << 24 | (Y) << 8 | (Z) << 0)
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the version number macro for the current SDL version.
|
|
|
|
*/
|
|
|
|
#define SDL_COMPILEDVERSION \
|
|
|
|
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
|
|
|
|
*/
|
|
|
|
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
2022-11-22 09:28:56 -07:00
|
|
|
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
/**
|
2021-03-21 12:18:39 -06:00
|
|
|
* Get the version of SDL that is linked against your program.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* If you are linking to SDL dynamically, then it is possible that the current
|
|
|
|
* version will be different than the version you compiled against. This
|
|
|
|
* function returns the current version, while SDL_VERSION() is a macro that
|
|
|
|
* tells you what version you compiled with.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* This function may be called safely at any time, even before SDL_Init().
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \param ver the SDL_version structure that contains the version information
|
2023-02-08 12:43:52 -07:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2022-11-22 15:40:14 -07:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-10-26 19:36:05 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \sa SDL_GetRevision
|
2015-06-21 09:33:46 -06:00
|
|
|
*/
|
2023-02-08 12:43:52 -07:00
|
|
|
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_version * ver);
|
2015-06-21 09:33:46 -06:00
|
|
|
|
|
|
|
/**
|
2021-03-21 12:18:39 -06:00
|
|
|
* Get the code revision of SDL that is linked against your program.
|
|
|
|
*
|
|
|
|
* This value is the revision of the code you are linked with and may be
|
|
|
|
* different from the code you are compiling with, which is found in the
|
|
|
|
* constant SDL_REVISION.
|
|
|
|
*
|
|
|
|
* The revision is arbitrary string (a hash value) uniquely identifying the
|
|
|
|
* exact revision of the SDL library in use, and is only useful in comparing
|
|
|
|
* against other revisions. It is NOT an incrementing number.
|
|
|
|
*
|
|
|
|
* If SDL wasn't built from a git repository with the appropriate tools, this
|
|
|
|
* will return an empty string.
|
|
|
|
*
|
|
|
|
* Prior to SDL 2.0.16, before development moved to GitHub, this returned a
|
|
|
|
* hash for a Mercurial repository.
|
|
|
|
*
|
|
|
|
* You shouldn't use this function for anything but logging it for debugging
|
|
|
|
* purposes. The string is not intended to be reliable in any way.
|
|
|
|
*
|
|
|
|
* \returns an arbitrary string, uniquely identifying the exact revision of
|
|
|
|
* the SDL library in use.
|
2015-06-21 09:33:46 -06:00
|
|
|
*
|
2022-11-22 15:40:14 -07:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-10-26 19:36:05 -06:00
|
|
|
*
|
2021-03-21 12:18:39 -06:00
|
|
|
* \sa SDL_GetVersion
|
2015-06-21 09:33:46 -06:00
|
|
|
*/
|
|
|
|
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
|
|
|
|
|
|
|
|
|
|
|
/* Ends C function definitions when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-12-22 09:38:59 -07:00
|
|
|
#include <SDL3/SDL_close_code.h>
|
2015-06-21 09:33:46 -06:00
|
|
|
|
2016-11-20 22:34:54 -07:00
|
|
|
#endif /* SDL_version_h_ */
|