Skip to content

Commit

Permalink
Do not use strtold with WASI
Browse files Browse the repository at this point in the history
The symbol is not available.
  • Loading branch information
thewtex committed Feb 6, 2023
1 parent 7403921 commit b3446f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/CLI/TypeTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,12 @@ bool lexical_cast(const std::string &input, T &output) {
return false;
}
char *val = nullptr;
#ifdef __wasi__
// Symbol missing
auto output_ld = std::strtod(input.c_str(), &val);
#else
auto output_ld = std::strtold(input.c_str(), &val);
#endif
output = static_cast<T>(output_ld);
return val == (input.c_str() + input.size());
}
Expand Down

0 comments on commit b3446f4

Please sign in to comment.