bool exported to user namespace
bool exported to user namespace
От:
Ewan Mellor <em@nexus.co.uk>
Дата:
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.