This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PPPort_pm.PL: Prototypes differing only in pTHX_
authorKarl Williamson <khw@cpan.org>
Fri, 12 Jul 2019 16:43:35 +0000 (10:43 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:30 +0000 (16:39 -0600)
Use special wording for these, as this can be an unavoidable issue for
very early perls that don't port thread context back that far.

(cherry picked from commit b8a73dca70de398e16e70857f461cc88d99ac5c8)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/PPPort_pm.PL

index b2fb34a..2eee616 100644 (file)
@@ -286,7 +286,14 @@ sub expand_pp_expr
     my $proto = make_prototype($e);
     if (exists $prototypes{$func}) {
       if (compare_prototypes($proto, $prototypes{$func})) {
-        check(1, "differing prototypes for $func:\n  API: $proto\n  PPP: $prototypes{$func}");
+        my $proto_no_pTHX = $proto;
+        $proto_no_pTHX =~ s/pTHX_\s*//;
+        if (compare_prototypes($proto_no_pTHX, $prototypes{$func})) {
+            check(1, "differing prototypes for $func:\n  API: $proto\n  PPP: $prototypes{$func}");
+        }
+        else {
+            check(1, "prototypes differ in pTHX_ for $func:\n  API: $proto\n  PPP: $prototypes{$func}");
+        }
         $proto = $prototypes{$func};
       }
     }