aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/impl/codegen/config.h')
-rw-r--r--include/grpc++/impl/codegen/config.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h
index cf88efa1d1..0c75438868 100644
--- a/include/grpc++/impl/codegen/config.h
+++ b/include/grpc++/impl/codegen/config.h
@@ -54,6 +54,7 @@
// nullptr was added in gcc 4.6
#if (__GNUC__ * 100 + __GNUC_MINOR__ < 406)
#define GRPC_CXX0X_NO_NULLPTR 1
+#define GRPC_CXX0X_LIMITED_TOSTRING 1
#endif
// final and override were added in gcc 4.7
#if (__GNUC__ * 100 + __GNUC_MINOR__ < 407)
@@ -116,6 +117,17 @@ namespace grpc {
typedef GRPC_CUSTOM_STRING string;
+#ifdef GRPC_CXX0X_LIMITED_TOSTRING
+inline grpc::string to_string(const int x) {
+ return std::to_string(static_cast<const long long int>(x));
+}
+inline grpc::string to_string(const unsigned int x) {
+ return std::to_string(static_cast<const long long unsigned int>(x));
+}
+#else
+using std::to_string;
+#endif
+
} // namespace grpc
#endif // GRPCXX_IMPL_CODEGEN_CONFIG_H