Skip to content

Fix build with Apple libc++ lacking floating-point std::from_chars#1160

Open
daeho-ro wants to merge 1 commit into
BehaviorTree:masterfrom
daeho-ro:fix/apple-libcxx-from-chars-float
Open

Fix build with Apple libc++ lacking floating-point std::from_chars#1160
daeho-ro wants to merge 1 commit into
BehaviorTree:masterfrom
daeho-ro:fix/apple-libcxx-from-chars-float

Conversation

@daeho-ro

@daeho-ro daeho-ro commented Jul 7, 2026

Copy link
Copy Markdown

Apple's libc++ deletes floating-point std::from_chars (and undefines
__cpp_lib_to_chars), so the unguarded double parse in xml_parsing.cpp
fails to compile on macOS.

Guard it like the other numeric conversions and fall back to std::stod,
keeping the strict full-string validation. Backward-compatible; compile-only
fix (no unit test).

The double branch of the XML attribute parser called std::from_chars
unconditionally. Apple's libc++ ships integer from_chars but deletes the
floating-point overload (and undefines __cpp_lib_to_chars), so this fails
to compile on macOS.

Guard it like the other numeric conversions and fall back to std::stod
under the "C" locale, keeping the strict full-string validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant