From: Stefan Krah Date: Sun, 22 May 2016 15:35:34 +0000 (+0200) Subject: Issue #26857: The gethostbyaddr_r() workaround is no longer needed with X-Git-Tag: v3.6.0a2~240 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f9eb879d573454cd3ea321993e72ad2cca65c9d;p=thirdparty%2FPython%2Fcpython.git Issue #26857: The gethostbyaddr_r() workaround is no longer needed with api-level >= 23. Patch by Xavier de Gaye. --- diff --git a/Include/pyport.h b/Include/pyport.h index 66e00d4e6dd0..8b0a89f249cf 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -897,4 +897,8 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler; #endif /* _MSC_VER >= 1900 */ #endif /* Py_BUILD_CORE */ +#ifdef __ANDROID__ +#include +#endif + #endif /* Py_PYPORT_H */ diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 46eeed1ab9c2..dc57810a0792 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -163,7 +163,11 @@ if_indextoname(index) -- return the corresponding interface name\n\ # include #endif -#if !defined(WITH_THREAD) || defined(__ANDROID__) +#if !defined(WITH_THREAD) +# undef HAVE_GETHOSTBYNAME_R +#endif + +#if defined(__ANDROID__) && __ANDROID_API__ < 23 # undef HAVE_GETHOSTBYNAME_R #endif