Lunchbox  1.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
version.h
1 /* Copyright (c) 2014 Stefan.Eilemann@epfl.ch */
2 
3 #ifndef LUNCHBOX_VERSION_H
4 #define LUNCHBOX_VERSION_H
5 
6 #include <lunchbox/api.h>
7 #include <string>
8 
9 namespace lunchbox
10 {
12 # define LUNCHBOX_VERSION_MAJOR 1
13 
15 # define LUNCHBOX_VERSION_MINOR 9
16 
18 # define LUNCHBOX_VERSION_PATCH 1
19 
21 # define LUNCHBOX_VERSION_REVISION 0x31ff9fb
22 
24 # define LUNCHBOX_VERSION_ABI 3
25 
27 # define LUNCHBOX_VERSION_GT( MAJOR, MINOR, PATCH ) \
28  ( (LUNCHBOX_VERSION_MAJOR>MAJOR) || \
29  (LUNCHBOX_VERSION_MAJOR==MAJOR && (LUNCHBOX_VERSION_MINOR>MINOR || \
30  (LUNCHBOX_VERSION_MINOR==MINOR && LUNCHBOX_VERSION_PATCH>PATCH))))
31 
33 # define LUNCHBOX_VERSION_GE( MAJOR, MINOR, PATCH ) \
34  ( (LUNCHBOX_VERSION_MAJOR>MAJOR) || \
35  (LUNCHBOX_VERSION_MAJOR==MAJOR && (LUNCHBOX_VERSION_MINOR>MINOR || \
36  (LUNCHBOX_VERSION_MINOR==MINOR && LUNCHBOX_VERSION_PATCH>=PATCH))))
37 
39 # define LUNCHBOX_VERSION_LT( MAJOR, MINOR, PATCH ) \
40  ( (LUNCHBOX_VERSION_MAJOR<MAJOR) || \
41  (LUNCHBOX_VERSION_MAJOR==MAJOR && (LUNCHBOX_VERSION_MINOR<MINOR || \
42  (LUNCHBOX_VERSION_MINOR==MINOR && LUNCHBOX_VERSION_PATCH<PATCH))))
43 
45 # define LUNCHBOX_VERSION_LE( MAJOR, MINOR, PATCH ) \
46  ( (LUNCHBOX_VERSION_MAJOR<MAJOR) || \
47  (LUNCHBOX_VERSION_MAJOR==MAJOR && (LUNCHBOX_VERSION_MINOR<MINOR || \
48  (LUNCHBOX_VERSION_MINOR==MINOR && LUNCHBOX_VERSION_PATCH<=PATCH))))
49 
51 class LUNCHBOX_API Version
52 {
53 public:
55  static int getMajor();
56 
58  static int getMinor();
59 
61  static int getPatch();
62 
64  static std::string getString();
65 
67  static int getRevision();
68 
70  static int getABI();
71 
73  static std::string getRevString();
74 
83  static bool check()
84  {
85  return getMajor()==LUNCHBOX_VERSION_MAJOR &&
86  getMinor()==LUNCHBOX_VERSION_MINOR;
87  }
88 };
89 
90 }
91 
92 #endif
Defines export visibility macros for Lunchbox.
static bool check()
Runtime check for ABI compatibility.
Definition: version.h:83
Information about the current Lunchbox version.
Definition: version.h:51