Re: Cairo 1.14.2 problems with Solaris 10, libXrender
Bill Spitzak <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAL-8oAii433W1XK+G_G8pj6dpa11cAALnfbrWkXa5R-iF87Jhw@mail.gmail.com> |
On Wed, Aug 5, 2015 at 1:23 PM, Andreas F. Borchert < [email protected]> wrote: > The obvious intention was to keep the code in cairo-xlib-source.c > tidy without myriads of #if directives. A better solution could > be the replacement of > > #define CAIRO_RENDER_HAS_GRADIENTS(surface) \ > CAIRO_RENDER_AT_LEAST((surface), 0, 10) > > by > > #define CAIRO_RENDER_HAS_GRADIENTS(surface) \ > (HAVE_XRENDERCREATELINEARGRADIENT && > CAIRO_RENDER_AT_LEAST((surface), 0, 10)) > > and likewise for all the other macros of this kind in cairo-xlib-private.h. I think that is already being done, at least in some of the image code I was working on. The problem is that if you write this: if (CAIRO_RENDER_HAS_GRADIENTS(surface)) XRenderCreateLinearGraident(x); else ... Actually that would still cause the compilation to fail because XRenderCreateLinearGradient is not defined, even though the compiler can tell that the if statement is always false. I assume that is the reason the #define was done this way. It might be better to #define it to assert(false)? -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo