[core] Keep declarations unconditional to fix clang-tidy

component.h is included before defines.h in application.h,
so the #ifdef guards on declarations were evaluated before the
define was visible. Keep declarations always visible (harmless
unused declarations cost nothing) and only guard the definitions.
This commit is contained in:
J. Nick Koston
2026-02-18 13:28:53 -06:00
parent 6b7258c828
commit e4af9efa4e

View File

@@ -109,9 +109,7 @@ class Component {
float get_actual_setup_priority() const;
#ifdef USE_SETUP_PRIORITY_OVERRIDE
void set_setup_priority(float priority);
#endif
/** priority of loop(). higher -> executed earlier
*
@@ -564,9 +562,8 @@ class WarnIfComponentBlockingGuard {
Component *component_;
};
#ifdef USE_SETUP_PRIORITY_OVERRIDE
// Function to clear setup priority overrides after all components are set up
// Only has an implementation when USE_SETUP_PRIORITY_OVERRIDE is defined
void clear_setup_priority_overrides();
#endif
} // namespace esphome