Fix compilation for LWIP_EVENT_API

Without LWIP_CALLBACK_API, is no error callback function pointer in
the TCP PCB, nor is it needed, so do not attempt to access it.
This commit is contained in:
David van Moolenbroek 2016-08-07 16:20:49 +00:00 committed by goldsimon
parent fa8797b86d
commit fc66fb830c

View File

@ -1094,7 +1094,9 @@ tcp_slowtmr_start:
/* If the PCB should be removed, do it. */ /* If the PCB should be removed, do it. */
if (pcb_remove) { if (pcb_remove) {
struct tcp_pcb *pcb2; struct tcp_pcb *pcb2;
#if LWIP_CALLBACK_API
tcp_err_fn err_fn; tcp_err_fn err_fn;
#endif /* LWIP_CALLBACK_API */
void *err_arg; void *err_arg;
tcp_pcb_purge(pcb); tcp_pcb_purge(pcb);
/* Remove PCB from tcp_active_pcbs list. */ /* Remove PCB from tcp_active_pcbs list. */
@ -1112,7 +1114,9 @@ tcp_slowtmr_start:
pcb->local_port, pcb->remote_port); pcb->local_port, pcb->remote_port);
} }
#if LWIP_CALLBACK_API
err_fn = pcb->errf; err_fn = pcb->errf;
#endif /* LWIP_CALLBACK_API */
err_arg = pcb->callback_arg; err_arg = pcb->callback_arg;
pcb2 = pcb; pcb2 = pcb;
pcb = pcb->next; pcb = pcb->next;