[Python-Dev] Looking for a DL_xxPORT macro export (original) (raw)

Mark Hammond MarkH@ActiveState.com
Sat, 26 Aug 2000 14:06:40 +1000


This is your basic Undocumented X-Platform Macro Hell, and I suppose the Windows build should be #define'ing USEDLEXPORT for these subprojects anyway (?), but if I don't hear a good reason for why both macros are used

This is a mess that should be cleaned up.

I take some blame for DL_IMPORT :-( Originally (and still, as far as I can tell), DL_IMPORT really means "Python symbol visible outside the core" - ie, any symbol a dynamic module or embedded application may ever need (documented, or not :-)

The "import" part of DL_IMPORT is supposed to be from the clients POV. These apps/extensions are importing these definitions.

This is clearly a poor choice of names, IMO, as the macro USE_DL_EXPORT changes the meaning from import to export, which is clearly confusing.

DL_EXPORT, on the other hand, seems to have grown while I wasnt looking :-) As far as I can tell:

The ironic thing is, that in Windows at least, DL_EXPORT is working the exact opposite of how we want it - when it is used for functions built into the core (eg, builting modules), these symbols do not need to be exported, but where it is used on extension modules, it fails to make them public.

So, as you guessed, we have the situation that we have 2 macros that given their names, are completely misleading :-(

I think that we should make the following change (carefully, of course :-)

Obviously, the names are up for grabs, but we should change the macros to what they really mean, and getting the correct behaviour shouldn't be a problem. I don't see any real cross-platform issues, as long as the macro reflects what it actually means!

Shall I check in the large number of files affected now?

Over-the-release-manager's-dead-body ly,

Mark.