include/SDL_version.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 24 Sep 2006 00:10:59 +0000
branchSDL-1.2
changeset 3873 cef30206da53
parent 1886 44635227a939
child 4110 b896fb0d4f9f
permissions -rw-r--r--
Bumped the version in subversion to 1.2.12
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@251
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@0
    23
/* This header defines the current SDL version */
slouken@0
    24
slouken@0
    25
#ifndef _SDL_version_h
slouken@0
    26
#define _SDL_version_h
slouken@0
    27
slouken@1356
    28
#include "SDL_stdinc.h"
slouken@0
    29
slouken@0
    30
#include "begin_code.h"
slouken@0
    31
/* Set up for C function definitions, even when using C++ */
slouken@0
    32
#ifdef __cplusplus
slouken@0
    33
extern "C" {
slouken@0
    34
#endif
slouken@0
    35
slouken@0
    36
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
slouken@0
    37
*/
slouken@0
    38
#define SDL_MAJOR_VERSION	1
slouken@0
    39
#define SDL_MINOR_VERSION	2
slouken@3873
    40
#define SDL_PATCHLEVEL		12
slouken@0
    41
slouken@911
    42
typedef struct SDL_version {
slouken@0
    43
	Uint8 major;
slouken@0
    44
	Uint8 minor;
slouken@0
    45
	Uint8 patch;
slouken@0
    46
} SDL_version;
slouken@0
    47
slouken@0
    48
/* This macro can be used to fill a version structure with the compile-time
slouken@0
    49
 * version of the SDL library.
slouken@0
    50
 */
slouken@0
    51
#define SDL_VERSION(X)							\
slouken@0
    52
{									\
slouken@0
    53
	(X)->major = SDL_MAJOR_VERSION;					\
slouken@0
    54
	(X)->minor = SDL_MINOR_VERSION;					\
slouken@0
    55
	(X)->patch = SDL_PATCHLEVEL;					\
slouken@0
    56
}
slouken@0
    57
slouken@0
    58
/* This macro turns the version numbers into a numeric value:
slouken@0
    59
   (1,2,3) -> (1203)
slouken@0
    60
   This assumes that there will never be more than 100 patchlevels
slouken@0
    61
*/
slouken@0
    62
#define SDL_VERSIONNUM(X, Y, Z)						\
icculus@1046
    63
	((X)*1000 + (Y)*100 + (Z))
slouken@0
    64
slouken@0
    65
/* This is the version number macro for the current SDL version */
slouken@0
    66
#define SDL_COMPILEDVERSION \
slouken@0
    67
	SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
slouken@0
    68
slouken@0
    69
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
slouken@0
    70
#define SDL_VERSION_ATLEAST(X, Y, Z) \
slouken@0
    71
	(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
slouken@0
    72
slouken@0
    73
/* This function gets the version of the dynamically linked SDL library.
slouken@0
    74
   it should NOT be used to fill a version structure, instead you should
slouken@0
    75
   use the SDL_Version() macro.
slouken@0
    76
 */
slouken@337
    77
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
slouken@0
    78
slouken@0
    79
/* Ends C function definitions when using C++ */
slouken@0
    80
#ifdef __cplusplus
slouken@0
    81
}
slouken@0
    82
#endif
slouken@0
    83
#include "close_code.h"
slouken@0
    84
slouken@0
    85
#endif /* _SDL_version_h */