diff options
author | Eric Blossom | 2010-10-22 15:14:57 -0700 |
---|---|---|
committer | Eric Blossom | 2010-11-10 12:13:52 -0800 |
commit | 00ba420478fb0e328fa93e795ea0c80e7de63534 (patch) | |
tree | 6105bc503f7724117b5c38365de189cd0f83bf16 /gnuradio-core/src/lib | |
parent | b61a156d4d3125882bfa3563ebd4a992ba00a6f7 (diff) | |
download | gnuradio-00ba420478fb0e328fa93e795ea0c80e7de63534.tar.gz gnuradio-00ba420478fb0e328fa93e795ea0c80e7de63534.tar.bz2 gnuradio-00ba420478fb0e328fa93e795ea0c80e7de63534.zip |
Move #ifdef SWIGPYTHON outside of %define
There's apparently a time-of-evaluation issue here.
The docs say they reevaluate the contents of %define at expansion
time. Apparently SWIGPYTHON et al. aren't defined in whatever scope
that may be.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index 99e01b0ef..e2ddaeedd 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -24,22 +24,27 @@ _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, PKG ## _ ## BASE_NAME, BASE_NAME) %enddef -%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +%define _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) class NAME; typedef boost::shared_ptr<NAME> NAME ## _sptr; %template(NAME ## _sptr) boost::shared_ptr<NAME>; %rename(BASE_NAME) PKG ## _make_ ## BASE_NAME; +%ignore NAME; +%enddef #ifdef SWIGPYTHON +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) %pythoncode %{ NAME ## _sptr.block = lambda self: NAME ## _block (self) NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id ()) %} -#endif - -%ignore NAME; %enddef +#endif #ifdef SWIGGUILE +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) #warning "gr_block_sptr needs to be implemented!" +%enddef #endif |