|
447 | 447 | : created that #defines 'foo' as 'Perl_foo'. This can be used to make
|
448 | 448 | : any macro have a long name, perhaps to avoid name collisions. If
|
449 | 449 | : instead you define the macro as 'PERL_FOO' (all uppercase), the
|
450 |
| -: embed.h entry will use all uppercase. |
451 |
| -: |
452 |
| -: It is particularly useful tp preserve backward compatibility when a |
453 |
| -: function is converted to be a macro (remembering to not create a macro |
454 |
| -: which evaluates its parameters more than once). Most of mathoms.c |
455 |
| -: could be converted to use this facility. When there is no thread |
456 |
| -: context involved, you just do something like |
457 |
| -: |
458 |
| -: #define Perl_foo(a, b, c) Perl_bar(a, b, 0, c) |
459 |
| -: |
460 |
| -: Otherwise consider this general case where there is a series of macros |
461 |
| -: that build on the previous ones by calling something with a different |
462 |
| -: name or with an extra parameter beyond what the previous one did: |
463 |
| -: |
464 |
| -: #define Perl_foo(mTHX, a) Perl_bar1(aTHX, a) |
465 |
| -: #define Perl_bar1(mTHX, a) Perl_bar2(aTHX, a, 0) |
466 |
| -: #define Perl_bar2(mTHX, a, b) Perl_bar3(aTHX, a, b, 0) |
467 |
| -: #define Perl_bar3(mTHX, a, b, c) Perl_func(aTHX_ a, b, c, 0) |
468 |
| -: |
469 |
| -: Use the formal parameter name 'mTHX,' (which stands for "macro thread |
470 |
| -: context") as the first in each macro definition, and call the next |
471 |
| -: macro in the sequence with 'aTHX,' (Note the commas). Eventually, the |
472 |
| -: sequence will end with a function call (or else there would be no need |
473 |
| -: for thread context). For that instead call it with 'aTHX_' (with an |
474 |
| -: underscore instead of a comma). |
| 450 | +: embed.h entry will use all uppercase. Without the T flag the behavior |
| 451 | +: is subject to change when both 'm' and 'p are specified. |
475 | 452 | :
|
476 | 453 | : suppress proto.h entry (actually, not suppressed, but commented out)
|
477 | 454 | : suppress entry in the list of exported symbols available on all
|
|
0 commit comments