Suppress -Wdeprecated-volatile in rtc_base/system_time.cc

Bug: webrtc:14601
Change-Id: Ifb6e0cb372231920108142b5efc076039943581b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280442
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38471}
This commit is contained in:
Björn Terelius 2022-10-25 15:25:34 +02:00 committed by WebRTC LUCI CQ
parent 96002fa8da
commit 4fdf8cc67b

View file

@ -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