[cairo-bugs] [Bug 54319] [EGL] compile error in cairo-egl-context.c at line 189

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 31 10:34:25 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=54319

--- Comment #1 from Manfred Kogler <candideus at gmail.com> 2012-08-31 17:34:25 UTC ---
(In reply to comment #0)
> Hi cairo-team!
> 
> My target is to get a cairo library that supports OpenVG and EGL (currently on
> Windows, later on on Linux). I noticed, that enabling EGL also enforces
> enabling OpenGL or OpenGLES. So I ended up activating the following settings on
> top of plain 1.12.2 release:
> 
>     CAIRO_HAS_GL_SURFACE=1
>     CAIRO_HAS_VG_SURFACE=1
>     CAIRO_HAS_EGL_FUNCTIONS=1
> 
> Using Visual Studio 11 compiler (VC11) this configuration produces these
> warnings and compile errors:
>     ...
>     cairo-gl-msaa-compositor.c
>     cairo-gl-spans-compositor.c
>     cairo-gl-traps-compositor.c
>     cairo-gl-traps-compositor.c(329) : warning C4133: '=' : incompatible types
> - fro
>     m 'cairo_surface_t *' to 'cairo_gl_surface_t *'
>     cairo-gl-source.c
>     cairo-gl-surface.c
>     cairo-vg-surface.c
>     cairo-egl-context.c
>     cairo-egl-context.c(189) : error C2440: 'function' : cannot convert from
> '__eglM
>     ustCastToProperFunctionPointerType (__stdcall *)(const char *)' to
> 'cairo_gl_get
>     _proc_addr_func_t'
>     cairo-egl-context.c(189) : warning C4024: '_cairo_gl_dispatch_init' :
> different
>     types for formal and actual parameter 2
>     make[1]: *** [debug/cairo-egl-context.obj] Error 2
>     make[1]: Leaving directory `/c/Users/kog/xxx/CairoBuild/cairo/src'
>     make: *** [cairo] Error 2
> 
> I also tested the very same configuration on latest 1.12 git branch and latest
> master git branch. Everywhere the very same warnings and errors (apart from
> slightly differing line numbers of course). Enabling CAIRO_HAS_EGL_FUNCTIONS=1
> breaks the build.
> 
> Many thanks for your support!
> 
> Kind regards,
> Fred

after having had a closer look, I could figure out the fix for the compile
error and also got rid of the warning with an additional cast:

***************************************************************
 src/cairo-gl-private.h          | 2 +-
 src/cairo-gl-traps-compositor.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index 3afdd70..b494207 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -204,7 +204,7 @@ typedef enum cairo_gl_var_type {
 #define CAIRO_GL_VAR_TYPE_MAX ((CAIRO_GL_VAR_TEXCOORDS << 3) |
(CAIRO_GL_VAR_TEXCOORDS << 2) | (CAIRO_GL_VAR_TEXCOORDS << 1) |
CAIRO_GL_VAR_TEXCOORDS)

 typedef void (*cairo_gl_generic_func_t)(void);
-typedef cairo_gl_generic_func_t (*cairo_gl_get_proc_addr_func_t)(const char
*procname);
+typedef cairo_gl_generic_func_t (EGLAPIENTRY
*cairo_gl_get_proc_addr_func_t)(const char *procname);

 typedef struct _cairo_gl_dispatch {
     /* Buffers */
diff --git a/src/cairo-gl-traps-compositor.c b/src/cairo-gl-traps-compositor.c
index 776b74c..e7a002c 100644
--- a/src/cairo-gl-traps-compositor.c
+++ b/src/cairo-gl-traps-compositor.c
@@ -326,7 +326,7 @@ traps_to_operand (void *_dst,
     if (unlikely (status))
     goto error;

-    operand->texture.owns_surface = mask;
+    operand->texture.owns_surface = (cairo_gl_surface_t *)mask;
     return CAIRO_STATUS_SUCCESS;

 error:
***************************************************************

I think those are proper fixes and propose to add 'em to the master branch.

Kind regards,
Fred

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the cairo-bugs mailing list