diff --git a/Makefile.examples b/Makefile.examples index d58fd22a22..d49db6ce86 100644 --- a/Makefile.examples +++ b/Makefile.examples @@ -9,8 +9,7 @@ examples_C_glib_cppflags = \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/libnm \ -I$(top_builddir)/libnm \ - $(GLIB_CFLAGS) \ - -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE + $(GLIB_CFLAGS) examples_C_glib_cppflags_gdbus = $(examples_C_glib_cppflags) examples_C_glib_cppflags_libnm = $(examples_C_glib_cppflags) diff --git a/configure.ac b/configure.ac index 55d9cebb36..d594c6b64e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,11 @@ AC_PREREQ([2.63]) dnl The NM version number +dnl +dnl XXX: When incrementing version also: +dnl - add corresponding NM_VERSION_x_y_z macros in +dnl "shared/nm-version-macros.h.in" +dnl - update number in meson.build m4_define([nm_major_version], [1]) m4_define([nm_minor_version], [11]) m4_define([nm_micro_version], [1]) diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am index 5273148a94..8a868d0e9c 100644 --- a/docs/libnm-glib/Makefile.am +++ b/docs/libnm-glib/Makefile.am @@ -56,7 +56,6 @@ GTKDOC_CFLAGS = \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ -I$(top_builddir)/libnm-glib \ - -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) diff --git a/docs/libnm-util/Makefile.am b/docs/libnm-util/Makefile.am index 75badb7791..1d417894b2 100644 --- a/docs/libnm-util/Makefile.am +++ b/docs/libnm-util/Makefile.am @@ -50,7 +50,6 @@ extra_files = # if $(DOC_MODULE).types is non-empty. GTKDOC_CFLAGS = \ -I$(top_srcdir)/libnm-util \ - -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) diff --git a/docs/libnm/Makefile.am b/docs/libnm/Makefile.am index 3ab55a8c43..288a595e64 100644 --- a/docs/libnm/Makefile.am +++ b/docs/libnm/Makefile.am @@ -71,7 +71,6 @@ GTKDOC_CFLAGS = \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/libnm \ -I$(top_builddir)/libnm \ - -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \ $(GLIB_CFLAGS) diff --git a/examples/C/glib/meson.build b/examples/C/glib/meson.build index 0a4694dd52..edc4dbb142 100644 --- a/examples/C/glib/meson.build +++ b/examples/C/glib/meson.build @@ -15,6 +15,5 @@ foreach example: examples [example[0] + '.c'] + example[1], include_directories: example[2], dependencies: [nm_core_dep] + example[3], - c_args: '-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE' ) endforeach diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h index 968fa66384..0412bc8e94 100644 --- a/libnm-core/nm-version.h +++ b/libnm-core/nm-version.h @@ -29,17 +29,17 @@ #if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0) # undef NM_VERSION_MIN_REQUIRED -# define NM_VERSION_MIN_REQUIRED (NM_VERSION_CUR_STABLE) +# define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) #endif #if !defined (NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0) # undef NM_VERSION_MAX_ALLOWED -# define NM_VERSION_MAX_ALLOWED (NM_VERSION_CUR_STABLE) +# define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) #endif /* sanity checks */ -#if NM_VERSION_MIN_REQUIRED > NM_VERSION_NEXT_STABLE -#error "NM_VERSION_MIN_REQUIRED must be <= NM_VERSION_NEXT_STABLE" +#if NM_VERSION_MIN_REQUIRED > NM_API_VERSION +#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED #error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h index 7173bc6ba3..f56c3944dd 100644 --- a/libnm-util/nm-version.h +++ b/libnm-util/nm-version.h @@ -29,17 +29,17 @@ #if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0) # undef NM_VERSION_MIN_REQUIRED -# define NM_VERSION_MIN_REQUIRED (NM_VERSION_CUR_STABLE) +# define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) #endif #if !defined (NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0) # undef NM_VERSION_MAX_ALLOWED -# define NM_VERSION_MAX_ALLOWED (NM_VERSION_CUR_STABLE) +# define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) #endif /* sanity checks */ -#if NM_VERSION_MIN_REQUIRED > NM_VERSION_NEXT_STABLE -#error "NM_VERSION_MIN_REQUIRED must be <= NM_VERSION_NEXT_STABLE" +#if NM_VERSION_MIN_REQUIRED > NM_API_VERSION +#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED #error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" diff --git a/meson.build b/meson.build index 9b2c1cc232..9786288a44 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,9 @@ project( 'NetworkManager', 'c', +# XXX: When incrementing version also: +# - add corresponding NM_VERSION_x_y_z macros in +# "shared/nm-version-macros.h.in" +# - update number in configure.ac version: '1.11.1', license: 'GPL2+', default_options: [ diff --git a/shared/nm-default.h b/shared/nm-default.h index 2e205a957e..8dab263be0 100644 --- a/shared/nm-default.h +++ b/shared/nm-default.h @@ -115,7 +115,6 @@ /* for internal compilation we don't want the deprecation macros * to be in effect. Define the widest range of versions to effectively * disable deprecation checks */ -#define NM_VERSION_MAX_ALLOWED NM_VERSION_NEXT_STABLE #define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8 #ifndef NM_MORE_ASSERTS diff --git a/shared/nm-version-macros.h.in b/shared/nm-version-macros.h.in index 3efa350cd5..8d07fc82ba 100644 --- a/shared/nm-version-macros.h.in +++ b/shared/nm-version-macros.h.in @@ -74,8 +74,23 @@ #define NM_VERSION_1_10 (NM_ENCODE_VERSION (1, 10, 0)) #define NM_VERSION_1_12 (NM_ENCODE_VERSION (1, 12, 0)) -#define NM_VERSION_CUR_STABLE NM_VERSION_1_10 -#define NM_VERSION_NEXT_STABLE NM_VERSION_1_12 +/* For releases, NM_API_VERSION is equal to NM_VERSION. + * + * For development builds, NM_API_VERSION is the next + * stable API after NM_VERSION. When you run a development + * version, you are already using the future API, even if + * it is not yet release. Hence, the currently used API + * version is the future one. */ +#define NM_API_VERSION \ + (((NM_MINOR_VERSION % 2) == 1) \ + ? NM_ENCODE_VERSION (NM_MAJOR_VERSION, NM_MINOR_VERSION + 1, 0 ) \ + : NM_ENCODE_VERSION (NM_MAJOR_VERSION, NM_MINOR_VERSION , ((NM_MICRO_VERSION + 1) / 2) * 2)) + +/* deprecated. */ +#define NM_VERSION_CUR_STABLE NM_API_VERSION + +/* deprecated. */ +#define NM_VERSION_NEXT_STABLE NM_API_VERSION #define NM_VERSION NM_ENCODE_VERSION (NM_MAJOR_VERSION, NM_MINOR_VERSION, NM_MICRO_VERSION) diff --git a/src/nm-config.c b/src/nm-config.c index 118a50ca72..ab839b83e7 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -553,7 +553,7 @@ nm_config_create_keyfile () /* this is an external variable, to make loading testable. Other then that, * no code is supposed to change this. */ -guint _nm_config_match_nm_version = NM_VERSION_CUR_STABLE; +guint _nm_config_match_nm_version = NM_VERSION; char *_nm_config_match_env = NULL; static gboolean