summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Santos <nsantos@apache.org>2012-02-16 21:43:35 +0000
committerNuno Santos <nsantos@apache.org>2012-02-16 21:43:35 +0000
commit400452421c0ff884cdf03b47bc4cb770e01ac274 (patch)
treea8631a701f6ac732699d51c1ba440b98039b0c4b
parentdaef6aecf7d9841b4d7c4832fe856b4ba723e9d0 (diff)
downloadqpid-python-400452421c0ff884cdf03b47bc4cb770e01ac274.tar.gz
missing casts and include to be able to compile under fedora 18
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1245195 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/sys/posix/Socket.cpp1
-rw-r--r--cpp/src/qpid/sys/posix/SocketAddress.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/posix/Socket.cpp b/cpp/src/qpid/sys/posix/Socket.cpp
index 4a6dc66f80..77ae1af60c 100644
--- a/cpp/src/qpid/sys/posix/Socket.cpp
+++ b/cpp/src/qpid/sys/posix/Socket.cpp
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/errno.h>
+#include <unistd.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
diff --git a/cpp/src/qpid/sys/posix/SocketAddress.cpp b/cpp/src/qpid/sys/posix/SocketAddress.cpp
index 6d5cf16b54..a7049c1851 100644
--- a/cpp/src/qpid/sys/posix/SocketAddress.cpp
+++ b/cpp/src/qpid/sys/posix/SocketAddress.cpp
@@ -84,8 +84,8 @@ std::string SocketAddress::asString(::sockaddr const * const addr, size_t addrle
uint16_t SocketAddress::getPort(::sockaddr const * const addr)
{
switch (addr->sa_family) {
- case AF_INET: return ntohs(((::sockaddr_in*)(void*)addr)->sin_port);
- case AF_INET6: return ntohs(((::sockaddr_in6*)(void*)addr)->sin6_port);
+ case AF_INET: return ntohs(((const ::sockaddr_in*)(const void*)addr)->sin_port);
+ case AF_INET6: return ntohs(((const ::sockaddr_in6*)(const void*)addr)->sin6_port);
default:throw Exception(QPID_MSG("Unexpected socket type"));
}
}