From fb1c30b71af5be58940ce15699dbcb311e33f2c6 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Wed, 14 Sep 2011 19:47:38 +0200 Subject: lavu/attributes: introduce AV_NOWARN_DEPRECATED. --- libavutil/attributes.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libavutil/attributes.h') diff --git a/libavutil/attributes.h b/libavutil/attributes.h index e97fdfd466..3f761ef679 100644 --- a/libavutil/attributes.h +++ b/libavutil/attributes.h @@ -88,6 +88,24 @@ #endif #endif +/** + * Disable warnings about deprecated features + * This is useful for sections of code kept for backward compatibility and + * scheduled for removal. + */ +#ifndef AV_NOWARN_DEPRECATED +#if AV_GCC_VERSION_AT_LEAST(4,6) +# define AV_NOWARN_DEPRECATED(code) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ + code \ + _Pragma("GCC diagnostic pop") +#else +# define AV_NOWARN_DEPRECATED(code) code +#endif +#endif + + #ifndef av_unused #if defined(__GNUC__) # define av_unused __attribute__((unused)) -- cgit v1.2.1