#pragma hdrstop
#endif
+#if wxUSE_SOCKETS
+
#ifndef WX_PRECOMP
#endif
extern "C"
{
struct hostent *gethostbyname(const char *name);
+ int gethostname(char *name, int namelen);
};
#endif
h_ent = gethostbyaddr((char *)&(m_addr->sin_addr), sizeof(m_addr->sin_addr),
GetFamily());
- return wxString(h_ent->h_name);
+
+ if (!h_ent)
+ return wxString("");
+ else
+ return wxString(h_ent->h_name);
}
unsigned short wxIPV4address::Service()
*m_addr = *(struct sockaddr_un *)addr;
}
#endif
+
+#endif
+ // wxUSE_SOCKETS