diff --git a/src/sksl/SkSLUtil.cpp b/src/sksl/SkSLUtil.cpp index 98e5fa4599..e93a953990 100644 --- a/src/sksl/SkSLUtil.cpp +++ b/src/sksl/SkSLUtil.cpp @@ -11,6 +11,9 @@ #define __STDC_FORMAT_MACROS #endif #include +#include +#include +#include namespace SkSL { @@ -60,7 +63,12 @@ int stoi(SkString s) { } double stod(SkString s) { - return atof(s.c_str()); + double result; + std::string str(s.c_str(), s.size()); + std::stringstream buffer(str); + buffer.imbue(std::locale::classic()); + buffer >> result; + return result; } long stol(SkString s) {