Skip to content

Commit 2cebc12

Browse files
committed
Fix for Android
1 parent eb23db2 commit 2cebc12

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎Modules/posixmodule.c‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13923,9 +13923,17 @@ static PyObject *
1392313923
os_strerror_impl(PyObject *module, int code)
1392413924
/*[clinic end generated code: output=baebf09fa02a78f2 input=75a8673d97915a91]*/
1392513925
{
13926-
#if (defined(_Py_HAVE_STRERROR_R) && defined(__GLIBC__) \
13927-
&& !((_POSIX_C_SOURCE >= 200112L) && !defined(_GNU_SOURCE)))
13928-
// Implementation for the glibc GNU flavor of strerror_r()
13926+
#ifdef _Py_HAVE_STRERROR_R
13927+
// Check which strerror_r() API is used
13928+
# if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L) && !defined(_GNU_SOURCE))
13929+
# define Py_STRERROR_R_GNU
13930+
# elif defined(__ANDROID__) && defined(_GNU_SOURCE)
13931+
# define Py_STRERROR_R_GNU
13932+
# endif
13933+
#endif
13934+
13935+
#ifdef Py_STRERROR_R_GNU
13936+
// Implementation for the GNU flavor of strerror_r()
1392913937

1393013938
// On Linux, the longest translated strerror() message is 86 bytes
1393113939
// (including the NUL byte).

0 commit comments

Comments
 (0)