Problem: Sun Studio build errors

Solution: add compiler flags to support extensions like anonymous
structs in unions, fix casting of const, and check for suncc rather
than solaris
This commit is contained in:
Luca Boccassi 2018-05-13 17:49:46 +01:00
parent cdb54d248b
commit 7ba074fa28
4 changed files with 12 additions and 2 deletions

View File

@ -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])

View File

@ -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<mutex_t &> (sync)
#else
sync
#endif
#endif
);
#endif

View File

@ -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 <typename K, typename V>
std::pair<const K, V> make_pair_fix_const (const K &k, const V &v)
{

View File

@ -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 <libunwind.h>