summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-10-09 08:03:58 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-10-09 08:03:58 +0200
commit318cdd1f24cd663702222cc182ae2ccac5e76870 (patch)
tree8d18a55d7327e43da1fd81e3df6a8db07e0a1846
parent214b56077a7e5d12813c8034013171d33283566c (diff)
parentef8db789a1c97152e84ff03c9a7f6e1e77d95981 (diff)
Merge branch 'maint'
* maint: Version macros added Conflicts: builds/msvc/platform.hpp Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--builds/msvc/platform.hpp8
-rw-r--r--configure.in13
-rw-r--r--include/zmq.h10
-rw-r--r--src/zmq.cpp6
4 files changed, 15 insertions, 22 deletions
diff --git a/builds/msvc/platform.hpp b/builds/msvc/platform.hpp
index 4c9cd3a..b20c851 100644
--- a/builds/msvc/platform.hpp
+++ b/builds/msvc/platform.hpp
@@ -20,15 +20,11 @@
#ifndef __ZMQ_PLATFORM_HPP_INCLUDED__
#define __ZMQ_PLATFORM_HPP_INCLUDED__
-// This is the platform definition for the Windows platform.
+// This is the platform definition for the MSVC platform.
// As a first step of the build process it is copied to
// zmq directory to take place of platform.hpp generated from
// platform.hpp.in on platforms supported by GNU autotools.
-
-// 0MQ version information
-#define PACKAGE_VERSION_MAJOR 2
-#define PACKAGE_VERSION_MINOR 1
-#define PACKAGE_VERSION_PATCH 0
+// Place any MSVC-specific definitions here.
#define ZMQ_HAVE_WINDOWS
diff --git a/configure.in b/configure.in
index a27dd13..88286ba 100644
--- a/configure.in
+++ b/configure.in
@@ -13,19 +13,6 @@ AC_CONFIG_MACRO_DIR(config)
AM_CONFIG_HEADER(src/platform.hpp)
AM_INIT_AUTOMAKE(tar-ustar dist-zip foreign)
-# This defines PACKAGE_VERSION_... in src/platform.hpp
-PV_MAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
-PV_MINOR=`echo $PACKAGE_VERSION | cut -d . -f 2`
-PV_PATCH=`echo $PACKAGE_VERSION | cut -d . -f 3`
-AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],[$PV_MAJOR],
- [0MQ major version])
-AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],
- [0MQ minor version])
-AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],
- [0MQ patchlevel])
-# This lets us use PACKAGE_VERSION in Makefiles
-AC_SUBST(PACKAGE_VERSION)
-
#
# Libtool -version-info (ABI version)
#
diff --git a/include/zmq.h b/include/zmq.h
index b8ab6d4..910e381 100644
--- a/include/zmq.h
+++ b/include/zmq.h
@@ -30,6 +30,16 @@ extern "C" {
#include "winsock2.h"
#endif
+/* Version macros */
+#define ZMQ_VERSION_MAJOR 2
+#define ZMQ_VERSION_MINOR 1
+#define ZMQ_VERSION_PATCH 0
+
+#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
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 6818605..dad4367 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -56,9 +56,9 @@
void zmq_version (int *major_, int *minor_, int *patch_)
{
- *major_ = PACKAGE_VERSION_MAJOR;
- *minor_ = PACKAGE_VERSION_MINOR;
- *patch_ = PACKAGE_VERSION_PATCH;
+ *major_ = ZMQ_VERSION_MAJOR;
+ *minor_ = ZMQ_VERSION_MINOR;
+ *patch_ = ZMQ_VERSION_PATCH;
}
const char *zmq_strerror (int errnum_)