Commit dcb83330 authored by Richard Levitte's avatar Richard Levitte
Browse files

Avoid __GNUC__ warnings when defining DECLARE_DEPRECATED



We need to check that __GNUC__ is defined before trying to use it.
This demands a slightly different way to define DECLARE_DEPRECATED.

Reviewed-by: default avatarMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/6688)
parent 5c06c7d7
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -68,12 +68,18 @@ extern "C" {
 * still won't see them if the library has been built to disable deprecated
 * functions.
 */
#ifndef DECLARE_DEPRECATED
# 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;
#  ifdef __GNUC__
#   if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
#    undef DECLARE_DEPRECATED
#    define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
#   endif
#  endif
# endif
#endif

#ifndef OPENSSL_FILE