[Patches] [Patch #101061] pyport.h and extern "C"

noreply@sourceforge.net noreply@sourceforge.net
Thu, 10 Aug 2000 08:44:26 -0700


Patch #101061 has been updated. 

Project: 
Category: core (C code)
Status: Accepted
Summary: pyport.h and extern "C" 

Follow-Ups:

Date: 2000-Aug-03 06:56
By: htrd

Comment:
An existing comment in this file says...

some C++ #include's don't like to be included
     inside an extern "C"

....however numerous standard #includes were inside that extern "C". This patch just reorders a few things, so all the #includes are at the top, outside the extern "C".

-------------------------------------------------------

Date: 2000-Aug-06 13:48
By: marangoz

Comment:
What exactly breaks with the current setup that is solved by this patch?
-------------------------------------------------------

Date: 2000-Aug-07 01:16
By: htrd

Comment:
Various standard headers are #included inside a....
#ifdef __cplusplus
extern "C" {
#endif

If pyport.h is included inside a C++ program then those standard headers might enable various C++-specific extensions, which might fail inside an extern "C"

Specifically in MSVC 6 this leads to....

e:\program files\microsoft visual studio\vc98\include\math.h(514) : error C2894: templates cannot be declared to have 'C' linkage


-------------------------------------------------------

Date: 2000-Aug-10 08:44
By: marangoz

Comment:
Ok, understood. Assigned to marangoz, Status: Accepted.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101061&group_id=5470