pothosware / gr-pothos

Pothos bindings for GNU Radio blocks
https://github.com/pothosware/gr-pothos/wiki
GNU General Public License v3.0
12 stars 1 forks source link

Rename __block to __orig_block to avoid OS X build issues #2

Closed EvanKrall closed 8 years ago

EvanKrall commented 8 years ago

My compiler seems to have a __block defined in some built-in headers, which breaks compilation of the templated wrapper code produced by the gr-pothos build process:

/Users/meatmanek/Dropbox/code/gr-pothos/build/zeromq_wrapper.cc:85:18: error: expected unqualified-id
    auto __block = pull_msg_source::make(address, timeout);
                 ^
/Users/meatmanek/Dropbox/code/gr-pothos/build/zeromq_wrapper.cc:86:45: error: expected expression
    auto __pothos_block = makeGrPothosBlock(__block);
                                            ^
<built-in>:42:17: note: expanded from here
#define __block __attribute__((__blocks__(byref)))

I'm pretty sure this is an Objective-C++ thing.

This patch simply renames the variable used in the template to avoid the conflict. Maybe there's a better way, like disabling Objective C++ support in the build, but I'm not familiar enough with CMake to make that patch.

guruofquality commented 8 years ago

Thats interesting. I don't think its worth trying to figure this out this with special compiler flags. A simple rename feels like the right idea. I probably just picked __block with the underscores in the first place to avoid an accidental clash. Oh well :-)