Debian Codegraph @

subprojects/gtk-frdp/src/gtk-frdp-version.h.in

raw
1 /* gtk-frdp-version.h.in
2 *
3 * Copyright (C) 2018 Felipe Borges
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser 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.
9 *
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 Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef GTK_FRDP_VERSION_H
20 #define GTK_FRDP_VERSION_H
21
22 #if !defined(GTK_FRDP_INSIDE) && !defined(GTK_FRDP_COMPILATION)
23 # error "Only <gtk-frdp.h> can be included directly."
24 #endif
25
26 /**
27 * SECTION:gtk-frdpversion
28 * @short_description: gtk-frdp version checking
29 *
30 * gtk-frdp provides macros to check the version of the library
31 * at compile-time
32 */
33
34 /**
35 * GTK_FRDP_MAJOR_VERSION:
36 *
37 * gtk-frdp major version component (e.g. 1 if %GTK_FRDP_VERSION is 1.2.3)
38 */
39 #define GTK_FRDP_MAJOR_VERSION (@MAJOR_VERSION@)
40
41 /**
42 * GTK_FRDP_MINOR_VERSION:
43 *
44 * gtk-frdp minor version component (e.g. 2 if %GTK_FRDP_VERSION is 1.2.3)
45 */
46 #define GTK_FRDP_MINOR_VERSION (@MINOR_VERSION@)
47
48 /**
49 * GTK_FRDP_MICRO_VERSION:
50 *
51 * gtk-frdp micro version component (e.g. 3 if %GTK_FRDP_VERSION is 1.2.3)
52 */
53 #define GTK_FRDP_MICRO_VERSION (@MICRO_VERSION@)
54
55 /**
56 * GTK_FRDP_VERSION
57 *
58 * gtk-frdp version.
59 */
60 #define GTK_FRDP_VERSION (@VERSION@)
61
62 /**
63 * GTK_FRDP_VERSION_S:
64 *
65 * gtk-frdp version, encoded as a string, useful for printing and
66 * concatenation.
67 */
68 #define GTK_FRDP_VERSION_S "@VERSION@"
69
70 #define GTK_FRDP_ENCODE_VERSION(major,minor,micro) \
71 ((major) << 24 | (minor) << 16 | (micro) << 8)
72
73 /**
74 * GTK_FRDP_VERSION_HEX:
75 *
76 * gtk-frdp version, encoded as an hexadecimal number, useful for
77 * integer comparisons.
78 */
79 #define GTK_FRDP_VERSION_HEX \
80 (GTK_FRDP_ENCODE_VERSION (GTK_FRDP_MAJOR_VERSION, GTK_FRDP_MINOR_VERSION, GTK_FRDP_MICRO_VERSION))
81
82 /**
83 * GTK_FRDP_CHECK_VERSION:
84 * @major: required major version
85 * @minor: required minor version
86 * @micro: required micro version
87 *
88 * Compile-time version checking. Evaluates to %TRUE if the version
89 * of gtk-frdp is greater than the required one.
90 */
91 #define GTK_FRDP_CHECK_VERSION(major,minor,micro) \
92 (GTK_FRDP_MAJOR_VERSION > (major) || \
93 (GTK_FRDP_MAJOR_VERSION == (major) && GTK_FRDP_MINOR_VERSION > (minor)) || \
94 (GTK_FRDP_MAJOR_VERSION == (major) && GTK_FRDP_MINOR_VERSION == (minor) && \
95 GTK_FRDP_MICRO_VERSION >= (micro)))
96
97 #endif /* GTK_FRDP_VERSION_H */