aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel P <pavlov.pavel@gmail.com>2024-04-18 12:03:46 -0700
committerCopybara-Service <copybara-worker@google.com>2024-04-18 12:04:41 -0700
commit7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf (patch)
tree3c48f28943824d44d59c0f0458394154d7fca45e
parent192e959b16809f751d565b53a949b21129d904fb (diff)
downloadabseil-7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf.tar.gz
abseil-7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf.tar.bz2
abseil-7efc308b31d3635a6fb0cb94f9f0ac2317d11fcf.zip
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
-rw-r--r--absl/base/attributes.h5
1 files changed, 5 insertions, 0 deletions
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