From 9a65e80e4fce0790bdd06605aa5a605071b986c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 25 Mar 2015 17:19:12 +0100 Subject: [PATCH] Properly mark ssl_set_bio() as deprecated --- include/mbedtls/ssl.h | 10 +++++++++- library/ssl_tls.c | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 5ce118c20..2642ac65b 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -1214,6 +1214,12 @@ void ssl_set_dbg( ssl_context *ssl, void (*f_dbg)(void *, int, const char *), void *p_dbg ); +#if ! defined(POLARSSL_DEPRECATED_REMOVED) +#if defined(POLARSSL_DEPRECATED_WARNING) +#define DEPRECATED __attribute__((deprecated)) +#else +#define DEPRECATED +#endif /** * \brief Set the underlying BIO read and write callbacks * @@ -1231,7 +1237,9 @@ void ssl_set_dbg( ssl_context *ssl, */ void ssl_set_bio( ssl_context *ssl, int (*f_recv)(void *, unsigned char *, size_t), void *p_recv, - int (*f_send)(void *, const unsigned char *, size_t), void *p_send ); + int (*f_send)(void *, const unsigned char *, size_t), void *p_send ) DEPRECATED; +#undef DEPRECATED +#endif /* POLARSSL_DEPRECATED_REMOVED */ #if defined(POLARSSL_SSL_SRV_C) /** diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 8f635a502..bdc9c534b 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5257,6 +5257,7 @@ void ssl_set_dbg( ssl_context *ssl, ssl->p_dbg = p_dbg; } +#if ! defined(POLARSSL_DEPRECATED_REMOVED) void ssl_set_bio( ssl_context *ssl, int (*f_recv)(void *, unsigned char *, size_t), void *p_recv, int (*f_send)(void *, const unsigned char *, size_t), void *p_send ) @@ -5273,6 +5274,7 @@ void ssl_set_bio( ssl_context *ssl, ssl->f_send = f_send; ssl->p_bio = p_send; } +#endif /* POLARSSL_DEPRECATED_REMOVED */ void ssl_set_bio_timeout( ssl_context *ssl, void *p_bio,