the dll interface. Using the dll interface does supposedly allow
for the function to be loaded more quickly though.
Here are a few other related things I've been able to verify:
This macro is not present in Python 3, so the __attribute__((dllimport)) specifier is not emitted
when the macro expands. After macros have been applied, the declaration is a plain extern declaration.
Linking against a function declared without the macro, even if it is included in a dll, works fine with mingw.
(It would be great if someone could confirm that on msvc as well).
In reading the code in Cython that generates these lines, I've noticed that
the fact that the DL_IMPORT and DL_EXPORT macros are no-ops in Python 3
is effecting the use of public declarations as well. It appears that the intent
was to make public functions available as a part of a dll interface, but that isn't the
case with Python 3. That makes me think it may be better to either remove calls
to these macros entirely or redefine them in the preamble for Cython files.
For what it's worth, I find the version without the macro closer to what I'd expect
Cython to output for an external declaration. When I write
cdef extern int foo(int a, int b)
I expect C code of the form
extern int foo(int, int);
and not (after macro expansion)
extern __attribute__((dllimport)) int foo(int, int);
The latter may load the function faster, but it requires that the
external function come from a dll and not a generic object file.