mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
Another tweak.
This commit is contained in:
parent
609c48c2a2
commit
903c1f1c31
@ -32,7 +32,7 @@ template <typename T> char *to_string(T d, char *buffer) {
|
|||||||
void strtod_from_string(const char * st, float& d) {
|
void strtod_from_string(const char * st, float& d) {
|
||||||
char *pr = (char *)st;
|
char *pr = (char *)st;
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
d = cygwin_strtod_l(st, &pr, c_locale);
|
d = cygwin_strtod_l(st, &pr);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
||||||
d = _strtof_l(st, &pr, c_locale);
|
d = _strtof_l(st, &pr, c_locale);
|
||||||
|
|||||||
@ -123,7 +123,7 @@ std::pair<float, bool> strtof_from_string(char *st) {
|
|||||||
float d;
|
float d;
|
||||||
char *pr;
|
char *pr;
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
d = cygwin_strtod_l(st, &pr, c_locale);
|
d = cygwin_strtod_l(st, &pr);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
||||||
d = _strtof_l(st, &pr, c_locale);
|
d = _strtof_l(st, &pr, c_locale);
|
||||||
|
|||||||
@ -86,7 +86,7 @@ template <>
|
|||||||
void strtod_from_string(const std::string &st, float& d) {
|
void strtod_from_string(const std::string &st, float& d) {
|
||||||
char *pr = (char *)st.data();
|
char *pr = (char *)st.data();
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
d = cygwin_strtod_l(st, &pr, c_locale);
|
d = cygwin_strtod_l(st, &pr);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
static _locale_t c_locale = _create_locale(LC_ALL, "C");
|
||||||
d = _strtof_l(st.data(), &pr, c_locale);
|
d = _strtof_l(st.data(), &pr, c_locale);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user