This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/apicheck.pl: Handle macros with trailing '_'
authorKarl Williamson <khw@cpan.org>
Tue, 6 Aug 2019 21:50:56 +0000 (15:50 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:29 +0000 (16:39 -0600)
The underscore represents a comma when expanded.  This commit makes this
program handle it.

(cherry picked from commit 12c850af3cce16d98a6a316b41a6992cfe6c6bda)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/apicheck.pl

index cf30070..24132d6 100644 (file)
@@ -333,6 +333,12 @@ for $f (@f) {   # Loop through all the tests to add
     $args = "($args)";
   }
 
+  # Single trailing underscore in name means is a comma operator
+  if ($f->{'name'} =~ /[^_]_$/) {
+    $aTHX_args .= ' 1';
+    $args .= ' 1';
+  }
+
   print OUT <<HEAD;
 /******************************************************************************
 *