GNOME Bugzilla – Bug 710926
Build fails without declaration of wl_resource
Last modified: 2013-10-28 16:51:44 UTC
cogl fails to build on master and the 1.16 branch, possibly because the compiler can't resolve the two declarations of 'struct wl_resource *' as being the same: In file included from ./winsys/cogl-winsys-egl.c:33:0: ./winsys/cogl-winsys-egl-private.h:167:33: warning: 'struct wl_resource' declared inside parameter list [enabled by default] int *value); ^ ./winsys/cogl-winsys-egl.c:1047:1: error: conflicting types for '_cogl_egl_query_wayland_buffer' _cogl_egl_query_wayland_buffer (CoglContext *ctx, ^ In file included from ./winsys/cogl-winsys-egl.c:33:0: ./winsys/cogl-winsys-egl-private.h:164:1: note: previous declaration of '_cogl_egl_query_wayland_buffer' was here _cogl_egl_query_wayland_buffer (CoglContext *ctx, ^ ./winsys/cogl-winsys-egl.c: In function '_cogl_egl_query_wayland_buffer': ./winsys/cogl-winsys-egl.c:1059:50: warning: passing argument 2 of 'egl_renderer->pf_eglQueryWaylandBuffer' from incompatible pointer type [enabled by default] value); ^ ./winsys/cogl-winsys-egl.c:1059:50: note: expected 'struct wl_resource *' but argument is of type 'struct wl_resource *' make[4]: *** [cogl-winsys-egl.lo] Error 1
Created attachment 258180 [details] [review] Declare struct wl_resource to fix compiler error
Created attachment 258311 [details] [review] egl: forward declare wl_resource for compatibility Thanks for the patch. Looking at your patch and looking into the cause of the problem a bit more I ended up moving the wl_resource declaration further up before including cogl-winsys-egl-feature-functions.h which also depends on the type, otherwise I would still see lots of warnings. It looks like the Mesa eglQueryWaylandBufferWL api was updated to avoid using the deprecated wl_buffer type and so if you aren't building with the latest Mesa then we need to forward declare wl_resource. I've attached a similar patch with an explanatory comment which hopefully makes sense.
Patch looks good to me.
Ok thanks, I've pushed the patch to master, cogl-1.18 and cogl-1.16