pgsql: Fix interaction of Perl and stdbool.h

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix interaction of Perl and stdbool.h
Date: 2018-03-23 14:33:33
Message-ID: E1ezNl7-00064m-1M@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix interaction of Perl and stdbool.h

Revert the PL/Perl-specific change in
9a95a77d9d5d3003d2d67121f2731b6e5fc37336. We must not prevent Perl from
using stdbool.h when it has been built to do so, even if it uses an
incompatible size. Otherwise, we would be imposing our bool on Perl,
which will lead to crashes because of the size mismatch.

Instead, we undef bool after including the Perl headers, as we did
previously, but now only if we are not using stdbool.h ourselves.
Record that choice in c.h as USE_STDBOOL. This will also make it easier
to apply that coding pattern elsewhere if necessary.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7ba7986fb4364e889a705c9973fefa138650091c

Modified Files
--------------
src/include/c.h | 1 +
src/pl/plperl/plperl.h | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-03-23 15:49:10 Re: pgsql: Fix interaction of Perl and stdbool.h
Previous Message Peter Eisentraut 2018-03-23 14:25:04 pgsql: pg_resetwal: Prevent division-by-zero errors