From 67b8f5bdbf95ad4def2dd27c220545b15d847aae Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 29 Nov 2019 12:01:18 +0000 Subject: [PATCH] Add the ability to supress deprecation warnings We add a new macro OPENSSL_SUPRESS_DEPRECATED which enables applications to supress deprecation warnings where necessary. Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10558) --- include/openssl/macros.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/openssl/macros.h b/include/openssl/macros.h index 8548bde542..a38387f131 100644 --- a/include/openssl/macros.h +++ b/include/openssl/macros.h @@ -28,15 +28,17 @@ */ # ifndef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f; -# ifdef __GNUC__ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# undef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -# endif -# elif defined(__SUNPRO_C) -# if (__SUNPRO_C >= 0x5130) -# undef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# ifndef OPENSSL_SUPPRESS_DEPRECATED +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif # endif # endif -- 2.25.1