00001 /* 00002 SDL - Simple DirectMedia Layer 00003 Copyright (C) 1997-2009 Sam Lantinga 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 Sam Lantinga 00020 slouken@libsdl.org 00021 */ 00022 00029 #ifndef _SDL_version_h 00030 #define _SDL_version_h 00031 00032 #include "SDL_stdinc.h" 00033 #include "SDL_revision.h" 00034 00035 #include "begin_code.h" 00036 /* Set up for C function definitions, even when using C++ */ 00037 #ifdef __cplusplus 00038 /* *INDENT-OFF* */ 00039 extern "C" { 00040 /* *INDENT-ON* */ 00041 #endif 00042 00056 typedef struct SDL_version 00057 { 00058 Uint8 major; 00059 Uint8 minor; 00060 Uint8 patch; 00061 } SDL_version; 00062 00063 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 00064 */ 00065 #define SDL_MAJOR_VERSION 1 00066 #define SDL_MINOR_VERSION 3 00067 #define SDL_PATCHLEVEL 0 00068 00085 #define SDL_VERSION(x) \ 00086 { \ 00087 (x)->major = SDL_MAJOR_VERSION; \ 00088 (x)->minor = SDL_MINOR_VERSION; \ 00089 (x)->patch = SDL_PATCHLEVEL; \ 00090 } 00091 00092 /* This macro turns the version numbers into a numeric value: 00093 (1,2,3) -> (1203) 00094 This assumes that there will never be more than 100 patchlevels 00095 */ 00096 #define SDL_VERSIONNUM(X, Y, Z) \ 00097 ((X)*1000 + (Y)*100 + (Z)) 00098 00099 /* This is the version number macro for the current SDL version */ 00100 #define SDL_COMPILEDVERSION \ 00101 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 00102 00103 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ 00104 #define SDL_VERSION_ATLEAST(X, Y, Z) \ 00105 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 00106 00133 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); 00134 00139 extern DECLSPEC int SDLCALL SDL_GetRevision(void); 00140 00141 /* Ends C function definitions when using C++ */ 00142 #ifdef __cplusplus 00143 /* *INDENT-OFF* */ 00144 } 00145 /* *INDENT-ON* */ 00146 #endif 00147 #include "close_code.h" 00148 00149 #endif /* _SDL_version_h */ 00150 00151 /* vi: set ts=4 sw=4 expandtab: */