Commit 8a040c68 authored by Thomas Haller's avatar Thomas Haller

version: combine NM_VERSION_CUR_STABLE and NM_VERSION_NEXT_STABLE

We don't need to have two version defines "CUR" and "NEXT".

The main purpose of these macros (if not their only), is to
make NM_AVAILABLE_IN_* and NM_DEPRECATED_IN_* macros work.

1) At the precise commit of a release, "CUR" and "NEXT" must be identical,
because whenever the user configures NM_VERSION_MIN_REQUIRED and
NM_VERSION_MAX_ALLOWED, then they both compare against the current
version, at which point "CUR" == "NEXT".

2) Every other commit aside the release, is a development version that leads
up the the next coming release. But as far as versioning is concerned, such
a development version should be treated like that future release. It's unstable
API and it may or may not be close to later API of the release. But
we shall treat it as that version. Hence, also in this case, we want to
set both "NM_VERSION_CUR_STABLE" and again NEXT to the future version.

This makes NM_VERSION_NEXT_STABLE redundant.

Previously, the separation between current and next version would for
example allow that NM_VERSION_CUR_STABLE is the previously release
stable API, and NM_VERSION_NEXT_STABLE is the version of the next upcoming
stable API. So, we could allow "examples" to make use of development
API, but other(?) internal code still restrict to unstable API. But it's
unclear which other code would want to avoid current development.

Also, the points 1) and 2) were badly understood. Note that for our
previousy releases, we usually didn't bump the macros at the stable
release (and if we did, we didn't set them to be the same). While using
two macros might be more powerful, it is hard to grok and easy to
forget to bump the macros a the right time. One macro shall suffice.

All this also means, that *immediately* after making a new release, we shall
bump the version number in `configure.ac` and "NM_VERSION_CUR_STABLE".
parent f6768625
......@@ -10,7 +10,7 @@ examples_C_glib_cppflags = \
-I$(top_srcdir)/libnm \
-I$(top_builddir)/libnm \
$(GLIB_CFLAGS) \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_CUR_STABLE
examples_C_glib_cppflags_gdbus = $(examples_C_glib_cppflags)
examples_C_glib_cppflags_libnm = $(examples_C_glib_cppflags)
......
......@@ -56,7 +56,7 @@ 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_MAX_ALLOWED=NM_VERSION_CUR_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
......
......@@ -50,7 +50,7 @@ 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_MAX_ALLOWED=NM_VERSION_CUR_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
......
......@@ -71,7 +71,7 @@ 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_MAX_ALLOWED=NM_VERSION_CUR_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS)
......
......@@ -15,6 +15,6 @@ 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'
c_args: '-DNM_VERSION_MAX_ALLOWED=NM_VERSION_CUR_STABLE'
)
endforeach
......@@ -38,8 +38,8 @@
#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_VERSION_CUR_STABLE
#error "NM_VERSION_MIN_REQUIRED must be <= NM_VERSION_CUR_STABLE"
#endif
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED
#error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED"
......
......@@ -38,8 +38,8 @@
#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_VERSION_CUR_STABLE
#error "NM_VERSION_MIN_REQUIRED must be <= NM_VERSION_CUR_STABLE"
#endif
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED
#error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED"
......
......@@ -115,7 +115,7 @@
/* 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_MAX_ALLOWED NM_VERSION_CUR_STABLE
#define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8
#ifndef NM_MORE_ASSERTS
......
......@@ -74,8 +74,10 @@
#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
#define NM_VERSION_CUR_STABLE NM_VERSION_1_12
/* deprecated define. */
#define NM_VERSION_NEXT_STABLE NM_VERSION_CUR_STABLE
#define NM_VERSION NM_ENCODE_VERSION (NM_MAJOR_VERSION, NM_MINOR_VERSION, NM_MICRO_VERSION)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment