Skip to content

Commit 3343b56

Browse files
committed
Fix modular build
1 parent 4825215 commit 3343b56

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

include/zenoh-pico/api/handlers.h

+21
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@
115115
/* elem_copy_f */ _z_##item_name##_rc_copy, \
116116
/* elem_drop_f */ z_##item_name##_drop)
117117

118+
#define _Z_CHANNEL_DEFINE_DUMMY(item_name, kind_name) \
119+
typedef struct { \
120+
} z_owned_##kind_name##_handler_##item_name##_t; \
121+
typedef struct { \
122+
} z_loaned_##kind_name##_handler_##item_name##_t; \
123+
void *z_##kind_name##_handler_##item_name##_loan(); \
124+
void *z_##kind_name##_handler_##item_name##_move(); \
125+
void *z_##kind_name##_handler_##item_name##_drop(); \
126+
void *z_##kind_name##_handler_##item_name##_recv(); \
127+
void *z_##kind_name##_handler_##item_name##_try_recv();
128+
118129
// This macro defines:
119130
// z_ring_channel_sample_new()
120131
// z_owned_ring_handler_sample_t/z_loaned_ring_handler_sample_t
@@ -125,6 +136,7 @@ _Z_CHANNEL_DEFINE(sample, ring)
125136
// z_owned_fifo_handler_sample_t/z_loaned_fifo_handler_sample_t
126137
_Z_CHANNEL_DEFINE(sample, fifo)
127138

139+
#if Z_FEATURE_QUERYABLE == 1
128140
// This macro defines:
129141
// z_ring_channel_query_new()
130142
// z_owned_ring_handler_query_t/z_loaned_ring_handler_query_t
@@ -134,7 +146,12 @@ _Z_CHANNEL_DEFINE(query, ring)
134146
// z_fifo_channel_query_new()
135147
// z_owned_fifo_handler_query_t/z_loaned_fifo_handler_query_t
136148
_Z_CHANNEL_DEFINE(query, fifo)
149+
#else // Z_FEATURE_QUERYABLE
150+
_Z_CHANNEL_DEFINE_DUMMY(query, ring)
151+
_Z_CHANNEL_DEFINE_DUMMY(query, fifo)
152+
#endif // Z_FEATURE_QUERYABLE
137153

154+
#if Z_FEATURE_QUERY == 1
138155
// This macro defines:
139156
// z_ring_channel_reply_new()
140157
// z_owned_ring_handler_reply_t/z_loaned_ring_handler_reply_t
@@ -144,5 +161,9 @@ _Z_CHANNEL_DEFINE(reply, ring)
144161
// z_fifo_channel_reply_new()
145162
// z_owned_fifo_handler_reply_t/z_loaned_fifo_handler_reply_t
146163
_Z_CHANNEL_DEFINE(reply, fifo)
164+
#else // Z_FEATURE_QUERY
165+
_Z_CHANNEL_DEFINE_DUMMY(reply, ring)
166+
_Z_CHANNEL_DEFINE_DUMMY(reply, fifo)
167+
#endif // Z_FEATURE_QUERY
147168

148169
#endif // INCLUDE_ZENOH_PICO_API_HANDLERS_H

0 commit comments

Comments
 (0)