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>
This commit is contained in:
Matt Caswell
2014-12-17 13:17:26 +00:00
parent 59ff1ce061
commit 07c4c14c47
3 changed files with 50 additions and 1 deletions

View File

@@ -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