Re: libgnomeui patch
- From: Maciej Stachowiak <mjs noisehavoc org>
- To: Havoc Pennington <hp redhat com>
- Cc: Darin Adler <darin bentspoon com>, Maciej Stachowiak <mjs noisehavoc org>, Rodrigo Moya <rodrigo gnome-db org>, George Karabin <gkarabin pobox com>, Anders Carlsson <andersca gnu org>, gnome-2-0-list gnome org
- Subject: Re: libgnomeui patch
- Date: Mon, 5 Nov 2001 00:10:37 -0800
On 04Nov2001 01:26PM (-0500), Havoc Pennington wrote:
>
> Darin Adler <darin bentspoon com> writes:
> > The goal is to catch these problems when building libgnomevfs. I think that
> > the thing you propose would only catch problems later, when clients use
> > gnome-vfs.
Havoc & Darin,
Between you guys you have shamed me into writing the script. Never
again will gnome-vfs headers do bogus includes of other gnome-vfs
headers (so long as people run `make check' anyway).
> For example, in the module headers:
>
> #define GNOME_VFS_MODULE_HEADER_INCLUDED
>
> In the regular headers:
>
> #ifdef GNOME_VFS_INSIDE_GNOME_VFS_BUILD
> #ifdef GNOME_VFS_MODULE_HEADER_INCLUDED
> #error "screwup"
> #endif
> #endif
>
> In Makefile.am for libgnomevfs itself:
>
> -DGNOME_VFS_INSIDE_GNOME_VFS_BUILD
>
> Then you probably have to always include the libgnomevfs headers
> before the module headers inside gnome-vfs itself (this restriction is
> the reason for GNOME_VFS_INSIDE_GNOME_VFS_BUILD, instead of just
> categorically forbidding the module headers), but not a big deal.
Hi Havoc,
Your idea of implementing the check program in cpp instead of
something like perl and embedding it inside the headers is pretty
clever. However, I found it about as easy to do it in perl, and I
think the result has easier to read output and is more robust.
The down side to the cpp approach is that it duplicates the info about
which headers are public, private and module, in the headers
themselves, but does not ensure it is in sync with what Makefile.am
has to say about this. This means that if you ever make a private
header public, you will have to remember to edit the header to catch
whether it's including other private headers.
I decided to do a tiny bit more programming up front to prevent more
possible mistakes later.
Regards,
Maciej
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]