[cairo] error: 'RepeatNone' undeclared (first use in this function)

Carl Worth cworth at cworth.org
Fri Oct 31 09:48:57 PDT 2008


On Thu, 2008-10-30 at 14:15 -0500, Ryan Schmidt wrote:
> I tried to update the cairo port in MacPorts from 1.8.0 to 1.8.2 but  
> it won't build:
...
> cairo-xlib-surface.c: In function '_cairo_xlib_surface_set_attributes':
> cairo-xlib-surface.c:1440: error: 'RepeatNone' undeclared (first use  
> in this function)
...
> I'm using the same configure line that worked fine with 1.8.0:

This is due to a change I made. We were previously passing a bare 0 here
instead of RepeatNone and I changed that for better readability.
(Similarly, we were using a bare 1 for RepeatNormal.)

So you should be able to just change both of those back in order to get
things compiled.

But meanwhile, I'd like your help to figure out exactly what's going
wrong here.

If you have the Xrender header files then src/cairo-features.h should
contain:

	#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1

and cairo-xlib-xrender-private.h should key off of that to include:

	#include <X11/extensions/Xrender.h>

which should in turn include:

	#include <X11/extensions/render.h>

which should finally define the RepeatNone macro to 0. Oh, oops! This
might be the problem:

	/* Extended repeat attributes included in 0.10 */
	#define RepeatNone                          0

I'm guessing you've got a version of the Xrender library that's older
than 0.10, and that's what's tripping you up here.

Otherwise, if you didn't have the Xrender header files at all, then you
would be getting cairo's own definition of RepeatNone directly from
cairo-xlib-xrender-private, (where we include a copy of all Xrender
symbols just to allow compiling code that we know won't be run).

Behdad, what do you think. Shall we just do something like:

#ifndef RepeatNone
#define RepeatNone 0
#endif

etc. in cairo-xlib-xrender-private.h, but outside the
CAIRO_HAS_XLIB_XRENDER_SURFACE condition?

I am planning on soon starting to use RepeatPad and RepeatReflect in
cairo-xlib-surface.c and using bare 0, 1, 2, 3 values is not an
appealing option there. ;-)

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.cairographics.org/archives/cairo/attachments/20081031/0e7c6dba/attachment.pgp 


More information about the cairo mailing list