This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: header file problems
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: jackjansen, nnorwitz, rwgk
Priority: normal Keywords:

Created on 2002-09-10 10:53 by rwgk, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-release22-maint-include-patches rwgk, 2002-09-24 04:56 Patches for four include files in the python-release22-maint CVS branch
Messages (6)
msg12336 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2002-09-10 10:53
In connection with the Boost.Python library we are 
having problems due to missing extern "C" in some 
header files. This has prompted me to systematically 
look at all header files on the release22-maint branch 
and on the CVS trunk. The summary is shown below.

The most severe problem are the missing extern "C" 
on the release-22-maint branch. Fortunately, this is 
fixed already on the CVS trunk. The next important 
problem is that the include guards are missing in 
pymactoolbox.h (both trunk and maint branch). I am 
not clear if there have to be include guards in files that 
only contain #defines (such as patchlevel.h) but 
having them would seem safer to me. Finally, the 
include guards in two files are not prefixed with Py_, 
Again, it would seem safter to me (reduce the chances 
of name clashes) if all Python include guards were 
consistently prefixed with Py_ .

Ralf


Python release22-maint cvs branch:

  extern "C" missing in:
    cStringIO.h
    descrobject.h
    iterobject.h

  include guards missing in:
    descrobject.h
    graminit.h
    iterobject.h
    patchlevel.h
    pymactoolbox.h
    (pyconfig.h)

  include guard does not start with "Py_":
    complexobject.h
    cStringIO.h

Python cvs head (Sep 9):

  include guards missing in:
    graminit.h
    patchlevel.h
    pymactoolbox.h
    (pyconfig.h)

  include guard does not start with "Py_":
    complexobject.h
    cStringIO.h
msg12337 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-09-10 12:34
Logged In: YES 
user_id=45365

I've added the include guard to pymactoolbox.h. I've also added include guards and extern "C" constructs (where needed) to the include files in Mac/Include. The other ones I leave to someone else, esp. because I'm not sure things like graminit.h  need them.
msg12338 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2002-09-24 04:56
Logged In: YES 
user_id=71407

Patches for python-release22-maint as requested by Tim 
and Guido.
msg12339 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-10-04 12:51
Logged In: YES 
user_id=33168

Backported the include guards/extern "C" for:
 * cStringIO.h 2.15.18.1
 * descrobject.h 2.8.8.1
 * iterobject.h 1.3.20.1
Fixed include guard prefix:
 * complexobject.h 2.11, 2.9.12.12.1
 * cStringIO.h 2.9, 2.15.18.2

I'm leaving open for now, so I can discuss adding include
guards for the other files (graminit.h, patchlevel.h,
pyconfig.h).
msg12340 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2002-10-10 19:48
Logged In: YES 
user_id=71407

Extensive tests using Python 2.2.2b1 on several platforms went 
without a problem. I suggest closing this bug report.
msg12341 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-10-11 13:10
Logged In: YES 
user_id=33168

From discussion on python-dev, there's not much to be gained
by adding multiple header protection for graminit.h,
patchlevel.h, and pyconfig.h.
History
Date User Action Args
2022-04-10 16:05:40adminsetgithub: 37160
2002-09-10 10:53:16rwgkcreate