Message210935
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() syntaxes.
The first change in the attached patch changes a preprocessor check in Modules/main.c to determine if we're compiling with MSVC rather than just whether we're compiling with Windows. If so, it uses Windows's basic two-argument wcstok() function as it always has. If the compiler isn't MSVC, the code will now default to the Unix method of converting to ASCII first before tokenizing. This change is more sensible because the code should really be checking for the compiler's wcstok() capabilities, not what operating system Python is being compiled for.
The second change in the attached patch adds some new code to PC/getpathp.c to support alternate wcstok() syntax in the find_env_config_value() function. A preprocessor check will now determine if we're compiling for MSVC and, if so, default to the three-argument wcstok_s() function. If the almost-compatible Open Watcom compiler is detected, a three-argument, POSIX-like wcstok() function is used. If another compiler is detected, the original two-argument wcstok() is assumed to be adequate. |
|
Date |
User |
Action |
Args |
2014-02-11 13:03:36 | Jeffrey.Armstrong | set | recipients:
+ Jeffrey.Armstrong |
2014-02-11 13:03:36 | Jeffrey.Armstrong | set | messageid: <1392123816.37.0.457546149708.issue20596@psf.upfronthosting.co.za> |
2014-02-11 13:03:36 | Jeffrey.Armstrong | link | issue20596 messages |
2014-02-11 13:03:35 | Jeffrey.Armstrong | create | |
|