8000 Fix build failure with newer ICU · postgres/postgres@e7be250 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7be250

Browse files
committed
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
1 parent d8569db commit e7be250

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@
8484

8585
#ifdef USE_ICU
8686
#include <unicode/ustring.h>
87+
/* ICU might have a different definition of "bool", don't buy it */
88+
#ifdef bool
89+
#undef bool
90+
#endif
8791
#endif
8892

8993
#include "catalog/pg_collation.h"

src/backend/utils/adt/pg_locale.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767

6868
#ifdef USE_ICU
6969
#include <unicode/ucnv.h>
70+
/* ICU might have a different definition of "bool", don't buy it */
71+
#ifdef bool
72+
#undef bool
73+
#endif
7074
#endif
7175

7276
#ifdef WIN32

src/include/utils/pg_locale.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#endif
1818
#ifdef USE_ICU
1919
#include <unicode/ucol.h>
20+
/* ICU might have a different definition of "bool", don't buy it */
21+
#ifdef bool
22+
#undef bool
23+
#endif
2024
#endif
2125

2226
#include "utils/guc.h"

0 commit comments

Comments
 (0)
0