diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-03-22 20:42:25 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-03-22 20:42:25 -0400 |
commit | 9a95a77d9d5d3003d2d67121f2731b6e5fc37336 (patch) | |
tree | 1f43f5ff016c3ee689c09030000c4a0e8bc25842 /src/pl/plperl/plperl.h | |
parent | 2a0faed9d7028e3830998bd6ca900be651274e27 (diff) | |
download | postgresql-9a95a77d9d5d3003d2d67121f2731b6e5fc37336.tar.gz postgresql-9a95a77d9d5d3003d2d67121f2731b6e5fc37336.zip |
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
Diffstat (limited to 'src/pl/plperl/plperl.h')
-rw-r--r-- | src/pl/plperl/plperl.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h index 6fe7803088e..a85aefea6c1 100644 --- a/src/pl/plperl/plperl.h +++ b/src/pl/plperl/plperl.h @@ -50,6 +50,11 @@ #define __inline__ inline #endif +/* + * Prevent perl from redefining "bool". + */ +#define HAS_BOOL 1 + /* * Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code @@ -91,11 +96,6 @@ #define NEED_sv_2pv_flags #include "ppport.h" -/* perl may have a different width of "bool", don't buy it */ -#ifdef bool -#undef bool -#endif - /* supply HeUTF8 if it's missing - ppport.h doesn't supply it, unfortunately */ #ifndef HeUTF8 #define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \ |