From f044964e7a8b731d1452bbaf5028311db329a45b Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 3 Oct 2020 09:45:24 +0200 Subject: [PATCH] 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 (Merged from https://github.com/openssl/openssl/pull/13074) --- include/openssl/macros.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 -- 2.34.1