This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Emit __VA_ARGS__-using macros into embed.h when on PERL_CORE
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>
Thu, 7 Jul 2022 16:21:46 +0000 (17:21 +0100)
committerPaul Evans <leonerd@leonerd.org.uk>
Wed, 3 Aug 2022 16:55:01 +0000 (17:55 +0100)
commit13e5ba49b2cfe0add44db552ecbebb2f785aecbc
treebd9fe5a72be617cbdfc74fddec2f4adefd63da4c
parentc553bad54cdfab778ac9527b43db5bf974d66cc5
Emit __VA_ARGS__-using macros into embed.h when on PERL_CORE

Now we're using C99, we can safely use the __VA_ARGS__ expansion in
these variable-list macros.

Unfortunately we can't just emit them unconditionally, because much
existing CPAN code exists that thinks it can call e.g. `warn()` without
an aTHX_ in scope (because they don't #define PERL_NO_GET_CONTEXT).

Therefore, we have to guard these new macro forms by

  ... || defined(PERL_CORE)

and continue to emit the "..._nocontext()" variants at the end of the
file, as we previously did.

It's not a great solution but it at least means we can use `croak()`,
`warn()`, et.al. within perl core source now.
embed.h
regen/embed.pl