Re: [gnome-db] gda-decl.h
- From: Murray Cumming <murrayc murrayc com>
- To: Vivien Malerba <vmalerba gmail com>
- Cc: gnome-db-list <gnome-db-list gnome org>
- Subject: Re: [gnome-db] gda-decl.h
- Date: Wed, 06 Dec 2006 12:32:46 +0100
On Thu, 2006-11-30 at 15:24 +0100, Vivien Malerba wrote:
> On 11/30/06, Murray Cumming <murrayc murrayc com> wrote:
> > On Thu, 2006-11-30 at 14:51 +0100, Vivien Malerba wrote:
> > > On 11/30/06, Murray Cumming <murrayc murrayc com> wrote:
> > > > Why on earth are all the struct prototype declarations in gda-decl.h
> > > > instead of the headers of their classes?
> > >
> > > To make it easy for the header files inclusion for example when A.h
> > > needs some declaration in B.h and B.h needs some which is A.h (I don't
> > > have any precise example at hand but there must be some).
> >
> > In this case (circular includes), the prototype declaration for A or B
> > should just be repeated.
> >
> > I'm going to put these prototypes declarations in their normal places,
> > if you don't object. If it builds while doing this normally, then I will
> > have proved that it's not necessary.
> >
>
> Ok, great!
Oh, well, I proved me wrong.
In C++, you can (and should) repeat the
typedef struct _Something Something
declarations instead of including the full header.
But C doesn't like that. It complains about duplicate declarations.
Using a common header is effectively the same thing with one difference:
You can use a header guard to prevent duplicate declarations.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]