forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit642e882
committed
plpython: Stop undefining _POSIX_C_SOURCE, _XOPEN_SOURCE
We undefined them to avoid warnings about macro redefinitions. But we haven'tfully followed the necessary include order, since at least147c248, in2011. Recently the combination of the include order rules not being followedand undefining _POSIX_C_SOURCE started to cause a compile failure, startingwith03023a2. Undefining _POSIX_C_SOURCE hides clock_gettime(), which isreferenced in an inline function as of03023a2, whereas it was a macrobefore.After seeing some evidence that undefining _POSIX_C_SOURCE et al isn'trequired, I tried to build postgres with plpython on most of our supportedplatforms (except DragonFlyBSD and Illumos, but similar systems were tested),with/without the #undefines. No compiler warning / behavioral difference.The oldest supported python version, 3.2, defines _POSIX_C_SOURCE to 200112Lad _XOPEN_SOURCE to 600, whereas newer versions of python use 200809L/700respectively. As _POSIX_C_SOURCE/_XOPEN_SOURCE will default to the neweroperating system on most platforms, it's possible that when using python 3.2new warnings would be emitted - but that seems acceptable.It's possible that this approach won't work on some older platforms. Butgetting rid of most of the include-order complexity seems promising, and it'san easily revertible patch if we end up having to go another way.Discussion:https://postgr.es/m/20230124165814.2njc7gnvubn2amh6@awork3.anarazel.de1 parent23c1232 commit642e882
1 file changed
+4
-14
lines changedLines changed: 4 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
16 |
| - | |
17 |
| - | |
18 |
| - | |
19 |
| - | |
20 |
| - | |
| 15 | + | |
| 16 | + | |
21 | 17 |
| |
| 18 | + | |
| 19 | + | |
22 | 20 |
| |
23 | 21 |
| |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 | 22 |
| |
33 | 23 |
| |
34 | 24 |
| |
|
0 commit comments
Comments
(0)