summaryrefslogtreecommitdiff
path: root/ytstenut/yts-version.h.in
blob: b221020f224b72e637077ed02e60aec777552619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * Copyright © 2011 Intel Corp.
 *
 * This  library is free  software; you can  redistribute it and/or
 * modify it  under  the terms  of the  GNU Lesser  General  Public
 * License  as published  by the Free  Software  Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed  in the hope that it will be useful,
 * but  WITHOUT ANY WARRANTY; without even  the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Authored by: Tomas Frydrych <tf@linux.intel.com>
 */

#ifndef YTS_VERSION_H
#define YTS_VERSION_H

#include <glib.h>

G_BEGIN_DECLS

/**
 * SECTION: yts-version
 * @short_description: Ytstenut version macros.
 */

/**
 * YTS_MAJOR_VERSION:
 *
 * The major version of the Ytstenut library (1, if %YTS_VERSION is 1.2.3)
 */
#define YTS_MAJOR_VERSION   (@YTS_MAJOR_VERSION@)

/**
 * YTS_MINOR_VERSION:
 *
 * The minor version of the Ytstenut library (2, if %YTS_VERSION is 1.2.3)
 */
#define YTS_MINOR_VERSION   (@YTS_MINOR_VERSION@)

/**
 * YTS_MICRO_VERSION:
 *
 * The micro version of the Ytstenut library (3, if %YTS_VERSION is 1.2.3)
 */
#define YTS_MICRO_VERSION   (@YTS_MICRO_VERSION@)

/**
 * YTS_VERSION:
 *
 * The full version of the Ytstenut library, like 1.2.3
 */
#define YTS_VERSION         @PACKAGE_VERSION@

/**
 * YTS_VERSION_S:
 *
 * The full version of the Ytstenut library, in string form (suited for
 * string concatenation)
 */
#define YTS_VERSION_S       "@PACKAGE_VERSION@"

/**
 * YTS_VERSION_HEX:
 *
 * Numerically encoded version of the Ytstenut library, like 0x010203
 */
#define YTS_VERSION_HEX     ((YTS_MAJOR_VERSION << 24) | \
                              (YTS_MINOR_VERSION << 16) | \
                              (YTS_MICRO_VERSION << 8))

/**
 * YTS_CHECK_VERSION:
 * @major: major version, like 1 in 1.2.3
 * @minor: minor version, like 2 in 1.2.3
 * @micro: micro version, like 3 in 1.2.3
 *
 * Evaluates to %TRUE if the version of the Ytstenut library is greater
 * than @major, @minor and @micro
 */
#define YTS_CHECK_VERSION(major,minor,micro) \
        (YTS_MAJOR_VERSION > (major) || \
        (YTS_MAJOR_VERSION == (major) && YTS_MINOR_VERSION > (minor)) || \
        (YTS_MAJOR_VERSION == (major) && YTS_MINOR_VERSION == (minor) && YTS_MICRO_VERSION >= (micro)))

G_END_DECLS

#endif /* YTS_VERSION_H */