Merge pull request #89 from phlptp/master

Visual Studio 2015 definitions
This commit is contained in:
Constantin Rack 2016-11-06 20:16:23 +01:00 committed by GitHub
commit 4648ebc964

18
zmq.hpp
View File

@ -25,7 +25,11 @@
#ifndef __ZMQ_HPP_INCLUDED__ #ifndef __ZMQ_HPP_INCLUDED__
#define __ZMQ_HPP_INCLUDED__ #define __ZMQ_HPP_INCLUDED__
#if __cplusplus >= 201103L #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_CPP11
#define ZMQ_NOTHROW noexcept #define ZMQ_NOTHROW noexcept
#define ZMQ_EXPLICIT explicit #define ZMQ_EXPLICIT explicit
@ -66,6 +70,9 @@
#else #else
#define ZMQ_DELETED_FUNCTION #define ZMQ_DELETED_FUNCTION
#endif #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) #elif defined(_MSC_VER) && (_MSC_VER >= 1600)
#define ZMQ_HAS_RVALUE_REFS #define ZMQ_HAS_RVALUE_REFS
#define ZMQ_DELETED_FUNCTION #define ZMQ_DELETED_FUNCTION
@ -111,12 +118,17 @@ namespace zmq
public: public:
error_t () : errnum (zmq_errno ()) {} error_t () : errnum (zmq_errno ()) {}
#ifdef ZMQ_CPP11
virtual const char *what () const noexcept
{
return zmq_strerror (errnum);
}
#else
virtual const char *what() const throw () virtual const char *what() const throw ()
{ {
return zmq_strerror(errnum); return zmq_strerror(errnum);
} }
#endif
int num () const int num () const
{ {
return errnum; return errnum;