bool exported to user namespace - Mailing list pgsql-hackers

From Ewan Mellor
Subject bool exported to user namespace
Date
Msg-id 357C09BB.7D7BC1D7@nexus.co.uk
Whole thread Raw
List pgsql-hackers
In interfaces/libpq/libpq-fe.h there is this well-meaning comment:

/*
 * We can't use the conventional "bool", because we are designed to be
 * included in a user's program, and user may already have that type
 * defined.  Pqbool, on the other hand, is unlikely to be used.
 */

Unfortunately, libpq-fe.h includes libpq/pgcomm.h, which in turn
includes c.h, which defines the bool type.  This causes me problems as
the code I am working with also defines bool.

Of c.h, the only section that pqcomm.h requires is section 3 (standard
system types).  What I have done locally, therefore, is to move that
section into a new file (sys_types.h) and include that from pqcomm.h
instead of c.h.  Does this solution seem reasonable, or does anyone have
a different idea about the way the include files should be arranged?  If
there are no objections, I can submit a patch if you want.

Ewan Mellor.

pgsql-hackers by date:

Previous
From: Oleg Broytmann
Date:
Subject: Re: [HACKERS] backend now show status in 'ps'
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] keeping track of connections