[PATCH] P11-GLUE: Fix compatibility with WinXP

Pavel Aronsky pavel.aronsky at daynix.com
Sun Jun 22 12:34:54 PDT 2014


On Fri, Jun 20, 2014 at 2:48 PM, Stef Walter <stefw at redhat.com> wrote:

> On 16.06.2014 14:38, Pavel A. wrote:
> > From: Pavel A <pavel.aronsky at daynix.com>
> >
> > We propose this change in libp11-kit for compatibility with WinXP
> (32-bit).
> > Otherwise, libp11-kit-0.dll and all stuff using it would fail to load
> > because of missing import strerror_s.
> > Here is a bug report with a similar patch:
> > https://bugs.freedesktop.org/show_bug.cgi?id=76594#c1
>
> Is strerror() threadsafe on MSVC? If so could you post a link which
> documents this. We can add it to the commit message when merging this.
>
> Thanks,
>
> Stef
>
>
Yes, it seems to be thread safe. The source of strerror() is available with
Visual Studio.
It uses a thread-local static buffer. Disassembly of msvcrt.dll on WinXP
shows
exactly the same.

Obviously, strerror_s is cleaner and faster, as it does not use static
buffer at all. We could provide complete strerror_s implementation for
WinXP,
but that would be too long and complex for the purpose.

( By the way, MinGW now recommends specifying the minimal Windows
version for the application via the NTDDI_VERSION macro - exactly as for
native
Windows apps. See the NEWS file in mingw source for details )

With best regards,
Pavel A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/p11-glue/attachments/20140622/09d3164f/attachment.html>


More information about the p11-glue mailing list