aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-02 19:02:48 -0800
committerGarrett D'Amore <garrett@damore.org>2018-03-02 19:03:08 -0800
commitf305f28c8dbac109c1038d430c7125222ee90703 (patch)
treedcba1b998c1eb3d8f2bd10283ab2721251f6a535 /src/nng.c
parenta315244fc92aaed52cd4c620521c797c7a0b5f4c (diff)
downloadnng-f305f28c8dbac109c1038d430c7125222ee90703.tar.gz
nng-f305f28c8dbac109c1038d430c7125222ee90703.tar.bz2
nng-f305f28c8dbac109c1038d430c7125222ee90703.zip
fixes #254 nngcat should have a --version option
We only add a basic --version (also -V). I'm still trying to figure out how to convince cmake to emit its compilation flags into a file where we can use them for output.
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nng.c b/src/nng.c
index b7255904..19b33220 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -8,6 +8,7 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include "nng.h"
#include "core/nng_impl.h"
// This file provides the "public" API. This is a thin wrapper around
@@ -1212,3 +1213,13 @@ nng_url_clone(nng_url **dstp, const nng_url *src)
{
return (nni_url_clone(dstp, src));
}
+
+#define xstr(a) str(a)
+#define str(a) #a
+
+const char *
+nng_version(void)
+{
+ return (xstr(NNG_MAJOR_VERSION) "." xstr(NNG_MINOR_VERSION) "." xstr(
+ NNG_PATCH_VERSION));
+}