From 5105bc804154144d94bc91a8a912bf1a491270ae Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Wed, 5 Jun 2019 12:47:16 +0100 Subject: [PATCH] wpe: Fix build with -Werror enabled Including gl.h from WPEThreadedView.h leads to GST_LEVEL_DEFAULT detected as redefined. The proposed fix is to include config.h from the CPP implementation file and disable gl.h inclusion in the header, by using forward declarations. --- ext/wpe/WPEThreadedView.cpp | 10 +++++++++- ext/wpe/WPEThreadedView.h | 7 +++---- ext/wpe/gstwpesrc.cpp | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ext/wpe/WPEThreadedView.cpp b/ext/wpe/WPEThreadedView.cpp index f7e621efc8..af7fc7aa7b 100644 --- a/ext/wpe/WPEThreadedView.cpp +++ b/ext/wpe/WPEThreadedView.cpp @@ -17,12 +17,20 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "WPEThreadedView.h" +#include +#include +#include + #include #include -#define GST_CAT_DEFAULT wpe_src_debug +GST_DEBUG_CATEGORY_EXTERN (wpe_src_debug); // -70 is the GLib priority we use internally in WebKit, for WPE. #define WPE_GLIB_SOURCE_PRIORITY -70 diff --git a/ext/wpe/WPEThreadedView.h b/ext/wpe/WPEThreadedView.h index e61237563a..5b2c389438 100644 --- a/ext/wpe/WPEThreadedView.h +++ b/ext/wpe/WPEThreadedView.h @@ -21,16 +21,15 @@ #include #include -#include #include -#include -#include #include #include #include #include "gstwpesrc.h" -GST_DEBUG_CATEGORY_EXTERN(wpe_src_debug); +typedef struct _GstGLContext GstGLContext; +typedef struct _GstGLDisplay GstGLDisplay; +typedef struct _GstEGLImage GstEGLImage; class WPEThreadedView { public: diff --git a/ext/wpe/gstwpesrc.cpp b/ext/wpe/gstwpesrc.cpp index ed1e56631d..8eb635cdfe 100644 --- a/ext/wpe/gstwpesrc.cpp +++ b/ext/wpe/gstwpesrc.cpp @@ -60,10 +60,10 @@ #endif #include "gstwpesrc.h" -#include #include #include #include +#include #include #include "WPEThreadedView.h"