From ec67538be0eb8d08bf0f09421268ff65f1c49b05 Mon Sep 17 00:00:00 2001 From: Nexoniarz Date: Tue, 20 Oct 2026 20:14:47 +0200 Subject: [PATCH] Mac: settings' numbers read with strtof (Apple's library has no float from_chars before macOS 26), as on Android Co-Authored-By: Claude Opus 5.5 --- engine/core/cvar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/core/cvar.cpp b/engine/core/cvar.cpp index 6251834..acc2f26 100644 --- a/engine/core/cvar.cpp +++ b/engine/core/cvar.cpp @@ -31,7 +31,9 @@ Cvar::~Cvar() { std::erase(cvars(), this); } void Cvar::set(std::string_view value) { value_ = value; -#if defined(__ANDROID__) // (the NDK's library has no float from_chars; bionic's locale is always "C") +// (The NDK's library, and Apple's before macOS 26, have no float from_chars. strtof reads the +// "C" locale's way: the program never sets another.) +#if defined(__ANDROID__) || defined(__APPLE__) const std::string text(value); char* end = nullptr; const float parsed = std::strtof(text.c_str(), &end);