Issue 22579: Posix module init function name should not be compiler-dependent (original) (raw)

Created on 2014-10-08 13:26 by Jeffrey.Armstrong, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
posix_init.patch Jeffrey.Armstrong,2014-10-08 13:26 Patch to check for MS_WINDOWS when determining name of posix module's init function
Messages (6)
msg228789 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2014-10-08 13:26
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.
msg228861 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-09 11:50
The patch looks good to me, but I would prefer that someone else double check.
msg228908 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-09 20:41
There is also #if !defined(__QNX__) #if defined(MS_WINDOWS) | defined(__BORLANDC__)
msg228911 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-09 21:08
I would remove the "| defined(__BORLANDC__)
msg228914 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-09 21:17
> I would remove the "| defined(__BORLANDC__)
msg228929 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-09 22:14
Ok, I pushed the change: --- changeset: 92900:c7adad17f663 user: Victor Stinner <victor.stinner@gmail.com> date: Fri Oct 10 00:09:47 2014 +0200 files: Modules/posixmodule.c Closes #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 #22592 "Drop support of Borland C compiler". See also the issue #22591 for MS-DOS.
History
Date User Action Args
2022-04-11 14:58:08 admin set github: 66769
2014-10-09 22:14:23 vstinner set status: open -> closedresolution: fixedmessages: +
2014-10-09 22:06:10 Arfrever set nosy: + Arfrever
2014-10-09 21:17:07 vstinner set messages: +
2014-10-09 21:08:11 pitrou set messages: +
2014-10-09 20:41:01 georg.brandl set nosy: + georg.brandlmessages: +
2014-10-09 11:50:08 vstinner set versions: + Python 3.5, - Python 3.4nosy: + loewis, vstinner, pitroumessages: + components: + Windows
2014-10-08 13:26:55 Jeffrey.Armstrong create