[FFmpeg-devel,11/11] decklink: Fix compilation of module on OSX

Submitted by Devin Heitmueller on Jan. 9, 2018, 1:16 a.m.


Message ID 20180109011658.72370-12-dheitmueller@ltnglobal.com
State New
Headers show

Commit Message

Devin Heitmueller Jan. 9, 2018, 1:16 a.m.
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@ltnglobal.com>
 libavdevice/decklink_common.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index b033e63..c0b3c93 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -29,7 +29,18 @@  extern "C" {
 #ifdef _WIN32
 #include <DeckLinkAPI_i.c>
+/* 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"
 #include <DeckLinkAPIDispatch.cpp>
+#ifdef __clang__
+#pragma clang diagnostic pop
 extern "C" {