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 <mbonadei@webrtc.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#34816}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
ea423a5b8d
commit
b8612c719f
@ -38,6 +38,10 @@ const int64_t kNanosecsPerFiletime = 100;
|
|||||||
namespace rtc {
|
namespace rtc {
|
||||||
|
|
||||||
int64_t GetProcessCpuTimeNanos() {
|
int64_t GetProcessCpuTimeNanos() {
|
||||||
|
#if defined(WEBRTC_FUCHSIA)
|
||||||
|
RTC_LOG_ERR(LS_ERROR) << "GetProcessCpuTimeNanos() not implemented";
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
#if defined(WEBRTC_LINUX)
|
#if defined(WEBRTC_LINUX)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) {
|
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) {
|
||||||
@ -66,18 +70,20 @@ int64_t GetProcessCpuTimeNanos() {
|
|||||||
} else {
|
} else {
|
||||||
RTC_LOG_ERR(LS_ERROR) << "GetProcessTimes() failed.";
|
RTC_LOG_ERR(LS_ERROR) << "GetProcessTimes() failed.";
|
||||||
}
|
}
|
||||||
#elif defined(WEBRTC_FUCHSIA)
|
|
||||||
RTC_LOG_ERR(LS_ERROR) << "GetProcessCpuTimeNanos() not implemented";
|
|
||||||
return 0;
|
|
||||||
#else
|
#else
|
||||||
// Not implemented yet.
|
// Not implemented yet.
|
||||||
static_assert(
|
static_assert(
|
||||||
false, "GetProcessCpuTimeNanos() platform support not yet implemented.");
|
false, "GetProcessCpuTimeNanos() platform support not yet implemented.");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
|
#endif // defined(WEBRTC_FUCHSIA)
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t GetThreadCpuTimeNanos() {
|
int64_t GetThreadCpuTimeNanos() {
|
||||||
|
#if defined(WEBRTC_FUCHSIA)
|
||||||
|
RTC_LOG_ERR(LS_ERROR) << "GetThreadCpuTimeNanos() not implemented";
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
#if defined(WEBRTC_LINUX)
|
#if defined(WEBRTC_LINUX)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) {
|
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) {
|
||||||
@ -111,15 +117,13 @@ int64_t GetThreadCpuTimeNanos() {
|
|||||||
} else {
|
} else {
|
||||||
RTC_LOG_ERR(LS_ERROR) << "GetThreadTimes() failed.";
|
RTC_LOG_ERR(LS_ERROR) << "GetThreadTimes() failed.";
|
||||||
}
|
}
|
||||||
#elif defined(WEBRTC_FUCHSIA)
|
|
||||||
RTC_LOG_ERR(LS_ERROR) << "GetThreadCpuTimeNanos() not implemented";
|
|
||||||
return 0;
|
|
||||||
#else
|
#else
|
||||||
// Not implemented yet.
|
// Not implemented yet.
|
||||||
static_assert(
|
static_assert(
|
||||||
false, "GetThreadCpuTimeNanos() platform support not yet implemented.");
|
false, "GetThreadCpuTimeNanos() platform support not yet implemented.");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
|
#endif // defined(WEBRTC_FUCHSIA)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rtc
|
} // namespace rtc
|
||||||
|
Reference in New Issue
Block a user