Skip to content

Commit

Permalink
Fix features definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Apr 11, 2024
1 parent 9d0c041 commit fbc65af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions include/zenoh-pico/api/handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
void _z_owned_sample_move(z_owned_sample_t *dst, const z_owned_sample_t *src);
z_owned_sample_t *_z_sample_to_owned_ptr(const _z_sample_t *src);

#if Z_FEATURE_QUERY == 1
// -- Queries handler
void _z_owned_query_move(z_owned_query_t *dst, const z_owned_query_t *src);
z_owned_query_t *_z_query_to_owned_ptr(const z_query_t *src);

// -- Reply handler
void _z_owned_reply_move(z_owned_reply_t *dst, const z_owned_reply_t *src);
z_owned_reply_t *_z_reply_clone(const z_owned_reply_t *src);
#endif // Z_FEATURE_QUERY

// -- Channel
#define _Z_CHANNEL_DEFINE(name, send_closure_name, recv_closure_name, send_type, recv_type, collection_type, \
Expand Down Expand Up @@ -103,7 +101,6 @@ _Z_CHANNEL_DEFINE(sample_fifo_channel, closure_sample, closure_owned_sample, con
_z_fifo_mt_t, _z_fifo_mt_new, _z_fifo_mt_free, _z_fifo_mt_push, _z_fifo_mt_pull, _z_fifo_mt_try_pull,
_z_owned_sample_move, _z_sample_to_owned_ptr, z_sample_drop)

#if Z_FEATURE_QUERY == 1
// z_owned_query_ring_channel_t
_Z_CHANNEL_DEFINE(query_ring_channel, closure_query, closure_owned_query, const z_query_t, z_owned_query_t,
_z_ring_mt_t, _z_ring_mt_new, _z_ring_mt_free, _z_ring_mt_push, _z_ring_mt_pull, _z_ring_mt_try_pull,
Expand All @@ -123,6 +120,5 @@ _Z_CHANNEL_DEFINE(reply_ring_channel, closure_reply, closure_reply, z_owned_repl
_Z_CHANNEL_DEFINE(reply_fifo_channel, closure_reply, closure_reply, z_owned_reply_t, z_owned_reply_t, _z_fifo_mt_t,
_z_fifo_mt_new, _z_fifo_mt_free, _z_fifo_mt_push, _z_fifo_mt_pull, _z_fifo_mt_try_pull,
_z_owned_reply_move, _z_reply_clone, z_reply_drop)
#endif // Z_FEATURE_QUERY

#endif // INCLUDE_ZENOH_PICO_API_HANDLERS_H
2 changes: 1 addition & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ z_owned_keyexpr_t z_publisher_keyexpr(z_publisher_t publisher) {
#endif

#if Z_FEATURE_QUERY == 1
OWNED_FUNCTIONS_PTR_RC(z_query_t, z_owned_query_t, query)
OWNED_FUNCTIONS_PTR_INTERNAL(z_reply_t, z_owned_reply_t, reply, _z_reply_free, _z_owner_noop_copy)

z_get_options_t z_get_options_default(void) {
Expand Down Expand Up @@ -913,6 +912,7 @@ z_value_t z_reply_err(const z_owned_reply_t *reply) {
#endif

#if Z_FEATURE_QUERYABLE == 1
OWNED_FUNCTIONS_PTR_RC(z_query_t, z_owned_query_t, query)
OWNED_FUNCTIONS_PTR_COMMON(z_queryable_t, z_owned_queryable_t, queryable)
OWNED_FUNCTIONS_PTR_CLONE(z_queryable_t, z_owned_queryable_t, queryable, _z_owner_noop_copy)
void z_queryable_drop(z_owned_queryable_t *val) { z_undeclare_queryable(val); }
Expand Down
4 changes: 3 additions & 1 deletion src/api/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ z_owned_sample_t *_z_sample_to_owned_ptr(const _z_sample_t *src) {
return dst;
}

#if Z_FEATURE_QUERY == 1
#if Z_FEATURE_QUERYABLE == 1
// -- Query
void _z_owned_query_move(z_owned_query_t *dst, const z_owned_query_t *src) {
memcpy(dst, src, sizeof(z_owned_query_t));
Expand All @@ -47,7 +47,9 @@ z_owned_query_t *_z_query_to_owned_ptr(const z_query_t *src) {
_z_query_rc_copy(&dst->_rc, &src->_val._rc);
return dst;
}
#endif // Z_FEATURE_QUERYABLE

#if Z_FEATURE_QUERY == 1
// -- Reply
void _z_owned_reply_move(z_owned_reply_t *dst, const z_owned_reply_t *src) {
memcpy(dst, src, sizeof(z_owned_reply_t));
Expand Down

0 comments on commit fbc65af

Please sign in to comment.