#endif // __WINDOWS__
#if defined(__UNIX__)
-
#ifdef VMS
#include <socket.h>
#include <in.h>
#else
-#if defined(__FreeBSD__) || defined (__NetBSD__)
-#include <sys/types.h>
-#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
+#ifdef __SUN__
+extern "C"
+{
+ struct hostent *gethostbyname(const char *name);
+};
+#endif
+
#endif // __UNIX__
#include "wx/sckaddr.h"
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()