STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
version.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/version.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2007, 2011 Andreas Beckmann <[email protected]>
7  * Copyright (C) 2013 Timo Bingmann <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_VERSION_HEADER
15 #define STXXL_VERSION_HEADER
16 
17 #include <stxxl/bits/namespace.h>
18 #include <stxxl/bits/config.h>
19 #include <stxxl/bits/verbose.h>
20 
22 
23 // STXXL_VERSION_{MAJOR,MINOR,PATCH} are defined in cmake generated config.h
24 
25 // construct an integer version number, like "10400" for "1.4.0".
26 #define STXXL_VERSION_INTEGER (STXXL_VERSION_MAJOR* 10000 + STXXL_VERSION_MINOR* 100 + STXXL_VERSION_PATCH)
27 
28 #define stringify_(x) #x
29 #define stringify(x) stringify_(x)
30 
31 //! Return "X.Y.Z" version string (of headers)
32 inline const char * get_version_string()
33 {
34  return STXXL_VERSION_STRING;
35 }
36 
37 //! Return longer "X.Y.Z (feature) (version)" version string (of headers)
38 inline const char * get_version_string_long()
39 {
40  return "STXXL"
42 #ifdef STXXL_VERSION_PHASE
43  " (" STXXL_VERSION_PHASE ")"
44 #endif
45 #ifdef STXXL_VERSION_GIT_SHA1
46  " (git " STXXL_VERSION_GIT_SHA1 ")"
47 #endif // STXXL_VERSION_GIT_SHA1
48 #if STXXL_PARALLEL
49  " + gnu parallel(" stringify(__GLIBCXX__) ")"
50 #endif // STXXL_PARALLEL
51 #if STXXL_BOOST_CONFIG
52  " + Boost " stringify(BOOST_VERSION)
53 #endif
54  ;
55 }
56 
57 #undef stringify
58 #undef stringify_
59 
60 //! return X if the STXXL library version is X.Y.Z
61 int version_major();
62 //! return Y if the STXXL library version is X.Y.Z
63 int version_minor();
64 //! return Z if the STXXL library version is X.Y.Z
65 int version_patch();
66 //! return integer version number of the STXXL library
67 int version_integer();
68 
69 //! returns "X.Y.Z" version string of library
70 const char * get_library_version_string();
71 
72 //! returns longer "X.Y.Z (feature) (version)" string of library
73 const char * get_library_version_string_long();
74 
75 //! Check for a mismatch between library and headers
77 {
79  return 1;
81  return 2;
83  return 3;
84  return 0;
85 }
86 
87 //! Check and print mismatch between header and library versions
89 {
91  {
92  STXXL_ERRMSG("version mismatch between headers" <<
93  " (" << STXXL_VERSION_STRING ") and library" <<
94  " (" << get_library_version_string() << ")");
95  }
96 }
97 
99 
100 #endif // !STXXL_VERSION_HEADER
const char * get_library_version_string()
returns &quot;X.Y.Z&quot; version string of library
Definition: version.cpp:41
int version_major()
return X if the STXXL library version is X.Y.Z
Definition: version.cpp:21
int version_minor()
return Y if the STXXL library version is X.Y.Z
Definition: version.cpp:26
#define STXXL_VERSION_PHASE
Definition: config.h:25
int check_library_version()
Check for a mismatch between library and headers.
Definition: version.h:76
int version_patch()
return Z if the STXXL library version is X.Y.Z
Definition: version.cpp:31
#define STXXL_VERSION_GIT_SHA1
Definition: config.h:29
int version_integer()
return integer version number of the STXXL library
Definition: version.cpp:36
#define STXXL_VERSION_MAJOR
Definition: config.h:21
const char * get_version_string_long()
Return longer &quot;X.Y.Z (feature) (version)&quot; version string (of headers)
Definition: version.h:38
#define STXXL_VERSION_MINOR
Definition: config.h:22
void print_library_version_mismatch()
Check and print mismatch between header and library versions.
Definition: version.h:88
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
#define STXXL_VERSION_STRING
Definition: config.h:24
#define STXXL_VERSION_PATCH
Definition: config.h:23
#define STXXL_ERRMSG(x)
Definition: verbose.h:79
const char * get_library_version_string_long()
returns longer &quot;X.Y.Z (feature) (version)&quot; string of library
Definition: version.cpp:46
const char * get_version_string()
Return &quot;X.Y.Z&quot; version string (of headers)
Definition: version.h:32
#define stringify(x)
Definition: version.h:29
#define STXXL_END_NAMESPACE
Definition: namespace.h:17