version.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005-2012 by the FIFE team                              *
00003  *   http://www.fifengine.net                                              *
00004  *   This file is part of FIFE.                                            *
00005  *                                                                         *
00006  *   FIFE is free software; you can redistribute it and/or                 *
00007  *   modify it under the terms of the GNU Lesser General Public            *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2.1 of the License, or (at your option) any later version.    *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the                 *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
00020  ***************************************************************************/
00021 
00022 #ifndef FIFE_VERSION_H
00023 #define FIFE_VERSION_H
00024 
00025 // These version numbers should be checked and updated
00026 // as part of the release process for FIFE.
00027 #define FIFE_MAJOR_VERSION 0
00028 #define FIFE_MINOR_VERSION 3
00029 #define FIFE_SUBMINOR_VERSION 3
00030 
00031 // -------------------------------------------------------------------------
00032 //  Do not update anything below this line!
00033 // -------------------------------------------------------------------------
00034 
00035 #define FIFE_STR(s)         # s
00036 #define FIFE_XSTR(s)        FIFE_STR(s)
00037 
00038 #define FIFE_DOT(a,b)       a ## . ## b
00039 #define FIFE_XDOT(a,b)      FIFE_DOT(a,b)
00040 
00041 #define FIFE_VERSION_STRING \
00042     FIFE_XDOT( \
00043         FIFE_XDOT(FIFE_MAJOR_VERSION, FIFE_MINOR_VERSION), \
00044         FIFE_SUBMINOR_VERSION \
00045     )
00046 
00047 namespace FIFE {
00048     inline const char* getVersion() {
00049         return FIFE_XSTR(FIFE_VERSION_STRING);
00050     }
00051 
00052     inline int getMajor() {
00053         return FIFE_MAJOR_VERSION;
00054     }
00055 
00056     inline int getMinor() {
00057         return FIFE_MINOR_VERSION;
00058     }
00059 
00060     inline int getSubMinor() {
00061         return FIFE_SUBMINOR_VERSION;
00062     }
00063 
00064     inline int getRevision() {
00065 #ifdef FIFE_REVISION
00066         return FIFE_REVISION;
00067 #else
00068         return 0;
00069 #endif
00070     }
00071 } //FIFE
00072 
00073 //cleanup
00074 #undef FIFE_STR
00075 #undef FIFE_XSTR
00076 #undef FIFE_DOT
00077 #undef FIFE_XDOT
00078 #undef FIFE_VERSION_STRING
00079 
00080 #endif //FIFE_VERSION_H
00081