From be57c1acb7de58dd0366be5d93b12114dd9d3bf9 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sun, 13 Nov 2016 10:41:58 +0100 Subject: [PATCH] Update to 4.1.6 --- sources | 2 +- zeromq.spec | 11 ++++++----- zmq.hpp | 47 +++++++++++++++++++++++++++++++++++------------ 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/sources b/sources index 6ce4e29..c7d0911 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a611ecc93fffeb6d058c0e6edf4ad4fb zeromq-4.1.4.tar.gz +c89db4dbc0b90c34c9f4983cbff6d321 zeromq-4.1.6.tar.gz diff --git a/zeromq.spec b/zeromq.spec index c7fe1aa..1792a46 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,15 +1,15 @@ %bcond_without pgm Name: zeromq -Version: 4.1.4 -Release: 5%{?dist} +Version: 4.1.6 +Release: 1%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries License: LGPLv3+ URL: http://www.zeromq.org # VCS: git:http://github.com/zeromq/zeromq2.git -Source0: http://download.zeromq.org/zeromq-%{version}.tar.gz +Source0: https://github.com/zeromq/zeromq4-1/releases/download/v%{version}/zeromq-%{version}.tar.gz Source1: https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp Source2: https://raw.githubusercontent.com/zeromq/cppzmq/master/LICENSE @@ -124,8 +124,6 @@ make check V=1 %{_libdir}/libzmq.so %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h -%{_mandir}/man3/zmq* -%{_mandir}/man7/zmq* %files -n cppzmq-devel %license LICENSE @@ -133,6 +131,9 @@ make check V=1 %changelog +* Sun Nov 13 2016 Thomas Spura - 4.1.6-1 +- update to 4.1.6 + * Mon Mar 07 2016 Remi Collet - 4.1.4-5 - rebuild for new libsodium soname diff --git a/zmq.hpp b/zmq.hpp index e4ed26d..28dc67b 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -25,10 +25,14 @@ #ifndef __ZMQ_HPP_INCLUDED__ #define __ZMQ_HPP_INCLUDED__ -#if __cplusplus >= 201103L -#define ZMQ_CPP11 -#define ZMQ_NOTHROW noexcept -#define ZMQ_EXPLICIT explicit +#if (__cplusplus >= 201103L) + #define ZMQ_CPP11 + #define ZMQ_NOTHROW noexcept + #define ZMQ_EXPLICIT explicit +#elif (defined(_MSC_VER) && (_MSC_VER >= 1900)) + #define ZMQ_CPP11 + #define ZMQ_NOTHROW noexcept + #define ZMQ_EXPLICIT explicit #else #define ZMQ_CPP03 #define ZMQ_NOTHROW @@ -66,6 +70,9 @@ #else #define ZMQ_DELETED_FUNCTION #endif +#elif defined(_MSC_VER) && (_MSC_VER >= 1900) + #define ZMQ_HAS_RVALUE_REFS + #define ZMQ_DELETED_FUNCTION = delete #elif defined(_MSC_VER) && (_MSC_VER >= 1600) #define ZMQ_HAS_RVALUE_REFS #define ZMQ_DELETED_FUNCTION @@ -111,12 +118,17 @@ namespace zmq public: error_t () : errnum (zmq_errno ()) {} - - virtual const char *what () const throw () +#ifdef ZMQ_CPP11 + virtual const char *what () const noexcept { return zmq_strerror (errnum); } - +#else + virtual const char *what() const throw () + { + return zmq_strerror(errnum); + } +#endif int num () const { return errnum; @@ -351,6 +363,14 @@ namespace zmq return static_cast( data() ); } + inline bool equal(const message_t* other) const ZMQ_NOTHROW + { + if (size() != other->size()) + return false; + std::string a(data(), size()); + std::string b(other->data(), other->size()); + return a == b; + } private: // The underlying message @@ -402,14 +422,17 @@ namespace zmq inline ~context_t () ZMQ_NOTHROW { - int rc = zmq_ctx_destroy (ptr); - ZMQ_ASSERT (rc == 0); + close(); } inline void close() ZMQ_NOTHROW { - int rc = zmq_ctx_shutdown (ptr); + if (ptr == NULL) + return; + + int rc = zmq_ctx_destroy (ptr); ZMQ_ASSERT (rc == 0); + ptr = NULL; } // Be careful with this, it's probably only useful for @@ -487,12 +510,12 @@ namespace zmq close(); } - inline ZMQ_EXPLICIT operator void* () ZMQ_NOTHROW + inline operator void* () ZMQ_NOTHROW { return ptr; } - inline ZMQ_EXPLICIT operator void const* () const ZMQ_NOTHROW + inline operator void const* () const ZMQ_NOTHROW { return ptr; }