From b8612c719fc09f2d9b86b6a1f64dc16c8f4a1ab7 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 20 Aug 2021 11:01:35 -0400 Subject: [PATCH] Fix two -Wunreachable-code-aggressive warnings on Fuchsia Bug: chromium:1066980 Change-Id: Id2cf1a88b39019c26118d0440976695e15aacdad Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229620 Reviewed-by: Mirko Bonadei Commit-Queue: Nico Weber Cr-Commit-Position: refs/heads/master@{#34816} --- rtc_base/cpu_time.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/rtc_base/cpu_time.cc b/rtc_base/cpu_time.cc index b95bcb136e..a8e542b5a2 100644 --- a/rtc_base/cpu_time.cc +++ b/rtc_base/cpu_time.cc @@ -38,6 +38,10 @@ const int64_t kNanosecsPerFiletime = 100; namespace rtc { int64_t GetProcessCpuTimeNanos() { +#if defined(WEBRTC_FUCHSIA) + RTC_LOG_ERR(LS_ERROR) << "GetProcessCpuTimeNanos() not implemented"; + return 0; +#else #if defined(WEBRTC_LINUX) struct timespec ts; if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) { @@ -66,18 +70,20 @@ int64_t GetProcessCpuTimeNanos() { } else { RTC_LOG_ERR(LS_ERROR) << "GetProcessTimes() failed."; } -#elif defined(WEBRTC_FUCHSIA) - RTC_LOG_ERR(LS_ERROR) << "GetProcessCpuTimeNanos() not implemented"; - return 0; #else // Not implemented yet. static_assert( false, "GetProcessCpuTimeNanos() platform support not yet implemented."); #endif return -1; +#endif // defined(WEBRTC_FUCHSIA) } int64_t GetThreadCpuTimeNanos() { +#if defined(WEBRTC_FUCHSIA) + RTC_LOG_ERR(LS_ERROR) << "GetThreadCpuTimeNanos() not implemented"; + return 0; +#else #if defined(WEBRTC_LINUX) struct timespec ts; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) { @@ -111,15 +117,13 @@ int64_t GetThreadCpuTimeNanos() { } else { RTC_LOG_ERR(LS_ERROR) << "GetThreadTimes() failed."; } -#elif defined(WEBRTC_FUCHSIA) - RTC_LOG_ERR(LS_ERROR) << "GetThreadCpuTimeNanos() not implemented"; - return 0; #else // Not implemented yet. static_assert( false, "GetThreadCpuTimeNanos() platform support not yet implemented."); #endif return -1; +#endif // defined(WEBRTC_FUCHSIA) } } // namespace rtc