[cairo] [pixman/src/check-config.sh] Test that all source files #include <config.h>

Carl Worth cworth at cworth.org
Wed Apr 4 10:30:37 PDT 2007

On Tue,  3 Apr 2007 17:30:28 -0700 (PDT), wrote:
>     [pixman/src/check-config.sh] Test that all source files #include <config.h>
>     as their first include.
> +echo 'Checking source files for missing or misplaced #include <config.h>'
> +
> +find "$srcdir" -name '*.c' -or -name '*.cpp' |
> +while read x; do
> +	grep '\<include\>' "$x" /dev/null | head -n 1
> +done |
> +grep -v '<config.h>' |
> +grep . && status = 1

Oh, yuck! Not only do we have noise in the source files, but we also
enforce the noise to exist with a new test.

I don't like this stuff at all.

And why is pixman getting a separate idiom than cairo here?

>     [src] Make sure all source files #include "cairoint.h" as their first include
>     This is necessary to avoid many portability problems as cairoint.h includes
>     config.h.  Without a test, we will regress again, hence add it.

This approach seems a lot more reasonable to me, and matches the idiom
that has always been intended, (that is, that a header file would be
included that did the ugly, ifdef'ed include of config.h).

So this change looks good to me, (though again, cairo-private.h
instead of cairoint.h would better match our current
sensibilities). Why don't we do something similar for pixman?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070404/d11525e2/attachment.pgp

More information about the cairo mailing list