wpe: Fix build with -Werror enabled
authorPhilippe Normand <philn@igalia.com>
Wed, 5 Jun 2019 11:47:16 +0000 (12:47 +0100)
committerPhilippe Normand <philn@igalia.com>
Wed, 5 Jun 2019 11:47:16 +0000 (12:47 +0100)
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
ext/wpe/WPEThreadedView.h
ext/wpe/gstwpesrc.cpp

index f7e621e..af7fc7a 100644 (file)
  * Boston, MA 02110-1301, USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "WPEThreadedView.h"
 
+#include <gst/gl/gl.h>
+#include <gst/gl/egl/gsteglimage.h>
+#include <gst/gl/egl/gstgldisplay_egl.h>
+
 #include <cstdio>
 #include <mutex>
 
-#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
index e612375..5b2c389 100644 (file)
 
 #include <EGL/egl.h>
 #include <glib.h>
-#include <gst/gl/gl.h>
 #include <gst/gl/gstglfuncs.h>
-#include <gst/gl/egl/gsteglimage.h>
-#include <gst/gl/egl/gstgldisplay_egl.h>
 #include <wpe/fdo.h>
 #include <wpe/fdo-egl.h>
 #include <wpe/webkit.h>
 #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:
index ed1e566..8eb635c 100644 (file)
 #endif
 
 #include "gstwpesrc.h"
-#include <gst/video/video.h>
 #include <gst/gl/gl.h>
 #include <gst/gl/egl/gstglmemoryegl.h>
 #include <gst/gl/wayland/gstgldisplay_wayland.h>
+#include <gst/video/video.h>
 #include <xkbcommon/xkbcommon.h>
 
 #include "WPEThreadedView.h"