[Nut-upsdev] [nut-commits] svn commit r2853 - in branches/windows_port: drivers include
Frédéric Bohé
fredericbohe at eaton.com
Thu Jan 27 09:17:16 UTC 2011
On mer., 2011-01-26 at 16:48 +0100, Arjen de Korte wrote:
> Citeren Frederic BOHE <fbohe-guest at alioth.debian.org>:
>
> > Modified: branches/windows_port/include/wincompat.h
> > ==============================================================================
> > --- branches/windows_port/include/wincompat.h Wed Jan 26 15:05:16
> > 2011 (r2852)
> > +++ branches/windows_port/include/wincompat.h Wed Jan 26 15:16:09
> > 2011 (r2853)
> > @@ -28,6 +28,7 @@
> > #include "common.h"
> >
> > #define sleep(n) Sleep(1000 * n)
> > +#define strtok_r(a,b,c) strtok(a,b)
> >
> > /* Network compatibility */
>
> You probably want to use
>
> > +#define strtok_r(a,b,c) strtok_s(a,b,c)
strtok_s is not supported by MinGW.
> here. I'm not sure that never tokenize multiple strings at the same
> time (in which case using strtok() would severely break).
I have not seen any breakage for the moment. But you are right,
re-considering the note in the MSDN's strtok documentation, it seems
that WIN32 strtok is thread safe but not reentrant.
So I think I will try to implement my own strtok_r function.
Regards,
Fred
--------------------------------------------------------------------------
More information about the Nut-upsdev
mailing list