[issue11410] Use GCC visibility attrs in PyAPI_*

Thomas Wouters report at bugs.python.org
Sun Mar 6 22:36:09 CET 2011


Thomas Wouters <thomas at python.org> added the comment:

The cygwin changes are no-ops, just refactoring the needlessly nested if statement for clarity. I can revert them.

The getargs.c change *is* necessary, although it doesn't have to be that exact change. The problem is that the functions in that block are not declared in any file in Include/, although I don't know why not (it's true that these function shouldn't be called directly, but they are symbols that should be exported. The ifdef the patch removes makes the export happen only for Windows, but I see no reason to do that conditionally.) To be clear, the #define of (for example) PyArg_Parse to _PyArg_Parse_SizeT in Include/modsupport.h doesn't apply, because Python/getargs.c does not (and must not) define PY_SSIZE_T_CLEAN (or we wouldn't be able to define both PyArg_Parse and _PyArg_Parse_SizeT.)

We could just list these functions in Include/modsupport.h, along with the 'public' (non-PY_SSIZE_T_CLEAN) ones -- but that only makes sense if  we want code to call the ssize_t functions directly, which I don't think we want.

----------

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


More information about the Python-bugs-list mailing list