From: Tom Lane Date: Sun, 9 Sep 2018 16:41:27 +0000 (-0400) Subject: Work around stdbool problem in dfmgr.c. X-Git-Tag: REL_12_BETA1~1591 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff47d4bf1f208227a2e087ef7269e88285fa257e;p=postgresql Work around stdbool problem in dfmgr.c. Commit 842cb9fa6 refactored things so that dfmgr.c includes , which before that had only been directly included in platform-specific stub files. It turns out that on macOS, includes , 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 --- diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index c2a257258d..4a5cc7cfc7 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -18,7 +18,17 @@ #ifdef HAVE_DLOPEN #include + +/* + * On macOS, insists on including . 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"