Re: pgsql: Refactor dlopen() support

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Refactor dlopen() support
Дата
Msg-id 22629.1536354791@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Refactor dlopen() support  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 07/09/2018 16:19, Tom Lane wrote:
>> Somehow or other, the changes you made in dfmgr.c's #include lines
>> have made it so that find_rendezvous_variable's local "bool found"
>> variable is actually of type _Bool (which is word-wide on these
>> machines).

> Ah because dlfcn.h includes stdbool.h.  Hmm.

Yeah, and that's still true as of current macOS, it seems.

I can make the problem go away with the attached patch (borrowed from
similar code in plperl.h).  It's kind of grotty but I'm not sure there's
a better way.

            regards, tom lane

diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index c2a2572..4a5cc7c 100644
*** a/src/backend/utils/fmgr/dfmgr.c
--- b/src/backend/utils/fmgr/dfmgr.c
***************
*** 18,24 ****
--- 18,34 ----

  #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"

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: libpq stricter integer parsing
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: libpq stricter integer parsing