Message240153
Within Modules/posixmodule.c:4914 (in 3.5.0a3), the preprocessor checks for compiler macros as such:
#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__)
result = mkdir(path->narrow);
#else
result = mkdir(path->narrow, mode);
#endif
The purpose of the code was to detect if we're compiling using Watcom, but not on QNX, or VisualAge as our compiler, where mkdir() wouldn't accept a mode. However, Watcom supports Linux as well and properly implements the mode argument, causing the compilation to fail.
The proper check, rather than looking for "!defined(__QNX__)" would be "!defined(__UNIX__)," which would allow the code to properly compile using Watcom on either Linux or QNX:
#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__UNIX__)
result = mkdir(path->narrow);
#else
result = mkdir(path->narrow, mode);
#endif
FYI, in Watcom, the __UNIX__ macro is defined on both Linux and QNX, so this change will not break code for people who are still using Watcom to build Python for QNX (which is probably nobody at all).
There are two other places where the __QNX__ macro should be replaced in Modules/posixmodule.c, and the attached patch fixes both. |
|
Date |
User |
Action |
Args |
2015-04-06 12:41:15 | Jeffrey.Armstrong | set | recipients:
+ Jeffrey.Armstrong |
2015-04-06 12:41:15 | Jeffrey.Armstrong | set | messageid: <1428324075.5.0.672514551353.issue23876@psf.upfronthosting.co.za> |
2015-04-06 12:41:15 | Jeffrey.Armstrong | link | issue23876 messages |
2015-04-06 12:41:15 | Jeffrey.Armstrong | create | |
|