From 171368154b0ee561637b5f69c8226d15a50912c8 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Sun, 18 Aug 2024 23:16:04 +0200 Subject: [PATCH] Allow compiling with TCP=0, PING=0 Add missing guards around non-existing symbols when those modules are compiled out. Fixes builds with TCP=0, PING=0. --- stack/pico_socket.c | 2 ++ stack/pico_stack.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stack/pico_socket.c b/stack/pico_socket.c index 7c73b90f..748f2d48 100644 --- a/stack/pico_socket.c +++ b/stack/pico_socket.c @@ -1635,9 +1635,11 @@ int pico_socket_fionread(struct pico_socket *s) return f->payload_len; } #endif +#ifdef PICO_SUPPORT_TCP else if (PROTO(s) == PICO_PROTO_TCP) { return pico_tcp_queue_in_size(s); } +#endif return 0; } diff --git a/stack/pico_stack.c b/stack/pico_stack.c index 0b0af739..1da14ac8 100644 --- a/stack/pico_stack.c +++ b/stack/pico_stack.c @@ -896,7 +896,9 @@ int MOCKABLE pico_stack_init(struct pico_stack **S) #ifdef PICO_SUPPORT_ICMP4 pico_protocol_init(*S, &pico_proto_icmp4); ATTACH_QUEUES(*S, icmp4, pico_proto_icmp4); +#ifdef PICO_SUPPORT_PING EMPTY_TREE((*S)->Pings, pico_icmp4_cookie_compare); +#endif EMPTY_TREE((*S)->ICMP4Sockets, icmp4_socket_cmp); #endif