device: renew dhcp leases on awake for software devices
[NetworkManager.git] / shared / nm-version-macros.h.in
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301 USA.
17  *
18  * Copyright 2011, 2015 Red Hat, Inc.
19  */
20
21 #ifndef __NM_VERSION_MACROS_H__
22 #define __NM_VERSION_MACROS_H__
23
24 /* This header must not include glib or libnm. */
25
26 /**
27  * NM_MAJOR_VERSION:
28  *
29  * Evaluates to the major version number of NetworkManager which this source
30  * is compiled against.
31  */
32 #define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@)
33
34 /**
35  * NM_MINOR_VERSION:
36  *
37  * Evaluates to the minor version number of NetworkManager which this source
38  * is compiled against.
39  */
40 #define NM_MINOR_VERSION (@NM_MINOR_VERSION@)
41
42 /**
43  * NM_MICRO_VERSION:
44  *
45  * Evaluates to the micro version number of NetworkManager which this source
46  * compiled against.
47  */
48 #define NM_MICRO_VERSION (@NM_MICRO_VERSION@)
49
50 /**
51  * NM_CHECK_VERSION:
52  * @major: major version (e.g. 1 for version 1.2.5)
53  * @minor: minor version (e.g. 2 for version 1.2.5)
54  * @micro: micro version (e.g. 5 for version 1.2.5)
55  *
56  * Returns: %TRUE if the version of the NetworkManager header files
57  * is the same as or newer than the passed-in version.
58  */
59 #define NM_CHECK_VERSION(major,minor,micro)                         \
60     (NM_MAJOR_VERSION > (major) ||                                  \
61      (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \
62      (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro)))
63
64
65 #define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro))
66
67 #define NM_VERSION_0_9_8  (NM_ENCODE_VERSION (0, 9, 8))
68 #define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10))
69 #define NM_VERSION_1_0    (NM_ENCODE_VERSION (1, 0, 0))
70 #define NM_VERSION_1_2    (NM_ENCODE_VERSION (1, 2, 0))
71
72 #define NM_VERSION_CUR_STABLE  NM_VERSION_1_0
73 #define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
74
75 #endif  /* __NM_VERSION_MACROS_H__ */