aboutsummaryrefslogtreecommitdiff
path: root/src/libslirp-version.h.in
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-02-08 17:54:00 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-03-26 01:22:17 +0100
commitc39ac36e669e3dd5350761c29e774a8329604ad1 (patch)
tree6c7748326a8ab237440202eafa431b1845244771 /src/libslirp-version.h.in
parent2898b001ea7ed85c15fc978b2fde446398a1e7b8 (diff)
downloadslirp-c39ac36e669e3dd5350761c29e774a8329604ad1.zip
slirp-c39ac36e669e3dd5350761c29e774a8329604ad1.tar.gz
slirp-c39ac36e669e3dd5350761c29e774a8329604ad1.tar.bz2
build-sys: add version tooling
Add SLIRP_CHECK_VERSION() macro, and slirp_version_string() helpers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'src/libslirp-version.h.in')
-rw-r--r--src/libslirp-version.h.in23
1 files changed, 23 insertions, 0 deletions
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_ */