aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-03-17 16:35:17 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-03-17 17:41:35 +0100
commitdbd81bbb89ae91334fb2e608e6860ed0055d1915 (patch)
tree810511bae3e3f95b3a9db73cebbcf31644a907c7 /src
parent3f8f6826ac012f82a7c80beccc0240eac053f403 (diff)
downloadslirp-dbd81bbb89ae91334fb2e608e6860ed0055d1915.zip
slirp-dbd81bbb89ae91334fb2e608e6860ed0055d1915.tar.gz
slirp-dbd81bbb89ae91334fb2e608e6860ed0055d1915.tar.bz2
Teach slirp_version_string() to return vcs version
Meson build will use a vcs-generate version, while Makefile will always use -git version, since it is only intended for submodule usage. Eventually can be improved if needed. Fixes: https://gitlab.freedesktop.org/slirp/libslirp/issues/17 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/libslirp-version.h.in1
-rw-r--r--src/version.c5
2 files changed, 2 insertions, 4 deletions
diff --git a/src/libslirp-version.h.in b/src/libslirp-version.h.in
index 59f7a46..faa6c85 100644
--- a/src/libslirp-version.h.in
+++ b/src/libslirp-version.h.in
@@ -9,6 +9,7 @@ extern "C" {
#define SLIRP_MAJOR_VERSION @SLIRP_MAJOR_VERSION@
#define SLIRP_MINOR_VERSION @SLIRP_MINOR_VERSION@
#define SLIRP_MICRO_VERSION @SLIRP_MICRO_VERSION@
+#define SLIRP_VERSION_STRING @SLIRP_VERSION_STRING@
#define SLIRP_CHECK_VERSION(major,minor,micro) \
(SLIRP_MAJOR_VERSION > (major) || \
diff --git a/src/version.c b/src/version.c
index a837323..93e0be9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -1,11 +1,8 @@
/* SPDX-License-Identifier: BSD-3-Clause */
#include "libslirp.h"
-#include "util.h"
const char *
slirp_version_string(void)
{
- return stringify(SLIRP_MAJOR_VERSION) "."
- stringify(SLIRP_MINOR_VERSION) "."
- stringify(SLIRP_MICRO_VERSION);
+ return SLIRP_VERSION_STRING;
}