[issue20596] Support for alternate wcstok syntax for Windows compilers

2019-05-19 Thread Erik Janssens
Erik Janssens added the comment: The same issue was handled in bpo-35890 -- pull_requests: +13329 ___ Python tracker ___ ___ Python

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-11-09 Thread Jeffrey Armstrong
Change by Jeffrey Armstrong : -- nosy: -Jeffrey.Armstrong ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-11-09 Thread Erik Janssens
Erik Janssens added the comment: @serhiy.storchaka Are you suggesting the discrimination should be based on compiler specific defines, or rather that it should go through configuration (a HAVE_WCSTOK_S pyconfig.h) ? -- ___ Python tracker

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: wcstok_s is an optional part of C11 and can be available in other compilers. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf#%5B%7B%22num%22%3A1401%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C0%2C792%2C0%5D -- versions: +Python 3.8

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-11-01 Thread Erik Janssens
Erik Janssens added the comment: I created a github pull request based on the last patch of Jeffrey Armstrong. Since mingw now also has a wcstok_s function, the discrimination between wcstok/wcstok_s is now based on MS_WINDOWS being defined, as was the case in Modules/main.c. Is this correc

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-11-01 Thread Erik Janssens
Change by Erik Janssens : -- pull_requests: +9597 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue20596] Support for alternate wcstok syntax for Windows compilers

2018-08-04 Thread Erik Janssens
Erik Janssens added the comment: Would anyone mind if I create a new issue to reflect the current situation and create a PR to handle it with a Py_WCSTOK ? -- nosy: +erikjanss ___ Python tracker ___

[issue20596] Support for alternate wcstok syntax for Windows compilers

2015-05-17 Thread Jeffrey Armstrong
Changes by Jeffrey Armstrong : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-10-12 Thread R. David Murray
R. David Murray added the comment: Moving this back to 'patch review' stage since there's a new patch that hasn't been reviewed. Perhaps this 'ping' will result in someone doing the review (so, no, the issue isn't dead, just sleeping :) -- nosy: +r.david.murray stage: commit review ->

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-03-09 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: I didn't receive any feedback on the last patch from 2014-02-12. Is this issue effectively dead? -- ___ Python tracker ___

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: I've included a revised patch that is far simpler than the others I've proposed. In this example, the preprocess checks for MSVC or Borland/Embarcadero and, if found, uses three-argument wcstok_s(). If neither is detected, it checks for MinGW and, if foun

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: I know that Borland/Embarcadero also uses the two-argument version like Microsoft. As I said earlier, MinGW uses the two-argument version, although it is currently marked as deprecated. Just from searching, it appears that Pelles C/LCC uses the POSIX-like

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread STINNER Victor
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

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But perhaps it would be better to increase indent to 4 spaces in consistency with other indented code in this file. -- stage: -> commit review ___ Python tracker ___

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: Based on the comments thus far, I've gone ahead with another version of this patch. Py_WCSTOK is now defined regardless of OS. For Windows, it chooses between MSVC's wcstok_s, Open Watcom's wcstok, and MinGW's/misc's two-argument wcstok. If the platform

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread STINNER Victor
STINNER Victor added the comment: wcstok() is available on other platforms like Linux. You may also define the constant for these platforms, no? On Linux, it has 3 parameters: wchar_t *wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **ptr); You should explain that the macro may ignore the th

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The code can be a little more clear if use indentation in preprocessor directives: #ifdef MS_WINDOWS # ifdef _MSC_VER # define Py_WCSTOK(x,y,z) wcstok_s(x,y,z) # else # ifdef __WATCOMC__ # define Py_WCSTOK(x,y,z) wcstok(x,y,z) # else # define Py_WCST

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: I've replaced the patch with a newer version that defines Py_WCSTOK in Include/pyport.h as Victor suggested. -- Added file: http://bugs.python.org/file34045/wcstok.default.patch ___ Python tracker

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread STINNER Victor
STINNER Victor added the comment: IMO your WCSTOK macro should be called Py_WCSTOK and moved to Include/pyport.h, so you can use it in Modules/main.c (please use Unicode for environment variables on Windows). -- nosy: +haypo ___ Python tracker

[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-11 Thread Jeffrey Armstrong
New submission from Jeffrey Armstrong: In two locations, the current interpreter code makes some assumptions concerning the syntax of the wcstok() function based solely on the operating system (Windows, in this case). Compilers other than MSVC may (and do) provide alternative wcstok() syntaxe