Bug 83359 - Features disabled by default should also appear in cairo-features.h
Summary: Features disabled by default should also appear in cairo-features.h
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.12.16
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-01 14:54 UTC by Julien Isorce
Modified: 2015-06-04 21:35 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
build: define no features as 0 (1.01 KB, text/plain)
2014-09-01 14:54 UTC, Julien Isorce
Details
build: show up all disabled featured (893 bytes, patch)
2014-09-03 10:09 UTC, Julien Isorce
Details | Splinter Review

Description Julien Isorce 2014-09-01 14:54:14 UTC
Created attachment 105566 [details]
build: define no features as 0

Currently in cairo-gl.h there is:
#if CAIRO_HAS_GL_SURFACE || CAIRO_HAS_GLESV2_SURFACE

When building cairo with --disable-glesv2 then the compiler warns that CAIRO_HAS_GLESV2_SURFACE is not defined.
If those warnings are treated as errors then the build just fails (ex: webkit)

The attached patch ensure all stuffs under put in NO_FEATURES are defined as 0, even for features defaulted to "no". Because currently only features defaults to auto or yes are put into NO_FEATURES when disabled.
Comment 1 Behdad Esfahbod 2014-09-02 08:08:29 UTC
Whoever sets -Werror is doomed to live to suffer from it.
Comment 2 Julien Isorce 2014-09-02 14:30:34 UTC
Oki np. (webkitEFL enables it but I can disable it manually)

What about the first part of the patch:

-CAIRO_FEATURE_HOOK_REGISTER(no,!no,!,
+CAIRO_FEATURE_HOOK_REGISTER(no,*,!,

? 

to have all the disabled features in the commentaries ( i.e. "/*#undef $FEATURE */" )
So that it's not confusing why in cairo-features.h you can see /*#undef CAIRO_HAS_EGL_FUNCTIONS */
but not /*#undef CAIRO_HAS_GLESV2_SURFACE */ when configuring cairo with
--disable-egl --disable-glesv2

Thx!
Comment 3 Behdad Esfahbod 2014-09-03 09:11:32 UTC
Ok I think that's fair.
Comment 4 Julien Isorce 2014-09-03 10:09:07 UTC
Created attachment 105673 [details] [review]
build: show up all disabled featured
Comment 5 Behdad Esfahbod 2014-10-06 01:37:13 UTC
The patch can go in, if someone can take care of committing and testing please.
Comment 6 Bryce Harrington 2015-06-04 21:35:46 UTC
Based on Behdad's approval above, I've landed the patch in trunk.

commit f032133e6d5ad05157fc46609d8c63103028342c
Author: Julien Isorce <j.isorce@samsung.com>
Date:   Wed Sep 3 10:58:18 2014 +0100

    build: Show all disabled features in cairo-features.h

    Even features which are disabled by default should appear in
    cairo-features.h.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83359
    (Patch approved by Behdad Esfahbod in bug tracker.)

    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.