From a63271c77f7ee4802761535f8c844f789328ad9f Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 15 Jun 2016 12:56:38 -0700 Subject: Deal with to_string, proper usage of nullptr, and lack of map::emplace --- include/grpc++/impl/codegen/config.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') 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(x)); +} +inline grpc::string to_string(const unsigned int x) { + return std::to_string(static_cast(x)); +} +#else +using std::to_string; +#endif + } // namespace grpc #endif // GRPCXX_IMPL_CODEGEN_CONFIG_H -- cgit v1.2.3