[Patches] [ python-Patches-566100 ] Rationalize DL_IMPORT and DL_EXPORT
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 07 Jun 2002 22:14:57 -0700
Patches item #566100, was opened at 2002-06-08 15:14
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=566100&group_id=5470
Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: Rationalize DL_IMPORT and DL_EXPORT
Initial Comment:
Tim and I agreed that DL_IMPORT/DL_EXPORT is both sucky
and broken. We have come up with purpose oriented
macros to replace them.
PyAPI_FUNC: public Python functions
PyAPI_DATA: public Python data
PyMODINIT_FUNC: extension module init functions.
These cover all existing cases of DL_IMPORT and
DL_EXPORT in the core.
This patch simply introduces the new macros (keeping
the old ones), and changes a small amount of code to
actually use these macros. The vast majority of the
existing Python code using DL_IMPORT/DL_EXPORT has not
been touched.
I have a patch that changes the following:
* PC/pyconfig.h - creates the new PyAPI/MODINIT macros,
but also rationalizes this header file considerably.
All common macros between the various compilers have
been moved to a common section. This simplifies the
header significantly.
* Include/pyport.h - creates the new PyAPI/MODINIT
macros for non windows platforms.
* Include/import.h - move to the new macros. I picked
this header file at random, mainly to prove that the
new macros do indeed work.
* PC/_winreg.c, Modules/_sre.c, Modules/pyexpat.c -
move to the PyMODINIT_FUNC macro.
Patch tested on Windows and Linux.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=566100&group_id=5470