[issue20596] Support for alternate wcstok syntax for Windows compilers

STINNER Victor report at bugs.python.org
Wed Feb 12 10:46:04 CET 2014


STINNER Victor added the comment:

I don't think that "#ifdef MS_WINDOWS" is very useful, you can drop it. So get something simpler:

/* Portable macro for wcstok(): on Windows, it is not thread-safe, the state
 * argument is ignored, except if Visual Studio is used. */
#ifdef _MSC_VER
#  define Py_WCSTOK(str, tok, state)  wcstok_s(str, tok, state)
#elif defined(MS_WINDOWS) && !defined(__WATCOMC__)
#  define Py_WCSTOK(str, tok, state)  wcstok(str, tok)
#else
#  define Py_WCSTOK(str, tok, state)  wcstok(str, tok, state)
#endif

But I don't like "#elif defined(MS_WINDOWS) && !defined(__WATCOMC__)": what are the other compilers on Windows which provide wcstok() with 2 parameters?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20596>
_______________________________________


More information about the Python-bugs-list mailing list