From 3b3df731e60d604794538d0b9f6cb5b802a8745d Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Fri, 15 Oct 2010 15:05:54 +0200 Subject: configure.in: Extract API version from zmq.h * Added a version.sh and relevant changes to configure.in to extract the API version from zmq.h at the time autogen.sh is run. * Moved the version macros to be next to zmq_version in zmq.h and improved the comments. * Modified ZMQ_MAKE_VERSION to use (x) instead of plain x when expanding macro parameters. Signed-off-by: Martin Lucina --- include/zmq.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/zmq.h b/include/zmq.h index efa3edb..1cb6c03 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -30,16 +30,6 @@ extern "C" { #include "winsock2.h" #endif -/* Version macros */ -#define ZMQ_VERSION_MAJOR 2 -#define ZMQ_VERSION_MINOR 0 -#define ZMQ_VERSION_PATCH 10 - -#define ZMQ_MAKE_VERSION(major, minor, patch) \ - (major * 10000 + minor * 100 + patch) -#define ZMQ_VERSION \ - ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH) - /* Win32 needs special handling for DLL exports */ #if defined _WIN32 # if defined DLL_EXPORT @@ -55,6 +45,17 @@ extern "C" { /* 0MQ versioning support. */ /******************************************************************************/ +/* Version macros for compile-time API version detection */ +#define ZMQ_VERSION_MAJOR 2 +#define ZMQ_VERSION_MINOR 0 +#define ZMQ_VERSION_PATCH 10 + +#define ZMQ_MAKE_VERSION(major, minor, patch) \ + ((major) * 10000 + (minor) * 100 + (patch)) +#define ZMQ_VERSION \ + ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH) + +/* Run-time API version detection */ ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch); /******************************************************************************/ -- cgit v1.2.3