What about extending the macros in version.h with a simple to use combined version number?
From e96108cbb92a923e02349a0d3b672a9b2b94c8b9 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos <n...@redhat.com> Date: Wed, 7 Feb 2018 11:29:07 +0100 Subject: [PATCH] version.h: introduce NETTLE_VERSION That macro is more easy to use on #if clauses. E.g., do that --- configure.ac | 1 + version.h.in | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 41bf0998..d06f55c9 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,7 @@ MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's/^\([[^.]]*\)\..*/\1/'` MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's/^[[^.]]*\.\([[0-9]]*\).*/\1/'` AC_SUBST([MAJOR_VERSION]) AC_SUBST([MINOR_VERSION]) +AC_SUBST([NUMBER_VERSION], $(printf "0x%02x%02x" ${MAJOR_VERSION} ${MINOR_VERSION})) AC_CANONICAL_HOST diff --git a/version.h.in b/version.h.in index cf429f25..7f10b995 100644 --- a/version.h.in +++ b/version.h.in @@ -43,6 +43,8 @@ extern "C" { #define NETTLE_VERSION_MAJOR @MAJOR_VERSION@ #define NETTLE_VERSION_MINOR @MINOR_VERSION@ +#define NETTLE_VERSION @NUMBER_VERSION@ + #define NETTLE_USE_MINI_GMP @NETTLE_USE_MINI_GMP@ /* We need a preprocessor constant for GMP_NUMB_BITS, simply using -- 2.14.3
_______________________________________________ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs