[zeromq-dev] patches for building on Solaris 10, with Sun CC
Jon Dyte
jon at totient.co.uk
Thu Mar 18 21:43:13 CET 2010
Hi
a) For my sol 10 build I do not appear to need the -D POSIX_C .....
flag. (is it a GCC only thing)
b) Sunstudio 12.1 CC std::make_pair not make std::string from const char*
c) the Sun compiler CC doesnt like a variable called sun as it defines
this in a #define
Jon
diff --git a/configure.in b/configure.in
index 36f95a8..9c63660 100644
--- a/configure.in
+++ b/configure.in
@@ -111,7 +111,7 @@ case "${host_os}" in
;;
*solaris*)
# Define on Solaris to enable all library features
- CPPFLAGS="-D_POSIX_C_SOURCE=200112L -D_PTHREADS $CPPFLAGS"
+ CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp
index a49b598..8b37a9e 100644
--- a/src/dispatcher.cpp
+++ b/src/dispatcher.cpp
@@ -264,7 +264,7 @@ int zmq::dispatcher_t::register_endpoint (const char
*addr_,
{
endpoints_sync.lock ();
- bool inserted = endpoints.insert (std::make_pair (addr_,
socket_)).second;
+ bool inserted = endpoints.insert (std::make_pair
(std::string(addr_), socket_)).second;
if (!inserted) {
errno = EADDRINUSE;
endpoints_sync.unlock ();
diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp
index fdcdf17..437c6eb 100644
--- a/src/tcp_listener.cpp
+++ b/src/tcp_listener.cpp
@@ -251,9 +251,9 @@ int zmq::tcp_listener_t::close ()
// If there's an underlying UNIX domain socket, get rid of the file it
// is associated with.
- struct sockaddr_un *sun = (struct sockaddr_un*) &addr;
- if (AF_UNIX == sun->sun_family) {
- rc = ::unlink(sun->sun_path);
+ struct sockaddr_un *su = (struct sockaddr_un*) &addr;
+ if (AF_UNIX == su->sun_family) {
+ rc = ::unlink(su->sun_path);
if (rc != 0)
return -1;
}
More information about the zeromq-dev
mailing list