Skip to content

Commit

Permalink
Allow compiling with TCP=0, PING=0
Browse files Browse the repository at this point in the history
Add missing guards around non-existing symbols when those
modules are compiled out.

Fixes builds with TCP=0, PING=0.
  • Loading branch information
danielinux committed Aug 18, 2024
1 parent cd6ec86 commit 1713681
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stack/pico_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions stack/pico_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1713681

Please sign in to comment.