Arjen de Korte
2011-Jan-26 15:48 UTC
[Nut-upsdev] [nut-commits] svn commit r2853 - in branches/windows_port: drivers include
Citeren Frederic BOHE <fbohe-guest op 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)here. I'm not sure that never tokenize multiple strings at the same time (in which case using strtok() would severely break). Best regards, Arjen -- Please keep list traffic on the list (off-list replies will be rejected)
Frédéric Bohé
2011-Jan-27 09:17 UTC
[Nut-upsdev] [nut-commits] svn commit r2853 - in branches/windows_port: drivers include
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 --------------------------------------------------------------------------
Maybe Matching Threads
- [nut-commits] svn commit r3554 - branches/windows_port/common
- [nut-commits] svn commit r2839 - branches/windows_port/scripts/Windows
- [nut-commits] svn commit r2705 - branches/windows_port/drivers
- [nut-commits] svn commit r2940 - in branches/windows_port/scripts/Windows/Installer
- cross-compiling the windows_port branch (socklen_t)