diff --git a/Misc/NEWS.d/next/Build/2026-11-30-12-00-00.gh-issue-161198.YmQ9sK.rst b/Misc/NEWS.d/next/Build/2026-11-30-12-00-00.gh-issue-161198.YmQ9sK.rst new file mode 100644 index 00000000000000..1c76158db178a4 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-11-30-12-00-00.gh-issue-161198.YmQ9sK.rst @@ -0,0 +1 @@ +Fix a build failure on Cygwin when ``strerror_r()`` uses the GNU return type. diff --git a/Python/fileutils.c b/Python/fileutils.c index 3ea0f59f69ad1e..3359b1abae3f51 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -3319,7 +3319,7 @@ _Py_strerror(int code) // Check which strerror_r() API is used # if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L) && !defined(_GNU_SOURCE)) # define Py_STRERROR_R_GNU -# elif defined(__ANDROID__) && defined(_GNU_SOURCE) +# elif (defined(__ANDROID__) || defined(__CYGWIN__)) && defined(_GNU_SOURCE) # define Py_STRERROR_R_GNU # endif #endif