From d812683df111ff16897a829e33f612d54e6be550 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 24 Feb 2026 09:49:07 -0600 Subject: [PATCH] Use platform build flags in lwip_fast_select.c guard USE_ESP32 and USE_LIBRETINY are compiler flags (-D) always available to .c files. USE_LWIP_FAST_SELECT is in the generated defines.h which may not be force-included for .c files on all build systems. Use platform flags directly in the .c file; .cpp/.h files continue using USE_LWIP_FAST_SELECT from the generated defines. --- esphome/core/lwip_fast_select.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/core/lwip_fast_select.c b/esphome/core/lwip_fast_select.c index 16ee1be34e..b6a4ac2961 100644 --- a/esphome/core/lwip_fast_select.c +++ b/esphome/core/lwip_fast_select.c @@ -104,7 +104,10 @@ // critical sections). Multiple concurrent xTaskNotifyGive calls are safe — // the notification count simply increments. -#ifdef USE_LWIP_FAST_SELECT +// USE_ESP32 and USE_LIBRETINY are build flags (-D), always available to .c files. +// USE_LWIP_FAST_SELECT is in the generated defines.h (force-included for .cpp but +// may not reach .c files on all build systems), so we use platform flags here. +#if defined(USE_ESP32) || defined(USE_LIBRETINY) // LwIP headers must come first — they define netconn_callback, struct lwip_sock, etc. #include @@ -221,4 +224,4 @@ void esphome_lwip_wake_main_loop(void) { } } -#endif // USE_LWIP_FAST_SELECT +#endif // defined(USE_ESP32) || defined(USE_LIBRETINY)