develooper Front page | perl.perl5.changes | Postings from August 2022

[Perl/perl5] c553ba: Avoid some confusion in regen/embed.pl byrenaming...

From:
Paul Evans via perl5-changes
Date:
August 3, 2022 16:55
Subject:
[Perl/perl5] c553ba: Avoid some confusion in regen/embed.pl byrenaming...
Message ID:
Perl/perl5/push/refs/heads/blead/182f0b-13e5ba@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: c553bad54cdfab778ac9527b43db5bf974d66cc5
      https://github.com/Perl/perl5/commit/c553bad54cdfab778ac9527b43db5bf974d66cc5
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M regen/embed.pl

  Log Message:
  -----------
  Avoid some confusion in regen/embed.pl by renaming the scalar $args to $argc


  Commit: 13e5ba49b2cfe0add44db552ecbebb2f785aecbc
      https://github.com/Perl/perl5/commit/13e5ba49b2cfe0add44db552ecbebb2f785aecbc
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M embed.h
    M regen/embed.pl

  Log Message:
  -----------
  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.


Compare: https://github.com/Perl/perl5/compare/182f0ba91d53...13e5ba49b2cf



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About