suppressed double definition of operator<<() when using libbitdht

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3343 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-08-06 12:26:49 +00:00
parent 4bb4fc11e2
commit 09d5014df5

View File

@ -142,13 +142,16 @@ bool getIPAddressFromString (const char *addr_str, struct in_addr *addr)
return false; return false;
} }
#ifndef RS_USE_BITDHT
// This function is also defined in the bitdht library. I added this to remove the compilation error due to
// duplicate definitions.
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr) std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
{ {
out << "[" << inet_ntoa(addr.sin_addr) << ":"; out << "[" << inet_ntoa(addr.sin_addr) << ":";
out << htons(addr.sin_port) << "]"; out << htons(addr.sin_port) << "]";
return out; return out;
} }
#endif
/* thread-safe version of inet_ntoa */ /* thread-safe version of inet_ntoa */