Skip to content

Commit 2a1f7f0

Browse files
committed
fix: transport: unicast: unused function warning
When compiling zenoh-pico with Z_FEATURE_MULTI_THREAD and Z_FEATURE_UNICAST_TRANSPORT enabled, while leaving Z_FEATURE_UNICAST_PEER disabled, the `_zp_unicast_process_peer_event` function will be defined but unused. Only compile the function, alongside its own additional helpers, if Z_FEATURE_UNICAST_PEER is enabled. Signed-off-by: Emil Dahl Juhl <[email protected]>
1 parent dcf3085 commit 2a1f7f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transport/unicast/read.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ z_result_t _zp_unicast_read(_z_transport_unicast_t *ztu, bool single_read) {
148148

149149
#if Z_FEATURE_MULTI_THREAD == 1 && Z_FEATURE_UNICAST_TRANSPORT == 1
150150

151+
#if Z_FEATURE_UNICAST_PEER == 1
151152
static z_result_t _z_unicast_handle_remaining_data(_z_transport_unicast_t *ztu, _z_transport_peer_unicast_t *peer,
152153
size_t extra_size, size_t *to_read, bool *message_to_process) {
153154
*message_to_process = false;
@@ -323,6 +324,7 @@ static z_result_t _zp_unicast_process_peer_event(_z_transport_unicast_t *ztu) {
323324
_z_transport_peer_mutex_unlock(&ztu->_common);
324325
return _Z_RES_OK;
325326
}
327+
#endif
326328

327329
void *_zp_unicast_read_task(void *ztu_arg) {
328330
_z_transport_unicast_t *ztu = (_z_transport_unicast_t *)ztu_arg;

0 commit comments

Comments
 (0)