summaryrefslogtreecommitdiffstats
path: root/crypto/opensslconf.h.in
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-04 23:00:33 -0500
committerViktor Dukhovni <openssl-users@dukhovni.org>2016-01-07 20:53:18 -0500
commit98186eb4e4aef6262ed6b0f499348defa2c26893 (patch)
tree38ddc0aea1be4b31a4a48d74dc307ad30288af47 /crypto/opensslconf.h.in
parentcddd424a5bda94e238e4ff06c0efc80cff3b07d1 (diff)
Backwards-compatibility subject to OPENSSL_API_COMPAT
Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/opensslconf.h.in')
-rw-r--r--crypto/opensslconf.h.in44
1 files changed, 34 insertions, 10 deletions
diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in
index f12117963f..20a420fa7b 100644
--- a/crypto/opensslconf.h.in
+++ b/crypto/opensslconf.h.in
@@ -1,20 +1,44 @@
/* 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
+ * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
+ * declarations of functions deprecated in or before <version>. Otherwise, they
+ * still won't see them if the library has been built to disable deprecated
+ * functions.
*/
-#if defined(OPENSSL_NO_DEPRECATED) && defined(OPENSSL_USE_DEPRECATED)
-#error "OPENSSL_USE_DEPRECATED has been defined, but OpenSSL has been built without support for deprecated functions"
+#if defined(OPENSSL_NO_DEPRECATED)
+# define DECLARE_DEPRECATED(f)
+#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
+# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
+#else
+# define DECLARE_DEPRECATED(f) f;
+#endif
+
+#ifndef OPENSSL_MIN_API
+#define OPENSSL_MIN_API 0
+#endif
+
+#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
+#undef OPENSSL_API_COMPAT
+#define OPENSSL_API_COMPAT OPENSSL_MIN_API
+#endif
+
+#if OPENSSL_API_COMPAT < 0x10100000L
+# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
+#else
+# define DEPRECATEDIN_1_1_0(f)
+#endif
+
+#if OPENSSL_API_COMPAT < 0x10000000L
+# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
+#else
+# define DEPRECATEDIN_1_0_0(f)
#endif
-/* Test for support for deprecated attribute */
-#if __GNUC__ > 3 || \
- (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated))
+#if OPENSSL_API_COMPAT < 0x00908000L
+# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
#else
-#define DECLARE_DEPRECATED(f) f
+# define DEPRECATEDIN_0_9_8(f)
#endif
/* Generate 80386 code? */