From 7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 18 Apr 2024 12:03:46 -0700 Subject: PR #1651: Implement ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING for MSVC compiler Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1651 Merge 6c02d45f193cb9d8e26f2f8e4db57cea384cefb2 into 9a61b00dde4031f17ed4fa4bdc0e0e9ad8859846 Merging this change closes #1651 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1651 from pps83:ms-pragma-warn 6c02d45f193cb9d8e26f2f8e4db57cea384cefb2 PiperOrigin-RevId: 626108518 Change-Id: Idb00aca9bafbca92b231bdff7ef8c220948f134c --- absl/base/attributes.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'absl/base/attributes.h') diff --git a/absl/base/attributes.h b/absl/base/attributes.h index 38086a82..a6c40a76 100644 --- a/absl/base/attributes.h +++ b/absl/base/attributes.h @@ -702,6 +702,11 @@ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ _Pragma("GCC diagnostic pop") +#elif defined(_MSC_VER) +#define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(push)") _Pragma("warning(disable: 4996)") +#define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(pop)") #else #define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING -- cgit v1.2.3