After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710926 - Build fails without declaration of wl_resource
Build fails without declaration of wl_resource
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: general
1.16.x
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-10-26 15:32 UTC by fakey
Modified: 2013-10-28 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Declare struct wl_resource to fix compiler error (776 bytes, patch)
2013-10-26 15:33 UTC, fakey
none Details | Review
egl: forward declare wl_resource for compatibility (1.95 KB, patch)
2013-10-28 14:51 UTC, Robert Bragg
reviewed Details | Review

Description fakey 2013-10-26 15:32:40 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
Comment 1 fakey 2013-10-26 15:33:27 UTC
Created attachment 258180 [details] [review]
Declare struct wl_resource to fix compiler error
Comment 2 Robert Bragg 2013-10-28 14:51:01 UTC
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.
Comment 3 Neil Roberts 2013-10-28 15:17:36 UTC
Patch looks good to me.
Comment 4 Robert Bragg 2013-10-28 16:51:44 UTC
Ok thanks, I've pushed the patch to master, cogl-1.18 and cogl-1.16