HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_Version.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_Version.h (UT Library, C/C++)
7  */
8 
9 /*
10  * NOTE: This is automatically generated from SYS_Version.tmpl.h
11  */
12 #ifndef __SYS_Version__
13 #define __SYS_Version__
14 
15 /// @file SYS_Version.h
16 /// Defines compile time version constants for use in code.
17 /// @note Please see UT_String::compareVersionString()
18 
19 // <sys/types.h> defines macros with the names 'major' and 'minor'.
20 // glibc 2.25+ emits deprecation warnings for this, so eventually the include
21 // of <sys/sysmacros.h> will be removed and the undef'ing won't be necessary.
22 #undef major
23 #undef minor
24 
25 
26 // The major.minor.build version as a string
27 #define SYS_VERSION_FULL "20.5.410"
28 
29 // The major.minor version as a string
30 #define SYS_VERSION_RELEASE "20.5"
31 
32 // The major version. .9 counts as next higher.
33 #define SYS_VERSION_MAJOR "20"
34 #define SYS_VERSION_MINOR "5"
35 #define SYS_VERSION_BUILD "410"
36 #define SYS_VERSION_PATCH "0"
37 
38 // Version numbers as integer values
39 #define SYS_VERSION_MAJOR_INT 20
40 #define SYS_VERSION_MINOR_INT 5
41 #define SYS_VERSION_BUILD_INT 410
42 #define SYS_VERSION_PATCH_INT 0
43 
44 // Version as a packed integer: ("%02x%02x%04x", major, minor, build)
45 #define SYS_VERSION_FULL_INT 0x1405019a
46 
47 #if defined(__cplusplus)
48 struct SYS_Version
49 {
50  /// Return the "major.minor.build" version
51  static constexpr const char *full() { return SYS_VERSION_FULL; }
52 
53  /// Return the "major.minor" version
54  static constexpr const char *release() { return SYS_VERSION_RELEASE; }
55 
56  /// Return the "major" version
57  static constexpr const char *major() { return SYS_VERSION_MAJOR; }
58 
59  /// Return the "minor" version
60  static constexpr const char *minor() { return SYS_VERSION_MINOR; }
61 
62  /// Return the "build" version
63  static constexpr const char *build() { return SYS_VERSION_BUILD; }
64 
65  /// Return the "patch" version
66  static constexpr const char *patch() { return SYS_VERSION_PATCH; }
67 
68  /// Return the full version as a numerical set of values.
69  static constexpr void getFull(int &major, int &minor, int &build,
70  int *patch = 0)
71  {
72  major = SYS_VERSION_MAJOR_INT;
73  minor = SYS_VERSION_MINOR_INT;
74  build = SYS_VERSION_BUILD_INT;
75  if (patch)
76  *patch = SYS_VERSION_PATCH_INT;
77  }
78 
79  /// Return the release version as a numerical set of values.
80  static constexpr void getRelease(int &major, int &minor)
81  {
82  major = SYS_VERSION_MAJOR_INT;
83  minor = SYS_VERSION_MINOR_INT;
84  }
85 };
86 #endif
87 
88 #endif
89 
#define SYS_VERSION_MINOR_INT
Definition: SYS_Version.h:40
#define SYS_VERSION_BUILD
Definition: SYS_Version.h:35
#define SYS_VERSION_MAJOR_INT
Definition: SYS_Version.h:39
#define SYS_VERSION_RELEASE
Definition: SYS_Version.h:30
#define SYS_VERSION_BUILD_INT
Definition: SYS_Version.h:41
#define SYS_VERSION_MINOR
Definition: SYS_Version.h:34
#define SYS_VERSION_FULL
Definition: SYS_Version.h:27
#define SYS_VERSION_PATCH
Definition: SYS_Version.h:36
#define SYS_VERSION_MAJOR
Definition: SYS_Version.h:33
#define SYS_VERSION_PATCH_INT
Definition: SYS_Version.h:42