build: Emulate std::to_string when it is missing

Change-Id: I4a08cf4abe7a2064a0c53d29582cbb761a1d131f
Refs: #2743
diff --git a/common.hpp b/common.hpp
index aac1580..ff9aa2a 100644
--- a/common.hpp
+++ b/common.hpp
@@ -57,6 +57,7 @@
 #include <unordered_map>
 #include <unordered_set>
 #include <vector>
+#include <string>
 
 #include <ndn-cxx/common.hpp>
 #include <ndn-cxx/interest.hpp>
@@ -110,4 +111,17 @@
 
 } // namespace nfd
 
+// Some platforms are missing std::to_string (issue #2743)
+#ifndef HAVE_STD_TO_STRING
+namespace std {
+template<typename V>
+inline std::string
+to_string(const V& v)
+{
+  return boost::lexical_cast<std::string>(v);
+}
+} // namespace std
+#endif // HAVE_STD_TO_STRING
+
+
 #endif // NFD_COMMON_HPP