mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 08:38:39 +00:00
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.
This commit is contained in:
@@ -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 <lwip/api.h>
|
||||
@@ -221,4 +224,4 @@ void esphome_lwip_wake_main_loop(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // USE_LWIP_FAST_SELECT
|
||||
#endif // defined(USE_ESP32) || defined(USE_LIBRETINY)
|
||||
|
||||
Reference in New Issue
Block a user