Commit 9bd2d3f9 authored by Luca Boccassi's avatar Luca Boccassi

Problem: mis-detection of threadsafe_static_init causes test failures

Solution: do not rely __cplusplus >= 201103L to detect whether the
compiler supports thread safe static initialisation, but check only
the proper feature preprocessor macro.
GCC introduced it in version 8, and Clang in version 6.
parent 677efea2
...@@ -92,8 +92,7 @@ uint32_t zmq::generate_random () ...@@ -92,8 +92,7 @@ uint32_t zmq::generate_random ()
// configurable via config.h // configurable via config.h
// TODO this should probably be done via config.h // TODO this should probably be done via config.h
#if __cplusplus >= 201103L \ #if (defined(__cpp_threadsafe_static_init) \
|| (defined(__cpp_threadsafe_static_init) \
&& __cpp_threadsafe_static_init >= 200806) \ && __cpp_threadsafe_static_init >= 200806) \
|| (defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(_MSC_VER) && _MSC_VER >= 1900)
#define ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT 1 #define ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment