forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7a0574b
committed
Fix ecpglib.h to declare bool consistently with c.h.
This completes the task begun in commit1408d5d, to synchronizeECPG's exported definitions with the definition of bool used byc.h (and, therefore, the one actually in use in the ECPG library).On practically all modern platforms, ecpglib.h will now justinclude <stdbool.h>, which should surprise nobody anymore.That removes a header-inclusion-order hazard for ECPG clients,who previously might get build failures or unexpected behaviordepending on whether they'd included <stdbool.h> themselves,and if so, whether before or after ecpglib.h.On platforms where sizeof(_Bool) is not 1 (only old PPC-basedMac systems, as far as I know), things are still messy, asinclusion of <stdbool.h> could still break ECPG client code.There doesn't seem to be any clean fix for that, and given theprobably-negligible population of users who would care anymore,it's not clear we should go far out of our way to cope with it.This change at least fixes some header-inclusion-order hazardsfor our own code, since c.h and ecpglib.h previously disagreedon whether bool should be char or unsigned char.To implement this with minimal invasion of ECPG client namespace,move the choice of whether to rely on <stdbool.h> into configure,and have it export a configuration symbol PG_USE_STDBOOL.ecpglib.h no longer exports definitions for TRUE and FALSE,only their lowercase brethren. We could undo that if we getpush-back about it.Ideally we'd back-patch this as far as v11, which is where c.hstarted to rely on <stdbool.h>. But the odds of creating problemsfor formerly-working ECPG client code seem about as large as theodds of fixing any non-working cases, so we'll just do this in HEAD.Discussion:https://postgr.es/m/CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com1 parentde7c2d3 commit7a0574b
File tree
10 files changed
+55
-21
lines changed- src
- backend/utils/fmgr
- include
- interfaces/ecpg/include
- pl/plperl
- tools/msvc
10 files changed
+55
-21
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14786 | 14786 |
| |
14787 | 14787 |
| |
14788 | 14788 |
| |
| 14789 | + | |
| 14790 | + | |
| 14791 | + | |
| 14792 | + | |
| 14793 | + | |
| 14794 | + | |
14789 | 14795 |
| |
14790 | 14796 |
| |
14791 | 14797 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1593 | 1593 |
| |
1594 | 1594 |
| |
1595 | 1595 |
| |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1596 | 1603 |
| |
1597 | 1604 |
| |
1598 | 1605 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
291 |
| - | |
| 291 | + | |
292 | 292 |
| |
293 | 293 |
| |
294 | 294 |
| |
295 | 295 |
| |
296 | 296 |
| |
297 | 297 |
| |
| 298 | + | |
| 299 | + | |
298 | 300 |
| |
299 | 301 |
| |
300 | 302 |
| |
301 | 303 |
| |
302 |
| - | |
| 304 | + | |
303 | 305 |
| |
304 |
| - | |
305 | 306 |
| |
306 | 307 |
| |
307 | 308 |
| |
| |||
316 | 317 |
| |
317 | 318 |
| |
318 | 319 |
| |
319 |
| - | |
| 320 | + | |
320 | 321 |
| |
321 | 322 |
| |
322 | 323 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
829 | 829 |
| |
830 | 830 |
| |
831 | 831 |
| |
| 832 | + | |
| 833 | + | |
| 834 | + | |
832 | 835 |
| |
833 | 836 |
| |
834 | 837 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
624 | 624 |
| |
625 | 625 |
| |
626 | 626 |
| |
| 627 | + | |
| 628 | + | |
| 629 | + | |
627 | 630 |
| |
628 | 631 |
| |
629 | 632 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 |
| |
14 | 17 |
| |
15 | 18 |
|
Lines changed: 24 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 |
| - | |
| 2 | + | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 |
| |
16 |
| - | |
17 |
| - | |
18 |
| - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
19 | 33 |
| |
20 | 34 |
| |
21 | 35 |
| |
22 |
| - | |
| 36 | + | |
| 37 | + | |
23 | 38 |
| |
24 | 39 |
| |
25 |
| - | |
26 |
| - | |
| 40 | + | |
27 | 41 |
| |
28 |
| - | |
29 |
| - | |
30 |
| - | |
| 42 | + | |
| 43 | + | |
31 | 44 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 | 45 |
| |
36 | 46 |
| |
37 | 47 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
| 67 | + | |
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| |||
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
178 |
| - | |
| 178 | + | |
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
513 | 513 |
| |
514 | 514 |
| |
515 | 515 |
| |
| 516 | + | |
516 | 517 |
| |
517 | 518 |
| |
518 | 519 |
| |
|
0 commit comments
Comments
(0)