Line data Source code
1 : // Copyright (c) 2013-2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/cppthread
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 :
20 : /** \file
21 : * \brief The version of the cppthread at compile time.
22 : *
23 : * This file records the cppthread library version at compile time.
24 : *
25 : * The `#define` give you the library version at the time you are compiling.
26 : * The functions allow you to retrieve the version of a dynamically linked
27 : * library.
28 : */
29 :
30 : // self
31 : //
32 : #include "cppthread/version.h"
33 :
34 :
35 : // last include
36 : //
37 : #include <snapdev/poison.h>
38 :
39 :
40 :
41 : namespace cppthread
42 : {
43 :
44 : /** \def CPPTHREAD_VERSION_MAJOR
45 : * \brief The major version of the cppthread library.
46 : *
47 : * The major version at compile time.
48 : */
49 :
50 :
51 : /** \def CPPTHREAD_VERSION_MINOR
52 : * \brief The minor version of the cppthread library.
53 : *
54 : * The minor version at compile time.
55 : */
56 :
57 :
58 : /** \def CPPTHREAD_VERSION_PATCH
59 : * \brief The patch version of the cppthread library.
60 : *
61 : * The patch version at compile time.
62 : */
63 :
64 :
65 : /** \def CPPTHREAD_VERSION_STRING
66 : * \brief The version as a string.
67 : *
68 : * The version at compile time as a string.
69 : */
70 :
71 :
72 :
73 :
74 :
75 : /** \brief Get the major version of the library
76 : *
77 : * This function returns the major version of the running library (the
78 : * one you are linked against at runtime).
79 : *
80 : * \return The major version.
81 : */
82 1 : int get_major_version()
83 : {
84 1 : return CPPTHREAD_VERSION_MAJOR;
85 : }
86 :
87 :
88 : /** \brief Get the minor version of the library.
89 : *
90 : * This function returns the minor version of the running library
91 : * (the one you are linked against at runtime).
92 : *
93 : * \return The release version.
94 : */
95 1 : int get_release_version()
96 : {
97 1 : return CPPTHREAD_VERSION_MINOR;
98 : }
99 :
100 :
101 : /** \brief Get the patch version of the library.
102 : *
103 : * This function returns the patch version of the running library
104 : * (the one you are linked against at runtime).
105 : *
106 : * \return The patch version.
107 : */
108 1 : int get_patch_version()
109 : {
110 1 : return CPPTHREAD_VERSION_PATCH;
111 : }
112 :
113 :
114 : /** \brief Get the full version of the library as a string.
115 : *
116 : * This function returns the major, minor, and patch versions of the
117 : * running library (the one you are linked against at runtime) in the
118 : * form of a string.
119 : *
120 : * The build version is not made available. In most cases we change
121 : * the build version only to run a new build, so not code will have
122 : * changed (some documentation and non-code files may changed between
123 : * build versions; but the code will work exactly the same way.)
124 : *
125 : * \return The library version.
126 : */
127 1 : char const * get_version_string()
128 : {
129 1 : return CPPTHREAD_VERSION_STRING;
130 : }
131 :
132 :
133 : } // namespace cppthread
134 : // vim: ts=4 sw=4 et
|