aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-09-09 12:41:27 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-09-09 12:41:27 -0400
commitff47d4bf1f208227a2e087ef7269e88285fa257e (patch)
tree917413150b4d05e11322302d9deefbee198fcff1 /src
parented0cdf0e05134d1084b01bf8a77e9e1dc5081f91 (diff)
downloadpostgresql-ff47d4bf1f208227a2e087ef7269e88285fa257e.tar.gz
postgresql-ff47d4bf1f208227a2e087ef7269e88285fa257e.zip
Work around stdbool problem in dfmgr.c.
Commit 842cb9fa6 refactored things so that dfmgr.c includes <dlfcn.h>, which before that had only been directly included in platform-specific stub files. It turns out that on macOS, <dlfcn.h> includes <stdbool.h>, and that causes problems on platforms where _Bool is not char-sized ... which happens to include the PPC versions of macOS. Work around it much as we have in plperl.h, by #undef'ing bool after including the problematic file, but only if we're not using stdbool-style booleans. Discussion: https://postgr.es/m/E1fxqjl-0003YS-NS@gemulon.postgresql.org
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/fmgr/dfmgr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index c2a257258de..4a5cc7cfc7f 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -18,7 +18,17 @@
#ifdef HAVE_DLOPEN
#include <dlfcn.h>
+
+/*
+ * On macOS, <dlfcn.h> insists on including <stdbool.h>. If we're not
+ * using stdbool, undef bool to undo the damage.
+ */
+#ifndef USE_STDBOOL
+#ifdef bool
+#undef bool
+#endif
#endif
+#endif /* HAVE_DLOPEN */
#include "fmgr.h"
#include "lib/stringinfo.h"