New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posix module init function name should not be compiler-dependent #66769
Comments
The determination of the name of the posix module's initialization function (at Modules/posixmodule.c:12055) is currently dependent on the compiler being used. For MSVC, Watcom, or Borland, the name is defined as "PyInit_nt." However, both Open Watcom and Borland have shipped compilers for GNU/Linux (and other platforms), making determining the posix module initialization function based on compiler incorrect. Most other places in Modules/posixmodule.c correctly use the "MS_WINDOWS" preprocessor definition to determine if Windows routines should be used. Naming the intialization function for the posix module should be dependent on this as well rather than compiler identifiers. Linking the interpreter natively with Open Watcom fails under GNU/Linux due to "PyInit_posix" being undefined. This occurs because of the reasons described above. The patch included corrects the issue. |
The patch looks good to me, but I would prefer that someone else double check. |
There is also #if !defined(__QNX__)
#if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__)
#define SEP L'\\'
#define ALTSEP L'/'
#define MAXPATHLEN 256
#define DELIM L';'
#endif
#endif |
I would remove the "|| defined(BORLANDC) || defined(WATCOMC) || defined(DJGPP)" part, since it's probably for MSDOS variants of those compilers. |
I agree, but IMO it is unrelated to this issue. Jeffrey wants to support a new C compiler (OpenWatcom) on Windows, not drop support of MS-DOS or old C compiler. I created the issue bpo-22591 to drop support of MS-DOS specific code. |
Ok, I pushed the change: Closes bpo-22579: Fix posixmodule.c to support any C compiler on Windows Oh, I forgot to mention that Jeffrey Armstrong wrote it, sorry :-( I created the issue bpo-22592 "Drop support of Borland C compiler". See also the issue bpo-22591 for MS-DOS. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: