From cd49ee71887cb2e7f2ca422fbc5c28f4bd92b3ca Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 29 May 2019 11:09:05 +0900 Subject: Detect to use strerror_s. * configure.ac [mingw32*] (strerror_s): Detect. * src/strerror.c [HAVE_STRERROR_S] (system_strerror_r): Use strerror_s. -- GnuPG-bug-id: 4539 Signed-off-by: NIIBE Yutaka --- src/strerror.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/strerror.c') diff --git a/src/strerror.c b/src/strerror.c index b0efb3d..4cce17f 100644 --- a/src/strerror.c +++ b/src/strerror.c @@ -96,8 +96,16 @@ system_strerror_r (int no, char *buf, size_t buflen) } #endif /* STRERROR_R_CHAR_P */ +#elif defined (HAVE_STRERROR_S) +/* Now the Windows version. */ -#else /* HAVE_STRERROR_H */ +static int +system_strerror_r (int no, char *buf, size_t buflen) +{ + return strerror_s (buf, buflen, no); +} + +#else /* ! HAVE_STRERROR_R && ! HAVE_STRERROR_S */ /* Without strerror_r(), we can still provide a non-thread-safe version. Maybe we are even lucky and the system's strerror() is already thread-safe. */ -- cgit v1.2.3