diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2017-11-03 17:10:55 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-14 20:49:07 +0100 |
commit | 01763144dcc1bc47fa4967d91d3fedb25e3ef556 (patch) | |
tree | 5679e42cc9b1028eced447afe61e1c8ba9809e18 /libavutil/internal.h | |
parent | 57a422ea4c27dc699baf18ecf7f20353bec36090 (diff) | |
download | ffmpeg-01763144dcc1bc47fa4967d91d3fedb25e3ef556.tar.gz |
Avoid corrupting diagnostic state with _Pragma changes.
The macros for ICC and MSVC correctly push and pop the diagnostic
state of the compiler when disabling deprecation warnings. The
ones for clang/gcc should do the same. Without this, if a blanket
deprecation warning is applied to the code base it'll be flipped
back on incorrectly with FF_ENABLE_DEPRECATION_WARNINGS.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index fef5089097..72ae0ad89b 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -81,8 +81,8 @@ # define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996)) # define FF_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop)) # else -# define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"") +# define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +# define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic pop") # endif #else # define FF_DISABLE_DEPRECATION_WARNINGS |