From 092170941c6a69cbc3a113b098940b4c03b448c2 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Sat, 28 Nov 2015 13:08:39 +0100 Subject: [PATCH] Added better android support. Added Android NDK support. --- src/json.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/json.hpp b/src/json.hpp index 1e3cd11..e878295 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -70,6 +70,25 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation. using ssize_t = SSIZE_T; #endif +#ifdef __ANDROID__ + // Workaround for Android NDK builds (version r10e) that does not support std::to_string and std::strold so far + namespace std + { + template + std::string to_string(T Value) + { + std::ostringstream TempStream; + TempStream << Value; + return TempStream.str(); + } + + inline long double strtold(const char * str, char ** str_end) + { + return strtod(str, str_end); + } + } +#endif + /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann -- 2.5.0.windows.1