Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 86d15ecefd7db989ba600cd491d1df700909be48
      
https://github.com/Perl/perl5/commit/86d15ecefd7db989ba600cd491d1df700909be48
  Author: Karl Williamson <[email protected]>
  Date:   2025-09-11 (Thu, 11 Sep 2025)

  Changed paths:
    M perl.h

  Log Message:
  -----------
  Add macro PERL_UNIQUE_NAME

This macro acts like a factory to produce a name from its argument that
also includes the line number.


  Commit: c4da28b08df3461eac29d13049528fd0df1a1e05
      
https://github.com/Perl/perl5/commit/c4da28b08df3461eac29d13049528fd0df1a1e05
  Author: Karl Williamson <[email protected]>
  Date:   2025-09-11 (Thu, 11 Sep 2025)

  Changed paths:
    M op.h

  Log Message:
  -----------
  Change names in OpTYPE_set() to avoid possible collisions

This uses the PERL_UNIQUE_NAME() macro created in the previous commit to
get unique names for variables in macro expansions.

Suppose you have

    #define foo STMT_START { ... } STMT_END

block, and have a variable 'bar' declared in it.  By first saying

    #define bar PERL_UNIQUE_NAME(bar)

'bar' will be replaced in the expansion of 'foo' by a unique value.

It is your responsibility to not have two 'bar' symbols in the same
program.  But if you forget, you will be warned by the compiler that
'bar' is redefined, so you can fix it
.


Compare: https://github.com/Perl/perl5/compare/1372fc7ec1f6...c4da28b08df3

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to