mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
use C locale instead of en_us.utf8
TODO: replace these with numFromString instead :P
This commit is contained in:
parent
4272b8b549
commit
2cd1a9ee26
3 changed files with 3 additions and 3 deletions
|
@ -151,7 +151,7 @@ Result<ModMetadata> ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs
|
|||
if (ver != "*") {
|
||||
double val = 0.0;
|
||||
errno = 0;
|
||||
if (std::setlocale(LC_NUMERIC, "en_US.utf8")) {
|
||||
if (std::setlocale(LC_NUMERIC, "C")) {
|
||||
val = std::strtod(ver.c_str(), nullptr);
|
||||
if (errno == ERANGE) {
|
||||
return Err("[mod.json] has invalid target GD version");
|
||||
|
|
|
@ -27,7 +27,7 @@ Num parseNumForInput(std::string const& str) {
|
|||
else if constexpr (std::is_same_v<Num, double>) {
|
||||
double val = 0.0;
|
||||
errno = 0;
|
||||
if (std::setlocale(LC_NUMERIC, "en_US.utf8")) {
|
||||
if (std::setlocale(LC_NUMERIC, "C")) {
|
||||
val = std::strtod(str.c_str(), nullptr);
|
||||
if (errno == 0) {
|
||||
return val;
|
||||
|
|
|
@ -22,7 +22,7 @@ static GLubyte parseInt(char const* str) {
|
|||
static GLubyte parseFloat(char const* str) {
|
||||
float val = 0.0f;
|
||||
errno = 0;
|
||||
if (std::setlocale(LC_NUMERIC, "en_US.utf8")) {
|
||||
if (std::setlocale(LC_NUMERIC, "C")) {
|
||||
val = std::strtof(str, nullptr);
|
||||
if (errno == 0) {
|
||||
return val;
|
||||
|
|
Loading…
Reference in a new issue