libgpg-error on Windows: strerror_s can be used instead of strerror_r
Testing, NormalPublic



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


Related Objects

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.Wed, May 29, 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.Wed, May 29, 4:19 AM

Fix pushed.