libgpg-error on Windows: strerror_s can be used instead of strerror_r
Closed, ResolvedPublic



I am trying to build libgpg-error 1.36 on Windows, using MSYS2 + mingw-w64. Looking at configure output, it is mentioned that strerror_r is not available. So I would like to mention that strerror_s exists and is the Windows function equivalent to strerror_r on Unix (not the GNU variant). See

the only thing which is different is the order of the arguments

Would it be possible to add support of strerror_s on Windows ?

I think that some code like :

#ifdef _WIN32
#define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)

should be sufficient

thank you


vtorri created this task.May 24 2019, 1:19 PM
werner triaged this task as Normal priority.May 24 2019, 3:19 PM
werner added a project: gpgrt.
werner added a subscriber: werner.

I guess we can do that. Thanks for the hint.

gniibe claimed this task.May 29 2019, 3:54 AM
gniibe added a subscriber: gniibe.

I think that detecting strerror_s by configure is better, because it's a new feature on Windows.

gniibe changed the task status from Open to Testing.May 29 2019, 4:19 AM

Fix pushed.

werner closed subtask T4772: Release libgpg-error 1.37 as Resolved.
werner closed this task as Resolved.