Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on Emscripten #125

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/scn/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,11 @@ class strtod_impl_base : impl_base {
{
#if SCN_XLOCALE == SCN_XLOCALE_POSIX
static locale_t cloc = ::newlocale(LC_ALL_MASK, "C", NULL);
#ifdef __EMSCRIPTEN__
if constexpr (std::is_floating_point_v<T>) {
return static_cast<T>(::wcstold_l(str, str_end, cloc));
}
#else
if constexpr (std::is_same_v<T, float>) {
return ::wcstof_l(str, str_end, cloc);
}
Expand All @@ -859,6 +864,7 @@ class strtod_impl_base : impl_base {
else if constexpr (std::is_same_v<T, long double>) {
return ::wcstold_l(str, str_end, cloc);
}
#endif
#elif SCN_XLOCALE == SCN_XLOCALE_MSVC
static _locale_t cloc = ::_create_locale(LC_ALL, "C");
if constexpr (std::is_same_v<T, float>) {
Expand Down
Loading