Backporting commit from upstream EFL. 82/16382/1 accepted/tizen/generic accepted/tizen/ivi/stable accepted/tizen/generic/20140217.130402 accepted/tizen/generic/20140312.100402 accepted/tizen/ivi/20140214.223353 accepted/tizen/ivi/panda/20140312.110915 accepted/tizen/ivi/release/20140312.114431 submit/tizen/20140214.104914 submit/tizen/20140312.070747 submit/tizen_ivi_release/20140312.071221
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 14 Feb 2014 12:17:31 +0000 (10:17 -0200)
committerRafael Antognolli <rafael.antognolli@intel.com>
Fri, 14 Feb 2014 04:22:17 +0000 (02:22 -0200)
ecore-wayland: test for subsurface protocol in wayland core

The subsurface protocol was moved into Wayland Core
around v1.3.90 (i.e. v1.4.0).

Test if subsurface protocol is part of wayland-client.h.
If not, we include our own copy of the protocol header.

Also, some whitespace cleanup in ecore_wl.c.

Tested with Wayland 1.3.0 and 1.3.90 (master:360dca5).

Change-Id: I42282cffcc0ecd119f5e38f27fe934494ed59864
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_subsurf.c

index 64f7553..90d9afd 100644 (file)
@@ -30,7 +30,17 @@ void *alloca (size_t);
 
 #include <fcntl.h>
 #include "ecore_wl_private.h"
-#include <subsurface-client-protocol.h>
+
+/*
+ * The subsurface protocol was moved into Wayland Core
+ * around v1.3.90 (i.e. v1.4.0).
+ * Test if subsurface protocol is part of wayland-client.h.
+ * If not, we include our own copy of the protocol header.
+ */
+#include <wayland-client.h>
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+# include <subsurface-client-protocol.h>
+#endif
 
 /* local function prototypes */
 static Eina_Bool _ecore_wl_shutdown(Eina_Bool close);
index 8c1b059..a0c9a56 100644 (file)
@@ -3,7 +3,17 @@
 #endif
 
 #include "ecore_wl_private.h"
-#include <subsurface-client-protocol.h>
+
+/*
+ * The subsurface protocol was moved into Wayland Core
+ * around v1.3.90 (i.e. v1.4.0).
+ * Test if subsurface protocol is part of wayland-client.h.
+ * If not, we include our own copy of the protocol header.
+ */
+#include <wayland-client.h>
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+# include <subsurface-client-protocol.h>
+#endif
 
 struct _Ecore_Wl_Subsurf
 {