[issue4846] Py_UNICODE_ISSPACE causes linker error

Marc-Andre Lemburg report at bugs.python.org
Mon Jan 5 20:49:40 CET 2009


Marc-Andre Lemburg <mal at egenix.com> added the comment:

On 2009-01-05 18:54, Alexander Belopolsky wrote:
> I also wonder whether it would be more appropriate to redefine PyAPI_* 
> macros to declare API symbols with extern "C" when compiled under C++?  
> This seems to be a better approach than cluttering all header files with 
> #ifdef __cplusplus and worrying about the scope of extern "C" {} 
> wrappers.

This is standard practice, but of course has to be done with some
care.

In general, only macro and type definitions should live outside
the extern "C" sections, #includes must live outside those sections.

Changing the PyAPI_* macros would help with this, but I'm not sure whether
that's a catch-all solution. If it's not, then it's better to stick
with the extern "C" sections.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4846>
_______________________________________


More information about the Python-bugs-list mailing list