mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:57:00 +02:00
Fixed locale problems with cgltf.h
This commit is contained in:
parent
8661e8a858
commit
4b9ddbc260
1 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,19 @@
|
||||||
#ifndef hifi_GLTFSerializer_h
|
#ifndef hifi_GLTFSerializer_h
|
||||||
#define hifi_GLTFSerializer_h
|
#define hifi_GLTFSerializer_h
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
inline float atof_locale_independent(char *str) {
|
||||||
|
//TODO: Once we have C++17 we can use std::from_chars
|
||||||
|
std::istringstream streamToParse(str);
|
||||||
|
streamToParse.imbue(std::locale("C"));
|
||||||
|
float value = 0.0f;
|
||||||
|
streamToParse >> value;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CGLTF_ATOF(str) atof_locale_independent(str)
|
||||||
|
|
||||||
#include "cgltf.h"
|
#include "cgltf.h"
|
||||||
|
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
|
Loading…
Reference in a new issue