<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 20, 2014 at 2:48 PM, Stef Walter <span dir="ltr"><<a href="mailto:stefw@redhat.com" target="_blank">stefw@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 16.06.2014 14:38, Pavel A. wrote:<br>
> From: Pavel A <<a href="mailto:pavel.aronsky@daynix.com">pavel.aronsky@daynix.com</a>><br>
><br>
> We propose this change in libp11-kit for compatibility with WinXP (32-bit).<br>
> Otherwise, libp11-kit-0.dll and all stuff using it would fail to load<br>
> because of missing import strerror_s.<br>
> Here is a bug report with a similar patch:<br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=76594#c1" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=76594#c1</a><br>
<br>
</div>Is strerror() threadsafe on MSVC? If so could you post a link which<br>
documents this. We can add it to the commit message when merging this.<br>
<br>
Thanks,<br>
<br>
Stef<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Yes, it seems to be thread safe. The source of strerror() is available with Visual Studio.</div><div class="gmail_extra">It uses a thread-local static buffer. Disassembly of msvcrt.dll on WinXP shows</div>
<div class="gmail_extra">exactly the same. </div><div class="gmail_extra"><br></div><div class="gmail_extra">Obviously, strerror_s is cleaner and faster, as it does not use static</div><div class="gmail_extra">buffer at all. We could provide complete strerror_s implementation for WinXP,</div>
<div class="gmail_extra">but that would be too long and complex for the purpose.</div><div class="gmail_extra"><br></div><div class="gmail_extra">( By the way, MinGW now recommends specifying the minimal Windows</div><div class="gmail_extra">
version for the application via the NTDDI_VERSION macro - exactly as for native</div><div class="gmail_extra">Windows apps. See the NEWS file in mingw source for details )</div><div class="gmail_extra"><br></div><div class="gmail_extra">
With best regards,</div><div class="gmail_extra">Pavel A.</div><div class="gmail_extra"><br></div></div>