git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b53872)
Further fix interaction of Perl and stdbool.h
2018年3月23日 20:31:49 +0000 (16:31 -0400)
2018年3月23日 20:31:49 +0000 (16:31 -0400)
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.


diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h
index 05bdf7c1157bf120c86b0afb90a243e1f1b9c46c..843331e9dd3848daa3490053a6826bcd687017b2 100644 (file)
--- a/src/pl/plperl/plperl.h
+++ b/src/pl/plperl/plperl.h
@@ -50,6 +50,18 @@
#define __inline__ inline
#endif
+/*
+ * Regarding bool, both PostgreSQL and Perl might use stdbool.h or not,
+ * depending on configuration. If both agree, things are relatively harmless.
+ * If not, things get tricky. If PostgreSQL does but Perl does not, define
+ * HAS_BOOL here so that Perl does not redefine bool; this avoids compiler
+ * warnings. If PostgreSQL does not but Perl does, we need to undefine bool
+ * after we include the Perl headers; see below.
+ */
+#ifdef USE_STDBOOL
+#define HAS_BOOL 1
+#endif
+
/*
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /