From 437af7bcffd311f5883b63b233505061f9e7f53b Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 19 Jan 2015 02:31:49 +0000 Subject: [PATCH] Fix building for wxQT-android with sockets enabled The bionic library on android does not have gethostbyname_r even though it has gethostbyname_r. The configure script in wxwidgets assumes if it has one it has the other. This change does the right thing for android, but perhaps the script should instead test for both? Thanks @seandepagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/sckaddr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 62badbc68b..e2649b3221 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -113,6 +113,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) // gethostbyname_r() and that it uses the similar conventions to it (see // comment in configure) #define HAVE_GETHOSTBYADDR HAVE_GETHOSTBYNAME + +#ifdef __ANDROID__ + #ifndef HAVE_GETHOSTBYNAME + #define HAVE_GETHOSTBYNAME + #endif +#else // these functions are missing on android (see netdb.h) #ifdef HAVE_FUNC_GETHOSTBYNAME_R_3 #define HAVE_FUNC_GETHOSTBYADDR_R_3 #endif @@ -122,7 +128,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) #ifdef HAVE_FUNC_GETHOSTBYNAME_R_6 #define HAVE_FUNC_GETHOSTBYADDR_R_6 #endif - +#endif // the _r functions need the extra buffer parameter but unfortunately its type // differs between different systems and for the systems which use opaque // structs for it (at least AIX and OpenBSD) it must be zero-filled before