forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit032627e
committed
Clean up PL/Perl's handling of the _() macro.
Perl likes to redefine the _() macro:#ifdef CAN_PROTOTYPE#define_(args) args#else ...There was lots not to like about the way we dealt with this before:1. Instead of taking care of the conflict centrally in plperl.h, weexpected every one of its ever-growing number of includers to do so.This is duplicative and error-prone in itself, plus it means thatplperl.h fails to meet the expectation of being compilable standalone,resulting in macro-redefinition warnings in cpluspluscheck.2. We left _() with its Perl definition, meaning that if someone triedto use it in any Perl-related extension, it would silently fail toprovide run-time translation. I don't see any live bugs of this ilk,but it's clearly a hard-to-notice bug waiting to happen.So fix that by centralizing the cleanup logic, making it match whatwe're already doing for other macro conflicts with Perl. Since we onlyexpect plperl.h to be included by extensions not core code, we shouldredefine _() as dgettext() not gettext().1 parent135063e commit032627e
File tree
6 files changed
+17
-15
lines changed- contrib
- hstore_plperl
- jsonb_plperl
- src/pl/plperl
6 files changed
+17
-15
lines changedLines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 |
| - | |
5 | 3 |
| |
| 4 | + | |
6 | 5 |
| |
7 | 6 |
| |
8 |
| - | |
9 | 7 |
| |
10 | 8 |
| |
11 | 9 |
| |
|
Lines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
6 |
| - | |
7 |
| - | |
8 | 5 |
| |
9 | 6 |
| |
10 | 7 |
| |
|
Lines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
14 |
| - | |
15 |
| - | |
16 | 13 |
| |
17 | 14 |
| |
18 | 15 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| 15 | + | |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 | 20 |
| |
23 | 21 |
| |
24 | 22 |
| |
|
Lines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 |
| - | |
12 |
| - | |
13 | 10 |
| |
14 | 11 |
| |
15 | 12 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 |
| |
42 | 47 |
| |
43 | 48 |
| |
| |||
140 | 145 |
| |
141 | 146 |
| |
142 | 147 |
| |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
143 | 158 |
| |
144 | 159 |
| |
145 | 160 |
| |
|
0 commit comments
Comments
(0)