Expose some short form macros unconditionally #23610
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Until C99 we couldn't use the type of macro we have that hides the need for thread context to call a function that needed both a thread context parameter and a format with varying numbers of parameters. Therefore you had to call the function directly with aTHX_. For some such functions, there were parallel functions created that omitted the thread context parameter (re-deriving it themselves). And there were compatibility macros created that called these. So, for example warn() would call Perl_warn_nocontext().
That changed in C99, and the calls in core to such functions were changed to use the macro that now expanded to Perl_warn().
Not all functions with this problem had '_nocontext()' versions. It turns out that the way the macros were #defined in embed.h, a definition existed for core, and non-threaded builds, but not threaded ones. This meant that, likely unknown to you, if you wrote an XS module, and used one of those macros, such as ck_warner(), it would compile and run on a non-threaded system, but would not compile on a threaded build.
Commits 13e5ba4 and d933027 did not affect the '_nocontext()' versions. This commit exposes their macros to the public. There is no need to worry about breaking existing code, as these macros existed only on non-threaded builds, and they still work there. They now work on threaded builds as well, as long as you have an aTHX variable available. This is no different than any newly created macro for which we are also requiring aTHX availability.