A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026742.html below:

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

[Python-Dev] Is __declspec(dllexport) really needed on Windows? [Python-Dev] Is __declspec(dllexport) really needed on Windows?Mark Hammond mhammond@skippinet.com.au
Fri, 19 Jul 2002 09:15:46 +1000
Fredrik:
> greg wrote:
>
> > Someone told me that Pyrex should be generating
> > __declspec(dllexport) for the module init func.
>
> almost; for portability, it's better to use the DL_EXPORT
> provided by Python.h:
>
> DL_EXPORT(void)
> init_module(void)
> {
>     ...
> }
>
> > But someone else says this is only needed if
> > you're importing a dll as a library, and that
> > it's not needed for Python extensions.

FWIW, www.python.org/sf/566100 deprecates DL_IMPORT/DL_EXPORT as it is
broken!  Once this patch is checked in, the new blessed way to declare your
function will be:

PyMODINIT_FUNC init_module(void)
{
...
}

This macro will do the right thing in all situations and for all platforms.
It even provides the 'extern "C"' if your extension is in a C++ module.

The-patch-even-updates-the-doc ly,

Mark.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4