[core] Fix std::isnan conflict with picolibc on ESP-IDF 6.0 (#14768)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jonathan Swoboda
2026-03-13 14:24:39 -04:00
committed by GitHub
parent bd844fcd0a
commit b147830ef9
+3
View File
@@ -589,7 +589,10 @@ async def _add_looping_components() -> None:
async def to_code(config: ConfigType) -> None:
cg.add_global(cg.global_ns.namespace("esphome").using)
# These can be used by user lambdas, put them to default scope
# picolibc (IDF 6.0+) declares isnan in global scope, conflicting with using std::isnan
cg.add_global(cg.RawStatement("#ifndef __PICOLIBC__"))
cg.add_global(cg.RawExpression("using std::isnan"))
cg.add_global(cg.RawStatement("#endif"))
cg.add_global(cg.RawExpression("using std::min"))
cg.add_global(cg.RawExpression("using std::max"))