diff --git a/configure.ac b/configure.ac index 6cce5383..d0daa89e 100644 --- a/configure.ac +++ b/configure.ac @@ -315,6 +315,12 @@ case "${host_os}" in ;; esac +# Sun Studio does not like anonymous structures in unions +if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + CXXFLAGS="${CXXFLAGS} -features=extensions" + CFLAGS="${CFLAGS} -features=extensions" +fi + # Checks for libraries AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([rt], [clock_gettime]) diff --git a/src/atomic_ptr.hpp b/src/atomic_ptr.hpp index ed6d7b41..f7113adc 100644 --- a/src/atomic_ptr.hpp +++ b/src/atomic_ptr.hpp @@ -266,7 +266,11 @@ struct atomic_value_t return (int) (ptrdiff_t) atomic_cas ((void **) &value, 0, 0 #if defined ZMQ_ATOMIC_PTR_MUTEX , +#if defined __SUNPRO_CC + const_cast (sync) +#else sync +#endif #endif ); #endif diff --git a/src/blob.hpp b/src/blob.hpp index 3159bb9d..44de6ac8 100644 --- a/src/blob.hpp +++ b/src/blob.hpp @@ -40,7 +40,7 @@ #define ZMQ_PUSH_OR_EMPLACE_BACK emplace_back #define ZMQ_MOVE(x) std::move (x) #else -#if defined ZMQ_HAVE_SOLARIS +#if defined __SUNPRO_CC template std::pair make_pair_fix_const (const K &k, const V &v) { diff --git a/src/err.cpp b/src/err.cpp index 8a042721..ffbc4b34 100644 --- a/src/err.cpp +++ b/src/err.cpp @@ -387,7 +387,7 @@ int zmq::wsa_error_to_errno (int errcode) #endif -#ifdef HAVE_LIBUNWIND +#if defined(HAVE_LIBUNWIND) && !defined(__SUNPRO_CC) #define UNW_LOCAL_ONLY #include