From dd27850a9ac662a082f5663768773e17d70bd3f2 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Thu, 21 Jan 2021 16:01:38 +0800 Subject: [PATCH] examples: fix build on macOS with gtk+-quartz-3.0 gdk_quartz_window_get_nsview is not declared in the header file now: error: implicit declaration of function 'gdk_quartz_window_get_nsview' is invalid in C99 [-Werror,-Wimplicit-function-declaration] fixes #979 Part-of: --- subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c | 4 ++++ subprojects/gst-examples/playback/player/gtk/gtk-play.c | 4 ++++ subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c | 4 ++++ .../gst-plugins-base/tests/examples/playback/playback-test.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c b/subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c index b5fa2b10dc..34c75c978f 100644 --- a/subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c +++ b/subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c @@ -11,6 +11,10 @@ #include #elif defined (GDK_WINDOWING_QUARTZ) #include +#if GTK_CHECK_VERSION(3, 24, 10) +#include +NSView *gdk_quartz_window_get_nsview (GdkWindow * window); +#endif #endif /* Structure to contain all our information, so we can pass it around */ diff --git a/subprojects/gst-examples/playback/player/gtk/gtk-play.c b/subprojects/gst-examples/playback/player/gtk/gtk-play.c index 86d357a799..c11b8a5af1 100644 --- a/subprojects/gst-examples/playback/player/gtk/gtk-play.c +++ b/subprojects/gst-examples/playback/player/gtk/gtk-play.c @@ -33,6 +33,10 @@ #include #elif defined (GDK_WINDOWING_QUARTZ) #include +#if GTK_CHECK_VERSION(3, 24, 10) +#include +NSView *gdk_quartz_window_get_nsview (GdkWindow * window); +#endif #endif #include diff --git a/subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c b/subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c index 40caa8da66..7427fc1238 100644 --- a/subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c +++ b/subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c @@ -35,6 +35,10 @@ #endif #if GST_GL_HAVE_WINDOW_COCOA && defined(GDK_WINDOWING_QUARTZ) #include +#if GTK_CHECK_VERSION(3, 24, 10) +#include +NSView *gdk_quartz_window_get_nsview (GdkWindow * window); +#endif #endif gboolean diff --git a/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c b/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c index 7da042eb20..13d78ea024 100644 --- a/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c +++ b/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c @@ -41,6 +41,10 @@ #include #elif defined (GDK_WINDOWING_QUARTZ) #include +#if GTK_CHECK_VERSION(3, 24, 10) +#include +NSView *gdk_quartz_window_get_nsview (GdkWindow * window); +#endif #endif #include