From e08fb4946fa118e83250fe56fc867a05939433f6 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 23 Dec 2024 13:02:56 +0100 Subject: [PATCH] pkg/tinydtls: fix compilation with sock_async When module `sock_async` is used but `sock_async_event` is not, compilation previously failed. This fixes the issue. --- pkg/tinydtls/contrib/sock_dtls.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/tinydtls/contrib/sock_dtls.c b/pkg/tinydtls/contrib/sock_dtls.c index f305c97439..f03fe6df52 100644 --- a/pkg/tinydtls/contrib/sock_dtls.c +++ b/pkg/tinydtls/contrib/sock_dtls.c @@ -1063,13 +1063,13 @@ void sock_dtls_set_cb(sock_dtls_t *sock, sock_dtls_cb_t cb, void *cb_arg) { sock->async_cb = cb; sock->async_cb_arg = cb_arg; - if (IS_USED(MODULE_SOCK_ASYNC_EVENT)) { - sock_async_ctx_t *ctx = sock_dtls_get_async_ctx(sock); - if (ctx->queue) { - sock_udp_event_init(sock->udp_sock, ctx->queue, _udp_cb, sock); - return; - } +#if MODULE_SOCK_ASYNC_EVENT + sock_async_ctx_t *ctx = sock_dtls_get_async_ctx(sock); + if (ctx->queue) { + sock_udp_event_init(sock->udp_sock, ctx->queue, _udp_cb, sock); + return; } +#endif sock_udp_set_cb(sock->udp_sock, _udp_cb, sock); }