summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-10-03 09:45:24 +0200
committerRichard Levitte <levitte@openssl.org>2020-10-12 08:29:30 +0200
commitf044964e7a8b731d1452bbaf5028311db329a45b (patch)
tree07900500f04e5686522514d961fdc9172de440df /include
parent6fbb89fb12b6a5ca9838b357ca6c810c57f474e4 (diff)
Add definitions of OSSL_DEPRECATED[_FOR] for Microsoft VC
It turns out that they have __declspec(deprecated) that correspond pretty much to GCC's __attribute__((deprecated)), including for messages. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/macros.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/openssl/macros.h b/include/openssl/macros.h
index bdeb2793bb..02a68b2661 100644
--- a/include/openssl/macros.h
+++ b/include/openssl/macros.h
@@ -33,7 +33,21 @@
# ifndef OSSL_DEPRECATED
# undef OSSL_DEPRECATED_FOR
# ifndef OPENSSL_SUPPRESS_DEPRECATED
-# if defined(__GNUC__)
+# if defined(_MSC_VER)
+ /*
+ * MSVC supports __declspec(deprecated) since MSVC 2003 (13.10),
+ * and __declspec(deprecated(message)) since MSVC 2005 (14.00)
+ */
+# if _MSC_VER >= 1400
+# define OSSL_DEPRECATED(since) \
+ __declspec(deprecated("Since OpenSSL " # since))
+# define OSSL_DEPRECATED_FOR(since, message) \
+ __declspec(deprecated("Since OpenSSL " # since ";" message))
+# elif _MSC_VER >= 1310
+# define OSSL_DEPRECATED(since) __declspec(deprecated)
+# define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated)
+# endif
+# elif defined(__GNUC__)
/*
* According to GCC documentation, deprecations with message appeared in
* GCC 4.5.0