aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLUtil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/SkSLUtil.h')
-rw-r--r--src/sksl/SkSLUtil.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h
index efffaaec01..33611cde02 100644
--- a/src/sksl/SkSLUtil.h
+++ b/src/sksl/SkSLUtil.h
@@ -19,15 +19,11 @@ namespace SkSL {
// our own definitions of certain std:: functions, because they are not always present on Android
-std::string to_string(double value);
-
-std::string to_string(int32_t value);
-
-std::string to_string(uint32_t value);
-
-std::string to_string(int64_t value);
-
-std::string to_string(uint64_t value);
+template <typename T> std::string to_string(T value) {
+ std::stringstream buffer;
+ buffer << std::setprecision(std::numeric_limits<T>::digits10) << value;
+ return buffer.str();
+}
#if _MSC_VER
#define NORETURN __declspec(noreturn)