Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 66ee851

Browse files
committed
Further fix interaction of Perl and stdbool.h
In the case that PostgreSQL uses stdbool.h but Perl doesn't, we need to prevent Perl from defining bool, to prevent compiler warnings about redefinition.
1 parent 4b53872 commit 66ee851

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pl/plperl/plperl.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@
5050
#define __inline__ inline
5151
#endif
5252

53+
/*
54+
* Regarding bool, both PostgreSQL and Perl might use stdbool.h or not,
55+
* depending on configuration. If both agree, things are relatively harmless.
56+
* If not, things get tricky. If PostgreSQL does but Perl does not, define
57+
* HAS_BOOL here so that Perl does not redefine bool; this avoids compiler
58+
* warnings. If PostgreSQL does not but Perl does, we need to undefine bool
59+
* after we include the Perl headers; see below.
60+
*/
61+
#ifdef USE_STDBOOL
62+
#define HAS_BOOL 1
63+
#endif
64+
5365

5466
/*
5567
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code

0 commit comments

Comments
 (0)