This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport start_subparse
authorKarl Williamson <khw@cpan.org>
Mon, 15 Jul 2019 20:45:58 +0000 (14:45 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:29 +0000 (16:51 -0600)
(cherry picked from commit 59c0a72a7f36c9f3e2c0779f5affc420499252b8)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/PPPort_pm.PL
dist/Devel-PPPort/parts/inc/call
dist/Devel-PPPort/parts/inc/newCONSTSUB
dist/Devel-PPPort/parts/inc/subparse [new file with mode: 0644]

index ba9c50a..12f0f87 100644 (file)
@@ -792,6 +792,8 @@ __DATA__
 
 %include variables
 
+%include subparse
+
 %include newCONSTSUB
 
 %include magic_defs
index 2cba14b..69eec4a 100644 (file)
@@ -94,7 +94,7 @@ eval_pv(const char *p, I32 croak_on_error)
 #endif
 #endif
 
-#ifndef vload_module
+#if ! defined(vload_module) && defined(start_subparse)
 #if { NEED vload_module }
 
 void
@@ -137,16 +137,11 @@ vload_module(U32 flags, SV *name, SV *ver, va_list *args)
         COP * const ocurcop = PL_curcop;
         const int oexpect = PL_expect;
 
-#if { VERSION >= 5.004 }
         utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
-                veop, modname, imop);
-#elif { VERSION > 5.003 }
-        utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
-                veop, modname, imop);
-#else
-        utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
-                modname, imop);
+#if { VERSION > 5.003 }
+                veop,
 #endif
+                modname, imop);
         PL_expect = oexpect;
         PL_copline = ocopline;
         PL_curcop = ocurcop;
index 57c3a47..f5b744d 100644 (file)
@@ -52,13 +52,7 @@ newCONSTSUB(HV *stash, const char *name, SV *sv)
 
         newSUB(
 
-#if   { VERSION <  5.003_22 }
-                start_subparse(),
-#elif { VERSION == 5.003_22 }
-                start_subparse(0),
-#else  /* 5.003_23  onwards */
                 start_subparse(FALSE, 0),
-#endif
 
                 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
                 newSVOP(OP_CONST, 0, &PL_sv_no),   /* SvPV(&PL_sv_no) == "" -- GMB */
diff --git a/dist/Devel-PPPort/parts/inc/subparse b/dist/Devel-PPPort/parts/inc/subparse
new file mode 100644 (file)
index 0000000..0729c91
--- /dev/null
@@ -0,0 +1,29 @@
+################################################################################
+##
+##  Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
+##  Version 2.x, Copyright (C) 2001, Paul Marquess.
+##  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+##
+##  This program is free software; you can redistribute it and/or
+##  modify it under the same terms as Perl itself.
+##
+################################################################################
+
+=provides
+
+__UNDEFINED__
+
+=implementation
+
+#if   { VERSION <= 5.003_22 }
+#  undef start_subparse
+#  if { VERSION < 5.003_22 }
+__UNDEFINED__ start_subparse(a, b) Perl_start_subparse()
+#  else
+__UNDEFINED__ start_subparse(a, b) Perl_start_subparse(b)
+#  endif
+
+#if {VERSION < 5.003_07 }
+foo
+#endif
+#endif