[Distutils] DEF Files

M.-A. Lemburg mal@lemburg.com
Wed, 15 Sep 1999 10:29:37 +0200


Mark Hammond wrote:
> 
> [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)

Well, I just did a grep over Python 1.5 and 1.5.2: the DL_EXPORT
macro is not defined in 1.5, only in 1.5.2. There is some
machinery in place to get the semantics you describe below.

In 1.5.2 there is a new DL_EXPORT macro defined in Include/Python.h
but it also uses the DL_IMPORT semantics... which are useless
for me since I am not building Python, but my own modules.

> > 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.

Ok. Thanks for the insight, Mark.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   107 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/