Fix build failure with newer ICU
authorPeter Eisentraut <[email protected]>
Thu, 1 Jul 2021 08:49:14 +0000 (10:49 +0200)
committerPeter Eisentraut <[email protected]>
Thu, 1 Jul 2021 08:54:44 +0000 (10:54 +0200)
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
src/backend/utils/adt/pg_locale.c
src/include/utils/pg_locale.h

index 4e703d349f36ef55d74f8b950c3df93ac39fda32..29ebc7831c59c08c2173b7306fb262473b4c5184 100644 (file)
 
 #ifdef USE_ICU
 #include <unicode/ustring.h>
+/* ICU might have a different definition of "bool", don't buy it */
+#ifdef bool
+#undef bool
+#endif
 #endif
 
 #include "catalog/pg_collation.h"
index 7a12f84623e0bf442ca8e920427e5b854dfdbcd7..bbf100e9feaec4038238b828ea10438721b15061 100644 (file)
 
 #ifdef USE_ICU
 #include <unicode/ucnv.h>
+/* ICU might have a different definition of "bool", don't buy it */
+#ifdef bool
+#undef bool
+#endif
 #endif
 
 #ifdef WIN32
index f3e04d4d8cee66c08bf848f8da067e97250878b4..21a047afbfa82bf5381e5274dc23d7336dd89db1 100644 (file)
 #endif
 #ifdef USE_ICU
 #include <unicode/ucol.h>
+/* ICU might have a different definition of "bool", don't buy it */
+#ifdef bool
+#undef bool
+#endif
 #endif
 
 #include "utils/guc.h"