From e7be25039e4923a3a28a708d0cc141136e80546e Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 1 Jul 2021 10:49:14 +0200 Subject: [PATCH] Fix build failure with newer ICU ICU 69 causes compile failures with PostgreSQL 10. ICU 69 has switched to using stdbool.h, which conflicts with the home-made definitions that we used until PostgreSQL 10. Newer PostgreSQL major versions are therefore not affected. (Older PostgreSQL versions don't have ICU support.) The workaround is to undefine "bool" after including ICU headers, similar to the solution already in place for plperl for the same underlying reasons. Discussion: https://www.postgresql.org/message-id/flat/28588e5a-c204-0361-01f1-a1ee1b590233%40enterprisedb.com --- src/backend/utils/adt/formatting.c | 4 ++++ src/backend/utils/adt/pg_locale.c | 4 ++++ src/include/utils/pg_locale.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 4e703d349f3..29ebc7831c5 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -84,6 +84,10 @@ #ifdef USE_ICU #include +/* ICU might have a different definition of "bool", don't buy it */ +#ifdef bool +#undef bool +#endif #endif #include "catalog/pg_collation.h" diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 7a12f84623e..bbf100e9fea 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -67,6 +67,10 @@ #ifdef USE_ICU #include +/* ICU might have a different definition of "bool", don't buy it */ +#ifdef bool +#undef bool +#endif #endif #ifdef WIN32 diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h index f3e04d4d8ce..21a047afbfa 100644 --- a/src/include/utils/pg_locale.h +++ b/src/include/utils/pg_locale.h @@ -17,6 +17,10 @@ #endif #ifdef USE_ICU #include +/* ICU might have a different definition of "bool", don't buy it */ +#ifdef bool +#undef bool +#endif #endif #include "utils/guc.h" -- 2.39.5