mirror of
https://github.com/esphome/esphome.git
synced 2026-06-05 18:58:47 +08:00
[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:
@@ -589,7 +589,10 @@ async def _add_looping_components() -> None:
|
|||||||
async def to_code(config: ConfigType) -> None:
|
async def to_code(config: ConfigType) -> None:
|
||||||
cg.add_global(cg.global_ns.namespace("esphome").using)
|
cg.add_global(cg.global_ns.namespace("esphome").using)
|
||||||
# These can be used by user lambdas, put them to default scope
|
# 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.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::min"))
|
||||||
cg.add_global(cg.RawExpression("using std::max"))
|
cg.add_global(cg.RawExpression("using std::max"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user