From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use stdbool.h if suitable
Date: Fri, 23 Mar 2018 00:42:39 +0000
Message-ID: <E1ezAn1-0006T7-HC@gemulon.postgresql.org> (raw)
Use stdbool.h if suitable
Using the standard bool type provided by C allows some recent compilers
and debuggers to give better diagnostics. Also, some extension code and
third-party headers are increasingly pulling in stdbool.h, so it's
probably saner if everyone uses the same definition.
But PostgreSQL code is not prepared to handle bool of a size other than
1, so we keep our own old definition if we encounter a stdbool.h with a
bool of a different size. (Among current build farm members, this only
applies to old macOS versions on PowerPC.)
To check that the used bool is of the right size, add a static
assertions about size of GinTernaryValue vs bool. This is currently the
only place that assumes that bool and char are of the same size.
Discussion: https://www.postgresql.org/message-id/flat/3a0fe7e1-5ed1-414b-9230-53bbc0ed1f49@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9a95a77d9d5d3003d2d67121f2731b6e5fc37336
Modified Files
--------------
src/backend/utils/adt/tsginidx.c | 4 +++-
src/include/access/gin.h | 4 ++--
src/include/c.h | 14 ++++++++++++--
src/include/pg_config.h.win32 | 9 +++++++++
src/pl/plperl/plperl.h | 10 +++++-----
5 files changed, 31 insertions(+), 10 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: pgsql: Use stdbool.h if suitable
In-Reply-To: <E1ezAn1-0006T7-HC@gemulon.postgresql.org>
References: <E1ezAn1-0006T7-HC@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox