From 165fe65eef720dcc494c9afa2d787325e0a08053 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 16 Jan 2018 15:57:13 +0100 Subject: [PATCH] version: calculate NM_VERSION_CUR_STABLE based on the version numbers We have a well defined versioning scheme and a defined way how the version number indicates a stable version. We can simply calculate NM_VERSION_CUR_STABLE based on the version numbers. --- shared/nm-version-macros.h.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/nm-version-macros.h.in b/shared/nm-version-macros.h.in index 0cbd1b0bdd..40104f5f35 100644 --- a/shared/nm-version-macros.h.in +++ b/shared/nm-version-macros.h.in @@ -74,7 +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_12 +#define NM_VERSION_CUR_STABLE \ + (((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. */ #define NM_VERSION_NEXT_STABLE NM_VERSION_CUR_STABLE