summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/posix/Socket.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-03-25 13:34:44 +0000
committerAlan Conway <aconway@apache.org>2008-03-25 13:34:44 +0000
commitb449826a61eaa0a754e55ca8143882216a07d7e0 (patch)
tree9743d3b8a0f5479260beea3a7b47ac1fd8be1801 /cpp/src/qpid/sys/posix/Socket.cpp
parentbb542cee9af73a016360aa2d00addfee0206cad8 (diff)
downloadqpid-python-b449826a61eaa0a754e55ca8143882216a07d7e0.tar.gz
Fix compile errors/warnings with gcc 4.3
- added missing #includes that were implicitly included via old headers. - add namespace-qualifiers to fix "changes meaning of name" warnings. - ./qpid/ptr_map.h:51: fixed "qualified return value" warning. - use const char* for "conversion from string constant to ‘char*’" warnings Applied patch from https://issues.apache.org/jira/browse/QPID-869 remove depenency on boost/date_time, causes warnings with gcc 4.3. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@640806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/posix/Socket.cpp')
-rw-r--r--cpp/src/qpid/sys/posix/Socket.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/posix/Socket.cpp b/cpp/src/qpid/sys/posix/Socket.cpp
index 028b45d03d..c286ebce27 100644
--- a/cpp/src/qpid/sys/posix/Socket.cpp
+++ b/cpp/src/qpid/sys/posix/Socket.cpp
@@ -31,6 +31,7 @@
#include <netinet/in.h>
#include <netdb.h>
#include <cstdlib>
+#include <string.h>
#include <boost/format.hpp>
@@ -160,7 +161,7 @@ void Socket::connect(const std::string& host, int port) const
struct hostent* hp = gethostbyname ( host.c_str() );
if (hp == 0)
throw Exception(QPID_MSG("Cannot resolve " << host << ": " << h_errstr(h_errno)));
- memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length);
+ ::memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length);
if (::connect(socket, (struct sockaddr*)(&name), sizeof(name)) < 0)
throw qpid::Exception(QPID_MSG(strError(errno) << ": " << host << ":" << port));
}
@@ -260,12 +261,12 @@ std::string Socket::getLocalAddress() const
return impl->getName(true, true);
}
-uint Socket::getLocalPort() const
+uint16_t Socket::getLocalPort() const
{
return atoi(impl->getService(true).c_str());
}
-uint Socket::getRemotePort() const
+uint16_t Socket::getRemotePort() const
{
return atoi(impl->getService(true).c_str());
}