From 07348527c9e83e3db083a6b4d2f76b181649253d Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:28:25 +0800 Subject: [PATCH] fix impl strtod_l --- 3party/fmt/CMakeLists.txt | 1 + 3party/fmt/fmt/posix.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/3party/fmt/CMakeLists.txt b/3party/fmt/CMakeLists.txt index d99babd..887f7bd 100644 --- a/3party/fmt/CMakeLists.txt +++ b/3party/fmt/CMakeLists.txt @@ -93,6 +93,7 @@ if (WIN32) else () check_symbol_exists(open fcntl.h HAVE_OPEN) endif () +check_symbol_exists(strtod_l stdlib.h HAVE_STRTOD_L) add_subdirectory(fmt) diff --git a/3party/fmt/fmt/posix.h b/3party/fmt/fmt/posix.h index 88512de..f829799 100644 --- a/3party/fmt/fmt/posix.h +++ b/3party/fmt/fmt/posix.h @@ -327,6 +327,10 @@ class Locale { static double strtod_l(const char *nptr, char **endptr, _locale_t locale) { return _strtod_l(nptr, endptr, locale); } +# elif !defined(HAVE_STRTOD_L) + static double strtod_l(const char *nptr, char **endptr, locale_t) { + return atof(nptr); + } # endif locale_t locale_;