From 4fdf8cc67bbb00edb8aba423021da4a09cf319ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Terelius?= Date: Tue, 25 Oct 2022 15:25:34 +0200 Subject: [PATCH] Suppress -Wdeprecated-volatile in rtc_base/system_time.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:14601 Change-Id: Ifb6e0cb372231920108142b5efc076039943581b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280442 Reviewed-by: Harald Alvestrand Reviewed-by: Johannes Kron Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/main@{#38471} --- rtc_base/system_time.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtc_base/system_time.cc b/rtc_base/system_time.cc index d53d923148..058e6c2990 100644 --- a/rtc_base/system_time.cc +++ b/rtc_base/system_time.cc @@ -69,6 +69,10 @@ int64_t SystemTimeNanos() { #elif defined(WINUWP) ticks = WinUwpSystemTimeNanos(); #elif defined(WEBRTC_WIN) + // TODO(webrtc:14601): Fix the volatile increment instead of suppressing the + // warning. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" static volatile LONG last_timegettime = 0; static volatile int64_t num_wrap_timegettime = 0; volatile LONG* last_timegettime_ptr = &last_timegettime; @@ -87,6 +91,7 @@ int64_t SystemTimeNanos() { // TODO(deadbeef): Calculate with nanosecond precision. Otherwise, we're // just wasting a multiply and divide when doing Time() on Windows. ticks = ticks * kNumNanosecsPerMillisec; +#pragma clang diagnostic pop #else #error Unsupported platform. #endif