From 01a43c04a5afa8e48364607de57ef7c80e22d1ea Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Sat, 15 Dec 2018 10:38:42 +0100 Subject: Fix feature detection for strerror_r Closes #44. --- c-api/compat-5.3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c index be7f87e..42b0a4b 100644 --- a/c-api/compat-5.3.c +++ b/c-api/compat-5.3.c @@ -28,8 +28,9 @@ #endif /* VC++ _fsopen for share-allowed file read */ #ifndef COMPAT53_HAVE_STRERROR_R -# if defined(__GLIBC__) || defined(_POSIX_VERSION) || defined(__APPLE__) || \ - (!defined (__MINGW32__) && defined(__GNUC__) && (__GNUC__ < 6)) +# if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \ + (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \ + defined(__APPLE__) # define COMPAT53_HAVE_STRERROR_R 1 # else /* none of the defines matched: define to 0 */ # define COMPAT53_HAVE_STRERROR_R 0 -- cgit v1.2.3-55-g6feb