diff options
author | Matt Caswell <matt@openssl.org> | 2014-12-17 13:17:26 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-12-18 19:56:31 +0000 |
commit | 07c4c14c4739da0c44562328afb6e7273e51298c (patch) | |
tree | 1c936bd77997d866504eb97ef3cdf3fd76601713 /crypto/opensslconf.h.in | |
parent | 59ff1ce06108508eba0f289b295dd89582c9fbfc (diff) |
Turn on OPENSSL_NO_DEPRECATED by default.
Also introduce OPENSSL_USE_DEPRECATED. If OPENSSL_NO_DEPRECATED is
defined at config stage then OPENSSL_USE_DEPRECATED has no effect -
deprecated functions are not available.
If OPENSSL_NO_DEPRECATED is not defined at config stage then
applications must define OPENSSL_USE_DEPRECATED in order to access
deprecated functions.
Also introduce compiler warnings for gcc for applications using
deprecated functions
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/opensslconf.h.in')
-rw-r--r-- | crypto/opensslconf.h.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in index 97e3745563..31a01c1c8b 100644 --- a/crypto/opensslconf.h.in +++ b/crypto/opensslconf.h.in @@ -1,5 +1,22 @@ /* crypto/opensslconf.h.in */ +/* + * Applications should use -DOPENSSL_USE_DEPRECATED to enable access to + * deprecated functions. But if the library has been built to disable + * deprecated functions then this will not work + */ +#if defined(OPENSSL_NO_DEPRECATED) && defined(OPENSSL_USE_DEPRECATED) +#undef OPENSSL_USE_DEPRECATED +#endif + +/* Test for support for deprecated attribute */ +#if __GNUC__ > 3 || \ + (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +#define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)) +#else +#define DECLARE_DEPRECATED(f) f +#endif + /* Generate 80386 code? */ #undef I386_ONLY |