Fix -Wdeprecated-declarations warning triggered by clang-cl. (#1245)
WebRTC uses Google Benchmarks as a dependency and uses Chromium's build
infrastructure. Chromium is compiled using clang-cl on Windows, and the
-Wdeprecated-declarations warning is triggered. Because clang-cl accepts
gcc's diagnostic prama and defines the __clang__ macro,
using it can solve this issue.
Bug: webrtc:13280
diff --git a/src/benchmark.cc b/src/benchmark.cc
index a086453..5cb28b7 100644
--- a/src/benchmark.cc
+++ b/src/benchmark.cc
@@ -378,7 +378,7 @@
// Disable deprecated warnings temporarily because we need to reference
// CSVReporter but don't want to trigger -Werror=-Wdeprecated-declarations
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
diff --git a/test/output_test_helper.cc b/test/output_test_helper.cc
index 8a41e94..95fe0d0 100644
--- a/test/output_test_helper.cc
+++ b/test/output_test_helper.cc
@@ -384,7 +384,7 @@
// Disable deprecated warnings temporarily because we need to reference
// CSVReporter but don't want to trigger -Werror=-Wdeprecated-declarations
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif