Skip to content

Commit

Permalink
fix: compilation error when attachment is off
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Apr 26, 2024
1 parent a41d2db commit 8198aa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ z_bytes_t z_query_parameters(const z_query_t *query);
*/
z_value_t z_query_value(const z_query_t *query);

#if Z_FEATURE_ATTACHMENT == 1
/**
* Get a query's attachment value by aliasing it.
* Note: This API has been marked as unstable: it works as advertised, but we may change it in a future release.
Expand All @@ -537,6 +538,7 @@ z_value_t z_query_value(const z_query_t *query);
* Returns the attachment wrapped as a :c:type:`z_attachment_t`, since attachment is a user-defined representation.
*/
z_attachment_t z_query_attachment(const z_query_t *query);
#endif

/**
* Get a query's key by aliasing it.
Expand Down
2 changes: 2 additions & 0 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ z_bytes_t z_query_parameters(const z_query_t *query) {

z_value_t z_query_value(const z_query_t *query) { return query->_val._rc.in->val._value; }

#if Z_FEATURE_ATTACHMENT == 1
z_attachment_t z_query_attachment(const z_query_t *query) { return query->_val._rc.in->val.attachment; }
#endif

z_keyexpr_t z_query_keyexpr(const z_query_t *query) { return query->_val._rc.in->val._key; }

Expand Down
2 changes: 2 additions & 0 deletions src/session/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ int8_t _z_trigger_subscriptions(_z_session_t *zn, const _z_keyexpr_t keyexpr, co
sub->in->val._callback(&s, sub->in->val._arg);
xs = _z_subscription_rc_list_tail(xs);
}
#if Z_FEEATURE_ATTACHMENT == 1
_z_attachment_drop(&s.attachment);
#endif
_z_keyexpr_clear(&key);
_z_subscription_rc_list_free(&subs);
} else {
Expand Down

0 comments on commit 8198aa8

Please sign in to comment.