1
/* libbreezy-version.h.in
3
* Copyright 2021 Gustav Hartvigsson
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#if !defined(LIBBREEZY_INSIDE) && !defined(LIBBREEZY_COMPILATION)
22
# error "Only <libbreezy.h> can be included directly."
26
* SECTION:libbreezyversion
27
* @short_description: libbreezy version checking
29
* libbreezy provides macros to check the version of the library
34
* LIBBREEZY_MAJOR_VERSION:
36
* libbreezy major version component (e.g. 1 if %LIBBREEZY_VERSION is 1.2.3)
38
#define LIBBREEZY_MAJOR_VERSION (@MAJOR_VERSION@)
41
* LIBBREEZY_MINOR_VERSION:
43
* libbreezy minor version component (e.g. 2 if %LIBBREEZY_VERSION is 1.2.3)
45
#define LIBBREEZY_MINOR_VERSION (@MINOR_VERSION@)
48
* LIBBREEZY_MICRO_VERSION:
50
* libbreezy micro version component (e.g. 3 if %LIBBREEZY_VERSION is 1.2.3)
52
#define LIBBREEZY_MICRO_VERSION (@MICRO_VERSION@)
59
#define LIBBREEZY_VERSION (@VERSION@)
62
* LIBBREEZY_VERSION_S:
64
* libbreezy version, encoded as a string, useful for printing and
67
#define LIBBREEZY_VERSION_S "@VERSION@"
69
#define LIBBREEZY_ENCODE_VERSION(major,minor,micro) \
70
((major) << 24 | (minor) << 16 | (micro) << 8)
73
* LIBBREEZY_VERSION_HEX:
75
* libbreezy version, encoded as an hexadecimal number, useful for
76
* integer comparisons.
78
#define LIBBREEZY_VERSION_HEX \
79
(LIBBREEZY_ENCODE_VERSION (LIBBREEZY_MAJOR_VERSION, LIBBREEZY_MINOR_VERSION, LIBBREEZY_MICRO_VERSION))
82
* LIBBREEZY_CHECK_VERSION:
83
* @major: required major version
84
* @minor: required minor version
85
* @micro: required micro version
87
* Compile-time version checking. Evaluates to %TRUE if the version
88
* of libbreezy is greater than the required one.
90
#define LIBBREEZY_CHECK_VERSION(major,minor,micro) \
91
(LIBBREEZY_MAJOR_VERSION > (major) || \
92
(LIBBREEZY_MAJOR_VERSION == (major) && LIBBREEZY_MINOR_VERSION > (minor)) || \
93
(LIBBREEZY_MAJOR_VERSION == (major) && LIBBREEZY_MINOR_VERSION == (minor) && \
94
LIBBREEZY_MICRO_VERSION >= (micro)))