[FFmpeg-cvslog] avdevice/decklink: Fix compilation of module on OSX

Devin Heitmueller git at videolan.org
Sat Jan 20 19:55:57 EET 2018


ffmpeg | branch: master | Devin Heitmueller <dheitmueller at ltnglobal.com> | Mon Jan  8 20:16:58 2018 -0500| [b5b48685043e4761335c4ab7086eba3b24a9c03d] | committer: Marton Balint

avdevice/decklink: Fix compilation of module on OSX

Clang applies the missing-prototypes warning on C++ files, whereas
gcc only applies it to C.  As a result, the decklink_common.cpp file
fails to build because of missing prototypes in DecklinkDispatch.cpp
(which is #included by decklink_common.cpp).

We don't want to change the actual Blackmagic SDK sources, so
suppress the warning just for that one #include.

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavdevice/decklink_common.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 6ef2c529f4..d1576b8553 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -29,7 +29,18 @@ extern "C" {
 #ifdef _WIN32
 #include <DeckLinkAPI_i.c>
 #else
+/* The file provided by the SDK is known to be missing prototypes, which doesn't
+   cause issues with GCC since the warning doesn't apply to C++ files.  However
+   Clang does complain (and warnings are treated as errors), so suppress the
+   warning just for this one file */
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#endif
 #include <DeckLinkAPIDispatch.cpp>
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 #endif
 
 extern "C" {



More information about the ffmpeg-cvslog mailing list