From d2a9b6da13d84e9e9cb75b56e0adc365a35b0ee0 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Sat, 25 Jul 2015 00:56:33 +0000 Subject: [PATCH] Isolate nullptr to grpc namespace when we must define it ourselves Change the one non-namespace use of nullptr to NULL (used as an argument to a C function anyway) --- include/grpc++/config.h | 2 ++ test/cpp/qps/timer.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 1362c0a1fa8..889dc39eb7b 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -79,6 +79,7 @@ #ifdef GRPC_CXX0X_NO_NULLPTR #include +namespace grpc { const class { public: template @@ -98,6 +99,7 @@ const class { private: void operator&() const = delete; } nullptr = {}; +} #endif #ifndef GRPC_CUSTOM_STRING diff --git a/test/cpp/qps/timer.cc b/test/cpp/qps/timer.cc index 07289f699bf..c1ba23decd9 100644 --- a/test/cpp/qps/timer.cc +++ b/test/cpp/qps/timer.cc @@ -52,7 +52,7 @@ static double time_double(struct timeval* tv) { Timer::Result Timer::Sample() { struct rusage usage; struct timeval tv; - gettimeofday(&tv, nullptr); + gettimeofday(&tv, NULL); getrusage(RUSAGE_SELF, &usage); Result r;