mirror of
https://github.com/Nexoniarz/Fry3DX.git
synced 2026-11-03 04:24:26 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
707e0b62e5
commit
ec67538be0
1 changed files with 3 additions and 1 deletions
|
|
@ -31,7 +31,9 @@ Cvar::~Cvar() { std::erase(cvars(), this); }
|
||||||
|
|
||||||
void Cvar::set(std::string_view value) {
|
void Cvar::set(std::string_view value) {
|
||||||
value_ = 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);
|
const std::string text(value);
|
||||||
char* end = nullptr;
|
char* end = nullptr;
|
||||||
const float parsed = std::strtof(text.c_str(), &end);
|
const float parsed = std::strtof(text.c_str(), &end);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue