Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 6a9f2d68fa21f9c2eee4afc641fecb76509da0fc https://github.com/Perl/perl5/commit/6a9f2d68fa21f9c2eee4afc641fecb76509da0fc Author: Karl Williamson <k...@cpan.org> Date: 2025-08-27 (Wed, 27 Aug 2025)
Changed paths: M embed.fnc M embed.h Log Message: ----------- Expose some short form macros unconditionally 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 13e5ba49b2cfe0add44db552ecbebb2f785aecbc and d933027ef0a56c99aee8cc3c88ff4f9981ac9fc2 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. To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications