diff options
-rw-r--r-- | include/grpc++/config.h | 2 | ||||
-rw-r--r-- | include/grpc++/time.h | 2 | ||||
-rw-r--r-- | src/cpp/util/time.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/client.h | 6 | ||||
-rw-r--r-- | test/cpp/qps/client_async.cc | 5 |
5 files changed, 11 insertions, 6 deletions
diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 55b2a64482..8d674efef8 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -46,7 +46,7 @@ #define GRPC_CXX0X_NO_OVERRIDE 1 #define GRPC_CXX0X_NO_CHRONO 1 #define GRPC_CXX0X_NO_THREAD 1 -#endif +#endif #endif // Visual Studio #ifndef __clang__ diff --git a/include/grpc++/time.h b/include/grpc++/time.h index 25c446429c..da22bca47a 100644 --- a/include/grpc++/time.h +++ b/include/grpc++/time.h @@ -85,7 +85,7 @@ namespace grpc { // from and to should be absolute time. void Timepoint2Timespec(const std::chrono::system_clock::time_point& from, gpr_timespec* to); -void Timepoint2Timespec(const std::chrono::high_resolution_clock::time_point& from, +void TimepointHR2Timespec(const std::chrono::high_resolution_clock::time_point& from, gpr_timespec* to); std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); diff --git a/src/cpp/util/time.cc b/src/cpp/util/time.cc index 83292e9338..beb58ef3f7 100644 --- a/src/cpp/util/time.cc +++ b/src/cpp/util/time.cc @@ -60,7 +60,7 @@ void Timepoint2Timespec(const system_clock::time_point& from, to->tv_nsec = nsecs.count(); } -void Timepoint2Timespec(const high_resolution_clock::time_point& from, +void TimepointHR2Timespec(const high_resolution_clock::time_point& from, gpr_timespec* to) { high_resolution_clock::duration deadline = from.time_since_epoch(); seconds secs = duration_cast<seconds>(deadline); diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index f028fc7c0f..7d75ed7d74 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -44,17 +44,19 @@ namespace grpc { -// Specialize Timepoint for high res clock as we need that +#if defined(__APPLE__) +// Specialize Timepoint for high res clock as we need that template <> class TimePoint<std::chrono::high_resolution_clock::time_point> { public: TimePoint(const std::chrono::high_resolution_clock::time_point& time) { - Timepoint2Timespec(time, &time_); + TimepointHR2Timespec(time, &time_); } gpr_timespec raw_time() const { return time_; } private: gpr_timespec time_; }; +#endif namespace testing { diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index e91a7a191c..e4ce93adb4 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -204,7 +204,7 @@ class AsyncClient : public Client { short_deadline = issue_allowed_[thread_idx] ? next_issue_[thread_idx] : deadline; } - + bool got_event; switch (cli_cqs_[thread_idx]->AsyncNext(&got_tag, &ok, short_deadline)) { @@ -215,6 +215,9 @@ class AsyncClient : public Client { case CompletionQueue::GOT_EVENT: got_event = true; break; + default: + GPR_ASSERT(false); + break; } if (grpc_time_source::now() > deadline) { // we have missed some 1-second deadline, which is too much gpr_log(GPR_INFO, "Missed an RPC deadline, giving up"); |