summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/core-files.cmake1
-rw-r--r--include/mbgl/util/string.hpp16
-rw-r--r--src/mbgl/util/string.cpp20
3 files changed, 24 insertions, 13 deletions
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake
index 481145a0a2..98200900d5 100644
--- a/cmake/core-files.cmake
+++ b/cmake/core-files.cmake
@@ -516,6 +516,7 @@ set(MBGL_CORE_FILES
src/mbgl/util/std.hpp
src/mbgl/util/stopwatch.cpp
src/mbgl/util/stopwatch.hpp
+ src/mbgl/util/string.cpp
src/mbgl/util/thread.hpp
src/mbgl/util/thread_context.cpp
src/mbgl/util/thread_context.hpp
diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp
index 202554c3a7..de061647b5 100644
--- a/include/mbgl/util/string.hpp
+++ b/include/mbgl/util/string.hpp
@@ -4,8 +4,6 @@
#include <cassert>
#include <exception>
-#include <mbgl/util/dtoa.hpp>
-
namespace mbgl {
namespace util {
@@ -22,17 +20,9 @@ inline std::string toString(uint8_t num) {
return std::to_string(unsigned(num));
}
-inline std::string toString(float num) {
- return dtoa(num);
-}
-
-inline std::string toString(double num) {
- return dtoa(num);
-}
-
-inline std::string toString(long double num) {
- return dtoa(num);
-}
+std::string toString(float);
+std::string toString(double);
+std::string toString(long double);
inline std::string toString(std::exception_ptr error) {
assert(error);
diff --git a/src/mbgl/util/string.cpp b/src/mbgl/util/string.cpp
new file mode 100644
index 0000000000..4738209382
--- /dev/null
+++ b/src/mbgl/util/string.cpp
@@ -0,0 +1,20 @@
+#include <mbgl/util/string.hpp>
+#include <mbgl/util/dtoa.hpp>
+
+namespace mbgl {
+namespace util {
+
+std::string toString(float num) {
+ return dtoa(num);
+}
+
+std::string toString(double num) {
+ return dtoa(num);
+}
+
+std::string toString(long double num) {
+ return dtoa(num);
+}
+
+} // namespace util
+} // namespace mbgl