On Tue, Mar 16, 2010 at 5:49 PM, Tobias C. Rittweiler <span dir="ltr"><<a href="mailto:tcr@freebits.de">tcr@freebits.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So I'm wondering about Windows. FElibc_error is not conditionalized out<br>
on Windows -- so however ECL is build there, strerror(3) must be<br>
available there, too?<br>
<br>
I was about making EXT:STRERROR (the lisp function) expect an error code<br>
(as returned by GetLastError()) on Windows. Is errno used in Windows at<br>
all?<br clear="all"></blockquote></div><br>GetLastError() and strerror() are different functions. The former relates to internal calls and is used by FEwin32_error, while the latter provides error messages for the C library, and uses different error codes<br>
<br>strerror() is ANSI and is provided by Windows<br><a href="http://msdn.microsoft.com/en-us/library/aa272975%28VS.60%29.aspx">http://msdn.microsoft.com/en-us/library/aa272975%28VS.60%29.aspx</a><br>Since ECL expects at least an ANSIC C compiler there is no conditionalization<br>
<br>Given that strerror() is not thread safe, on Windows we may consider using instead an internal variable, _sys_errlist<br><a href="http://msdn.microsoft.com/en-us/library/aa246793%28VS.60%29.aspx">http://msdn.microsoft.com/en-us/library/aa246793%28VS.60%29.aspx</a><br>
and conditionally use strerror_r() on all other platforms.<br><br>But these are things I can add later on if you already have a prototype for strerror.<br><br>Juanjo<br><br>-- <br>Instituto de Física Fundamental, CSIC<br>
c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com">http://juanjose.garciaripoll.googlepages.com</a><br>