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

Behdad Esfahbod behdad at behdad.org
Wed Apr 4 11:24:39 PDT 2007


On Wed, 2007-04-04 at 13:30 -0400, Carl Worth wrote:
> 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?

Ok.  I'm really sorry about all the noise and ugliness.  I can fix it if
you don't mind the extra noise.  Just let me know.

As for cairo-private.h vs cairoint.h, agreed, but we are currently using
cairo-private.h for cairo_t definition.  That can also live in cairo.c.

> -Carl
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list