Stxxl  1.4.0
common/version.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  common/version.cpp
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2007, 2008, 2011 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
00007  *
00008  *  Distributed under the Boost Software License, Version 1.0.
00009  *  (See accompanying file LICENSE_1_0.txt or copy at
00010  *  http://www.boost.org/LICENSE_1_0.txt)
00011  **************************************************************************/
00012 
00013 #include <stxxl/bits/version.h>
00014 
00015 #ifdef STXXL_BOOST_CONFIG
00016 #include <boost/version.hpp>
00017 #endif
00018 
00019 #define stringify_(x) #x
00020 #define stringify(x) stringify_(x)
00021 #define STXXL_VERSION_STRING_MA_MI_PL stringify(STXXL_VERSION_MAJOR) "." stringify(STXXL_VERSION_MINOR) "." stringify(STXXL_VERSION_PATCHLEVEL)
00022 
00023 // version.defs gets created if a snapshot/beta/rc/release is done
00024 #ifdef HAVE_VERSION_DEFS
00025 #include "version.defs"
00026 #endif
00027 
00028 // version_svn.defs gets created if stxxl is built from SVN
00029 #ifdef HAVE_VERSION_SVN_DEFS
00030 #include "version_svn.defs"
00031 #endif
00032 
00033 
00034 __STXXL_BEGIN_NAMESPACE
00035 
00036 int version_major()
00037 {
00038     return STXXL_VERSION_MAJOR;
00039 };
00040 
00041 int version_minor()
00042 {
00043     return STXXL_VERSION_MINOR;
00044 }
00045 
00046 int version_patchlevel()
00047 {
00048     return STXXL_VERSION_PATCHLEVEL;
00049 }
00050 
00051 // FIXME: this currently only works for GNU-like systems,
00052 //        there are no details available on windows platform
00053 
00054 const char * get_version_string()
00055 {
00056     return "STXXL"
00057 #ifdef STXXL_VERSION_STRING_SVN_BRANCH
00058            " (branch: " STXXL_VERSION_STRING_SVN_BRANCH ")"
00059 #endif
00060            " v"
00061            STXXL_VERSION_STRING_MA_MI_PL
00062 #ifdef STXXL_VERSION_STRING_DATE
00063            "-" STXXL_VERSION_STRING_DATE
00064 #endif
00065 #ifdef STXXL_VERSION_STRING_SVN_REVISION
00066            " (SVN r" STXXL_VERSION_STRING_SVN_REVISION ")"
00067 #endif
00068 #ifdef STXXL_VERSION_STRING_GIT_REVISION
00069            " (GIT " STXXL_VERSION_STRING_GIT_REVISION ")"
00070 #endif
00071 #ifdef STXXL_VERSION_STRING_PHASE
00072            " (" STXXL_VERSION_STRING_PHASE ")"
00073 #else
00074            " (prerelease)"
00075 #endif
00076 #ifdef STXXL_VERSION_STRING_COMMENT
00077            " (" STXXL_VERSION_STRING_COMMENT ")"
00078 #endif
00079 #ifdef __MCSTL__
00080            " + MCSTL"
00081 #ifdef MCSTL_VERSION_STRING_DATE
00082            " " MCSTL_VERSION_STRING_DATE
00083 #endif
00084 #ifdef MCSTL_VERSION_STRING_SVN_REVISION
00085            " (SVN r" MCSTL_VERSION_STRING_SVN_REVISION ")"
00086 #endif
00087 #endif
00088 #ifdef STXXL_BOOST_CONFIG
00089            " + Boost "
00090 #define Y(x) # x
00091 #define X(x) Y(x)
00092            X(BOOST_VERSION)
00093 #undef X
00094 #undef Y
00095 #endif
00096     ;
00097 }
00098 
00099 __STXXL_END_NAMESPACE
00100 
00101 // vim: et:ts=4:sw=4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines