aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-06-15 12:56:38 -0700
committerGravatar Vijay Pai <vpai@google.com>2016-06-15 12:56:38 -0700
commita63271c77f7ee4802761535f8c844f789328ad9f (patch)
treeb4f7525f453771dc45f5690b8f7431ed92b33187 /include
parent12bf3801b8dd298a2cfd89f45499d5f681e27ed6 (diff)
Deal with to_string, proper usage of nullptr, and lack of map::emplace
Diffstat (limited to 'include')
-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