From c39ac36e669e3dd5350761c29e774a8329604ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 8 Feb 2019 17:54:00 +0100 Subject: build-sys: add version tooling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add SLIRP_CHECK_VERSION() macro, and slirp_version_string() helpers. Signed-off-by: Marc-André Lureau --- src/libslirp-version.h.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/libslirp-version.h.in (limited to 'src/libslirp-version.h.in') diff --git a/src/libslirp-version.h.in b/src/libslirp-version.h.in new file mode 100644 index 0000000..59f7a46 --- /dev/null +++ b/src/libslirp-version.h.in @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +#ifndef LIBSLIRP_VERSION_H_ +#define LIBSLIRP_VERSION_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define SLIRP_MAJOR_VERSION @SLIRP_MAJOR_VERSION@ +#define SLIRP_MINOR_VERSION @SLIRP_MINOR_VERSION@ +#define SLIRP_MICRO_VERSION @SLIRP_MICRO_VERSION@ + +#define SLIRP_CHECK_VERSION(major,minor,micro) \ + (SLIRP_MAJOR_VERSION > (major) || \ + (SLIRP_MAJOR_VERSION == (major) && SLIRP_MINOR_VERSION > (minor)) || \ + (SLIRP_MAJOR_VERSION == (major) && SLIRP_MINOR_VERSION == (minor) && \ + SLIRP_MICRO_VERSION >= (micro))) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LIBSLIRP_VERSION_H_ */ -- cgit v1.1