[FFmpeg-cvslog] build: Add _Pragma macro to disable deprecated declaration warnings

Diego Biurrun git at videolan.org
Sat Aug 3 09:38:55 CEST 2013


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Mar 27 18:23:01 2013 +0100| [3a7050ffed5ce061b114a11e4de4b77aba8efa0b] | committer: Diego Biurrun

build: Add _Pragma macro to disable deprecated declaration warnings

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a7050ffed5ce061b114a11e4de4b77aba8efa0b
---

 configure            |    6 ++++++
 libavutil/internal.h |    8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/configure b/configure
index 3420f3c..979cc60 100755
--- a/configure
+++ b/configure
@@ -1319,6 +1319,7 @@ HAVE_LIST="
     nanosleep
     poll_h
     posix_memalign
+    pragma_deprecated
     rdtsc
     sched_getaffinity
     sdl
@@ -3393,6 +3394,11 @@ void foo(char * $restrict_keyword p);
 EOF
 done
 
+check_cc <<EOF && enable pragma_deprecated
+_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+_Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+EOF
+
 check_cc <<EOF && enable attribute_packed
 struct { int x; } __attribute__((packed)) x;
 EOF
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 49534d4..5a721f3 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -61,6 +61,14 @@
 #    define av_export
 #endif
 
+#if HAVE_PRAGMA_DEPRECATED
+#    define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#    define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+#else
+#    define FF_DISABLE_DEPRECATION_WARNINGS
+#    define FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
 #ifndef INT_BIT
 #    define INT_BIT (CHAR_BIT * sizeof(int))
 #endif



More information about the ffmpeg-cvslog mailing list