include/SDL_version.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 04 Jan 2006 01:08:40 +0000
changeset 1222 09c1408645df
parent 1046 f09d5edfc7a3
child 1312 c9b51268668f
permissions -rw-r--r--
Bumped the version number for the next release
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@0
     6
    modify it under the terms of the GNU Library General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@0
     8
    version 2 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@0
    13
    Library General Public License for more details.
slouken@0
    14
slouken@0
    15
    You should have received a copy of the GNU Library General Public
slouken@0
    16
    License along with this library; if not, write to the Free
slouken@0
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@251
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@0
    23
#ifdef SAVE_RCSID
slouken@0
    24
static char rcsid =
slouken@0
    25
 "@(#) $Id$";
slouken@0
    26
#endif
slouken@0
    27
slouken@0
    28
/* This header defines the current SDL version */
slouken@0
    29
slouken@0
    30
#ifndef _SDL_version_h
slouken@0
    31
#define _SDL_version_h
slouken@0
    32
slouken@0
    33
#include "SDL_types.h"
slouken@0
    34
slouken@0
    35
#include "begin_code.h"
slouken@0
    36
/* Set up for C function definitions, even when using C++ */
slouken@0
    37
#ifdef __cplusplus
slouken@0
    38
extern "C" {
slouken@0
    39
#endif
slouken@0
    40
slouken@0
    41
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
slouken@0
    42
*/
slouken@0
    43
#define SDL_MAJOR_VERSION	1
slouken@0
    44
#define SDL_MINOR_VERSION	2
slouken@1222
    45
#define SDL_PATCHLEVEL		10
slouken@0
    46
slouken@911
    47
typedef struct SDL_version {
slouken@0
    48
	Uint8 major;
slouken@0
    49
	Uint8 minor;
slouken@0
    50
	Uint8 patch;
slouken@0
    51
} SDL_version;
slouken@0
    52
slouken@0
    53
/* This macro can be used to fill a version structure with the compile-time
slouken@0
    54
 * version of the SDL library.
slouken@0
    55
 */
slouken@0
    56
#define SDL_VERSION(X)							\
slouken@0
    57
{									\
slouken@0
    58
	(X)->major = SDL_MAJOR_VERSION;					\
slouken@0
    59
	(X)->minor = SDL_MINOR_VERSION;					\
slouken@0
    60
	(X)->patch = SDL_PATCHLEVEL;					\
slouken@0
    61
}
slouken@0
    62
slouken@0
    63
/* This macro turns the version numbers into a numeric value:
slouken@0
    64
   (1,2,3) -> (1203)
slouken@0
    65
   This assumes that there will never be more than 100 patchlevels
slouken@0
    66
*/
slouken@0
    67
#define SDL_VERSIONNUM(X, Y, Z)						\
icculus@1046
    68
	((X)*1000 + (Y)*100 + (Z))
slouken@0
    69
slouken@0
    70
/* This is the version number macro for the current SDL version */
slouken@0
    71
#define SDL_COMPILEDVERSION \
slouken@0
    72
	SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
slouken@0
    73
slouken@0
    74
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
slouken@0
    75
#define SDL_VERSION_ATLEAST(X, Y, Z) \
slouken@0
    76
	(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
slouken@0
    77
slouken@0
    78
/* This function gets the version of the dynamically linked SDL library.
slouken@0
    79
   it should NOT be used to fill a version structure, instead you should
slouken@0
    80
   use the SDL_Version() macro.
slouken@0
    81
 */
slouken@337
    82
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
slouken@0
    83
slouken@0
    84
/* Ends C function definitions when using C++ */
slouken@0
    85
#ifdef __cplusplus
slouken@0
    86
}
slouken@0
    87
#endif
slouken@0
    88
#include "close_code.h"
slouken@0
    89
slouken@0
    90
#endif /* _SDL_version_h */