1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
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.
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.
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.
18 * Copyright 2011, 2015 Red Hat, Inc.
21 #ifndef __NM_VERSION_MACROS_H__
22 #define __NM_VERSION_MACROS_H__
24 /* This header must not include glib or libnm. */
29 * Evaluates to the major version number of NetworkManager which this source
30 * is compiled against.
32 #define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@)
37 * Evaluates to the minor version number of NetworkManager which this source
38 * is compiled against.
40 #define NM_MINOR_VERSION (@NM_MINOR_VERSION@)
45 * Evaluates to the micro version number of NetworkManager which this source
48 #define NM_MICRO_VERSION (@NM_MICRO_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)
56 * Returns: %TRUE if the version of the NetworkManager header files
57 * is the same as or newer than the passed-in version.
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)))
65 #define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro))
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))
72 #define NM_VERSION_CUR_STABLE NM_VERSION_1_0
73 #define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
75 #endif /* __NM_VERSION_MACROS_H__ */