Exports in _runtime_swig.pyd

I’m still trying to understand the build-process and internals of
GnuRadio. While trying to build the Swig .pyd modules, I notice that
gnuradio-runtime/swig/runtime_swig.i has a:
#define GR_RUNTIME_API

Thus functions/vars in _runtime_swig.pyd gets a dllexport linkage.
But comparing to gnuradio-runtime/swig/pmt_swig.i there is no
PMT_API at the top. Why the difference?

–gv

I wrote:

Thus functions/vars in _runtime_swig.pyd gets a dllexport linkage.
But comparing to gnuradio-runtime/swig/pmt_swig.i there is no
PMT_API at the top. Why the difference?

Further to the problem I had with linking in the Swig code for this:
extern const pmt_t PMT_T; (in pmt_swig.i)

This may work fine with the GNU linker, but MSVC needs explicit
dllimport. So I patched pmt_swig.i like this:

— pmt_swig.i.orig 2014-09-24 13:48:36 +0000
+++ pmt_swig.i 2014-10-19 14:51:19 +0000
@@ -80,11 +80,6 @@
swig_int_ptr.repr = lambda self: write_string(self)
%}

  • extern const pmt_t PMT_T;
  • extern const pmt_t PMT_F;
  • extern const pmt_t PMT_EOF;
  • pmt_t get_PMT_NIL();
    #define PMT_NIL get_PMT_NIL()

<pmt/pmt.h> already has the proper import decoration. No point declaring
those with ‘extern’. So now .py examples using _pmt_swig.pyd works just
fine.

I noted in the Ettus Gr installation, there where no _pmt_swig.pyd.
Maybe that’s due to the problem they had with link that on Windows.
Seems imposible w/o correct DLL-linkage.

–gv