From: Yann Collet Date: Mon, 10 Aug 2020 18:51:57 +0000 (-0700) Subject: fix #832 X-Git-Tag: upstream/1.9.3~1^2~43^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a29ade17a0157350de851fcd72e4291d2142691c;p=platform%2Fupstream%2Flz4.git fix #832 does no longer rely on default 0-interpretation when __GNUC__ is not defined --- diff --git a/lib/lz4.h b/lib/lz4.h index 9b3d758..b8a898e 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -665,18 +665,17 @@ union LZ4_streamDecode_u { #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS # define LZ4_DEPRECATED(message) /* disable deprecation warnings */ #else -# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) # if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ # define LZ4_DEPRECATED(message) [[deprecated(message)]] -# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__) -# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) -# elif (LZ4_GCC_VERSION >= 301) -# define LZ4_DEPRECATED(message) __attribute__((deprecated)) # elif defined(_MSC_VER) # define LZ4_DEPRECATED(message) __declspec(deprecated(message)) +# elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 5)) +# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) +# elif defined(__GNUC__) && (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1) +# define LZ4_DEPRECATED(message) __attribute__((deprecated)) # else -# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") -# define LZ4_DEPRECATED(message) +# pragma message("WARNING: LZ4_DEPRECATED needs custom implementation for this compiler") +# define LZ4_DEPRECATED(message) /* disabled */ # endif #endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */