[Distutils] DEF Files

Mark Hammond mhammond@skippinet.com.au
Wed, 15 Sep 1999 09:15:57 +1000


[Marc writes]

> Interesting. The DL_EXPORT macro must be new. I hacked up my
> own because previously there was no explicit way to say "export
> this symbol", only "import this symbol" via DL_IMPORT (and export
> it under some other conditions).

It has been around for as long as I have :-)  In fact, I prompted
Guido to include it when I first tackled the Windows port - he had
similar issues on other OS' even then, so did not object (actually -
there may have already been part of the scheme in place even then)

> Perhaps I should move back to using the Python macros instead
> of mine.

Except they serve a slightly different purpose - they indicate the
linkage for Python function - ie, when building Python DL_EXPORT is
defined as "__declspec(dlexport)", otherwise defined as
"__declspec(dlimport)".  Thus, when building mxTools, you are not
building Python itself, so this will resolve to "dlimport", which is
clearly not what you want.

For my extensions I simply use my own macros with the same intent - as
you are already doing, and sa you will probably need to continue to
do.

Mark.