[Python-Dev] microsoft dlls apparently don't support data. implications: PyAPI functions required to access data across modules.

Curt Hagenlocher curt at hagenlocher.org
Sun Jan 25 18:03:31 CET 2009


On Sun, Jan 25, 2009 at 9:01 AM, Matthieu Brucher
<matthieu.brucher at gmail.com> wrote:
> 2009/1/25 Luke Kenneth Casson Leighton <lkcl at lkcl.net>:
>> according to the wikipedia entry on dlls, dlls do not support data,
>> only functions.
>
> What do you mean by "not support data"? Having global data variables in a dll?
> In wikipedia, it is explicitely told that this is possible to have
> data (http://en.wikipedia.org/wiki/Dynamic-link_library). Without
> them, shared library cannot be used.

Indeed.  That's why the header files contain
define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE
define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE

--
Curt Hagenlocher
curt at hagenlocher.org


More information about the Python-Dev mailing list