forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9c27367
committed
Cope with <regex.h> name clashes.
macOS 15's SDK pulls in headers related to <regex.h> when we include<xlocale.h>. This causes our own regex_t implementation to clash withthe OS's regex_t implementation. Luckily our function names already hadpg_ prefixes, but the macros and typenames did not.Include <regex.h> explicitly on all POSIX systems, and fix everythingthat breaks. Then we can prove that we are capable of fully hiding andreplacing the system regex API with our own.1. Deal with standard-clobbering macros by undefining them all first.POSIX says they are "symbolic constants". If they are macros, thisallows us to redefine them. If they are enums or variables, our macroswill hide them.2. Deal with standard-clobbering types by giving our types pg_prefixes, and then using macros to redirect xxx_t -> pg_xxx_t.After including our "regex/regex.h", the system <regex.h> is hidden,because we've replaced all the standard names. The PostgreSQL sourcetree and extensions can continue to use standard prefix-less type andmacro names, but reach our implementation, if they included our"regex/regex.h" header.Back-patch to all supported branches, so that macOS 15's tool chain canbuild them.Reported-by: Stan Hu <stanhu@gmail.com>Suggested-by: Tom Lane <tgl@sss.pgh.pa.us>Tested-by: Aleksander Alekseev <aleksander@timescale.com>Discussion:https://postgr.es/m/CAMBWrQnEwEJtgOv7EUNsXmFw2Ub4p5P%2B5QTBEgYwiyjy7rAsEQ%40mail.gmail.com1 parent8af6958 commit9c27367
2 files changed
+95
-9
lines changedLines changed: 92 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
2 |
| - | |
| 1 | + | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
35 | 113 |
| |
36 | 114 |
| |
37 | 115 |
| |
| |||
45 | 123 |
| |
46 | 124 |
| |
47 | 125 |
| |
48 |
| - | |
| 126 | + | |
49 | 127 |
| |
50 | 128 |
| |
51 | 129 |
| |
| |||
79 | 157 |
| |
80 | 158 |
| |
81 | 159 |
| |
82 |
| - | |
| 160 | + | |
83 | 161 |
| |
84 | 162 |
| |
85 | 163 |
| |
86 | 164 |
| |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
90 | 168 |
| |
91 | 169 |
| |
92 | 170 |
| |
93 | 171 |
| |
94 |
| - | |
| 172 | + | |
95 | 173 |
| |
96 | 174 |
| |
97 | 175 |
| |
| |||
164 | 242 |
| |
165 | 243 |
| |
166 | 244 |
| |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
167 | 250 |
| |
168 | 251 |
| |
169 | 252 |
| |
| |||
186 | 269 |
| |
187 | 270 |
| |
188 | 271 |
| |
189 |
| - | |
| 272 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3696 | 3696 |
| |
3697 | 3697 |
| |
3698 | 3698 |
| |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
3699 | 3702 |
| |
3700 | 3703 |
| |
3701 | 3704 |
| |
|
0 commit comments
Comments
(0)