From: Richard Levitte Date: Sat, 3 Oct 2020 07:45:24 +0000 (+0200) Subject: Add definitions of OSSL_DEPRECATED[_FOR] for Microsoft VC X-Git-Tag: openssl-3.0.0-alpha7~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f044964e7a8b731d1452bbaf5028311db329a45b;p=thirdparty%2Fopenssl.git 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) --- diff --git a/include/openssl/macros.h b/include/openssl/macros.h index bdeb2793bbc..02a68b26619 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