X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1eddcfafba914bff0c9674985d5c8a7205a741c6..84c188148d287017b052ea034e54ebce7d9993e6:/src/common/sckaddr.cpp diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index f3a3f48026..e83aa78b2f 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -55,6 +55,13 @@ #include #include +#ifdef __SUN__ +extern "C" +{ + struct hostent *gethostbyname(const char *name); +}; +#endif + #endif // __UNIX__ #include "wx/sckaddr.h" @@ -188,7 +195,11 @@ wxString wxIPV4address::Hostname() 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()