[Python-Dev] Is __declspec(dllexport) really needed on Windows?

Gerhard Häring haering_python@gmx.de
Thu, 18 Jul 2002 21:28:51 +0200


* Greg Ewing <greg@cosc.canterbury.ac.nz> [2002-07-18 22:03 +1200]:
> Someone told me that Pyrex should be generating
> __declspec(dllexport) for the module init func.

That's wrong. You should be using DL_EXPORT instead, which will do the
right thing no matter which platform you're on: on Windows, it will
expand to __declspec(dllexport), iff you're compiling an extension
module (in contrast to compiling the Python core). I believe that on
Unix, it will expand to an empty string :-)

You also don't need any #ifdefs for win32 for setting ob_type, just set
them _only_ in your init function and leave them as NULL in the
declarations.

Gerhard
-- 
This sig powered by Python!
Außentemperatur in München: 14.3 °C      Wind: 1.9 m/s