mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 21:34:10 -05:00
fixed compilation for windows (to be tested)
This commit is contained in:
parent
e776effc0d
commit
4a4625e2bf
@ -75,6 +75,9 @@ void sockaddr_clear(struct sockaddr_in *addr)
|
||||
|
||||
bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
|
||||
{
|
||||
#ifdef WINDOWS_SYS
|
||||
hostent *result = gethostbyname(hostname.c_str()) ;
|
||||
#else
|
||||
RsTemporaryMemory mem(8192) ;
|
||||
|
||||
if(!mem)
|
||||
@ -92,9 +95,10 @@ bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
|
||||
std::cerr << __PRETTY_FUNCTION__ << ": cannot call gethostname_r. Internal error reported. Check buffer size." << std::endl;
|
||||
return false ;
|
||||
}
|
||||
#endif
|
||||
if(!result)
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << ": gethostname_r returned null result." << std::endl;
|
||||
std::cerr << __PRETTY_FUNCTION__ << ": gethostname returned null result." << std::endl;
|
||||
return false ;
|
||||
}
|
||||
// Use contents of result.
|
||||
|
Loading…
x
Reference in New Issue
Block a user