-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
We were recently porting some code from Linux to Windows and ran into a difficult issue.
Some of the Windows system headers transitively include objbase.h, which contains the line
#define interface struct
If Zenoh is included after these, compilation may fail due to lines such as the following:
zenoh-cpp/include/zenoh/api/shm/provider/shm_provider.hxx
Lines 36 to 44 in 4038337
| static void drop(void* context) { | |
| auto interface = static_cast<ShmProviderAsyncInterface*>(context); | |
| delete interface; | |
| } | |
| static void result(void* context, struct z_buf_layout_alloc_result_t* result) { | |
| auto interface = static_cast<ShmProviderAsyncInterface*>(context); | |
| interface->on_result(Converters::from(*result)); | |
| } |
In this case interface is interpreted as struct and the line cannot be parsed correctly.
Our solution was to undefine and redefine interface before and after the inclusion of Zenoh, however a minor change to the name of the variables in these and similar cases would remove the issue for future users and save some difficult troubleshooting.
To reproduce
- Be on Windows
- Include
oojbase.hbeforezenoh.hxx
System info
- Platform: Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working