From d2c40ad8ebcbe32fe4c759ff1ac7bd792e6b9612 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 22 Apr 2026 05:50:20 +0200 Subject: [PATCH] [core] Collapse adjacent USE_HOST ifdef blocks in Application --- esphome/core/application.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index d3851a32da..971eb92109 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -489,9 +489,6 @@ class Application { #ifdef USE_HOST std::vector socket_fds_; // Vector of all monitored socket file descriptors #endif -#ifdef USE_HOST - int wake_socket_fd_{-1}; // Shared wake notification socket for waking main loop from tasks -#endif // StringRef members (8 bytes each: pointer + size) StringRef name_; @@ -507,7 +504,8 @@ class Application { #endif #ifdef USE_HOST - int max_fd_{-1}; // Highest file descriptor number for select() + int max_fd_{-1}; // Highest file descriptor number for select() + int wake_socket_fd_{-1}; // Shared wake notification socket for waking main loop from tasks #endif // 2-byte members (grouped together for alignment) @@ -524,9 +522,7 @@ class Application { #ifdef USE_HOST bool socket_fds_changed_{false}; // Flag to rebuild base_read_fds_ when socket_fds_ changes -#endif -#ifdef USE_HOST // Variable-sized members (not needed with fast select — is_socket_ready_ reads rcvevent directly) fd_set read_fds_{}; // Working fd_set: populated by select() fd_set base_read_fds_{}; // Cached fd_set rebuilt only when socket_fds_ changes