Use custom util instead of std::to_string.

std::to_string is not avcaliable on mingw.

--
MOS_MIGRATED_REVID=98923935
diff --git a/src/main/cpp/blaze_util.h b/src/main/cpp/blaze_util.h
index 9d53d7d..4cf6dc9 100644
--- a/src/main/cpp/blaze_util.h
+++ b/src/main/cpp/blaze_util.h
@@ -21,6 +21,7 @@
 
 #include <sys/types.h>
 
+#include <sstream>
 #include <string>
 #include <vector>
 
@@ -103,6 +104,16 @@
 bool CheckJavaVersionIsAtLeast(const string &jvm_version,
                                const string &version_spec);
 
+// Converts a project identifier to string.
+// Workaround for mingw where std::to_string is not implemented.
+// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015.
+template <typename T>
+string ToString(const T& value) {
+  std::ostringstream oss;
+  oss << value;
+  return oss.str();
+}
+
 }  // namespace blaze
 
 #endif  // BAZEL_SRC_MAIN_CPP_BLAZE_UTIL_H_