Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
VC2013 compile fix (no support for constexpr).
Browse files Browse the repository at this point in the history
A new define ZMQPP_NO_CONSTEXPR was introduced in compatibility.h. It is
set for all versions of VC++ including VC2013. VC2015 should have
support for constexpr but needs to be tested when it is available.

This fixes zeromq#99.
  • Loading branch information
rcane committed May 24, 2015
1 parent 72668f6 commit 55553a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/zmqpp/auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

#if (ZMQ_VERSION_MAJOR > 3)

#if defined(ZMQPP_NO_CONSTEXPR)
const char * const zmqpp::auth::zap_endpoint_ = "inproc://zeromq.zap.01";
#endif

namespace zmqpp
{
auth::auth(context& ctx) :
Expand Down
4 changes: 4 additions & 0 deletions src/zmqpp/auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ class auth
bool terminated; // Did caller ask us to quit?
bool verbose; // Verbose logging enabled?

# if defined(ZMQPP_NO_CONSTEXPR)
static const char * const zap_endpoint_;
# else
constexpr static const char * const zap_endpoint_ = "inproc://zeromq.zap.01";
# endif

// No copy - private and not implemented
auth(auth const&) ZMQPP_EXPLICITLY_DELETED;
Expand Down
3 changes: 3 additions & 0 deletions src/zmqpp/compatibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@

#if defined(_MSC_VER)
#define NOEXCEPT throw()
#if _MSC_VER < 1900
# define ZMQPP_NO_CONSTEXPR
#endif
#if _MSC_VER < 1800
#define ZMQPP_EXPLICITLY_DELETED
#endif // if _MSC_VER < 1800
Expand Down

0 comments on commit 55553a6

Please sign in to comment.