From b9a5a78fe9165a983bc689902ecc96cf490f92d0 Mon Sep 17 00:00:00 2001 From: Nicolas R Date: Wed, 13 Sep 2017 11:22:32 -0600 Subject: [PATCH] Switch some core modules to XSLoader RT 132080: Remove perl 5.006 compatibilities with DynaLoader and use XSLoader directly. The traditional boiler plate to use XSLoader for Perl > 5.006 or DynaLoader, does not make sense for core modules in perl 5.28+. --- dist/PathTools/Changes | 1 + dist/PathTools/Cwd.pm | 19 +++++-------------- dist/Time-HiRes/Changes | 3 +++ dist/Time-HiRes/HiRes.pm | 8 ++++---- dist/Unicode-Normalize/Changes | 3 +++ dist/Unicode-Normalize/Normalize.pm | 8 ++++---- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/dist/PathTools/Changes b/dist/PathTools/Changes index c2ee7c1..edbe385 100644 --- a/dist/PathTools/Changes +++ b/dist/PathTools/Changes @@ -3,6 +3,7 @@ Revision history for Perl distribution PathTools. 3.69 - avoid loading modules repeatedly at runtime - replace 'use vars' by 'our' +- Switch to XSLoader from Dynaloader 3.68 - avoid warning from pre-5.8 code for detecting tainted values diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm index 0315622..6455196 100644 --- a/dist/PathTools/Cwd.pm +++ b/dist/PathTools/Cwd.pm @@ -2,7 +2,8 @@ package Cwd; use strict; use Exporter; -our $VERSION = '3.69'; + +our $VERSION = '3.70'; my $xs_version = $VERSION; $VERSION =~ tr/_//d; @@ -76,19 +77,9 @@ sub _vms_efs { # If loading the XS stuff doesn't work, we can fall back to pure perl -if(! defined &getcwd && defined &DynaLoader::boot_DynaLoader) { - eval {#eval is questionable since we are handling potential errors like - #"Cwd object version 3.48 does not match bootstrap parameter 3.50 - #at lib/DynaLoader.pm line 216." by having this eval - if ( $] >= 5.006 ) { - require XSLoader; - XSLoader::load( __PACKAGE__, $xs_version); - } else { - require DynaLoader; - push @ISA, 'DynaLoader'; - __PACKAGE__->bootstrap( $xs_version ); - } - }; +if(! defined &getcwd && defined &DynaLoader::boot_DynaLoader) { # skipped on miniperl + require XSLoader; + XSLoader::load( __PACKAGE__, $xs_version); } # Big nasty table of function aliases diff --git a/dist/Time-HiRes/Changes b/dist/Time-HiRes/Changes index 10af55b..2954d8b 100644 --- a/dist/Time-HiRes/Changes +++ b/dist/Time-HiRes/Changes @@ -1,5 +1,8 @@ Revision history for the Perl extension Time::HiRes. +1.9747 [???] + - Switch to XSLoader from Dynaloader + 1.9746 [2017-08-17] - Unreliable t/usleep.t and t/utime.t tests [rt.cpan.org #122819] Avoid testing for $dt = $t2 - $t1 and assuming $dt is less than diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm index db6afb6..0ed28a1 100644 --- a/dist/Time-HiRes/HiRes.pm +++ b/dist/Time-HiRes/HiRes.pm @@ -4,9 +4,9 @@ package Time::HiRes; use strict; require Exporter; -require DynaLoader; +use XSLoader (); -our @ISA = qw(Exporter DynaLoader); +our @ISA = qw(Exporter); our @EXPORT = qw( ); # More or less this same list is in Makefile.PL. Should unify. @@ -49,7 +49,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval stat lstat utime ); -our $VERSION = '1.9746'; +our $VERSION = '1.9747'; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -90,7 +90,7 @@ sub import { Time::HiRes->export_to_level(1, $this, @_); } -bootstrap Time::HiRes; +XSLoader::load( 'Time::HiRes', $XS_VERSION ); # Preloaded methods go here. diff --git a/dist/Unicode-Normalize/Changes b/dist/Unicode-Normalize/Changes index ead5b3e..22ec16e 100644 --- a/dist/Unicode-Normalize/Changes +++ b/dist/Unicode-Normalize/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Unicode::Normalize. +1.26 *** RELEASE DATE HERE *** + - Switch to XSLoader from Dynaloader + 1.25 Wed Dec 16 03:05:57 UTC 2015 - Fix Normalize.xs to work on releases earlier than 5.8. The problem was introduced in this module's version 1.24 diff --git a/dist/Unicode-Normalize/Normalize.pm b/dist/Unicode-Normalize/Normalize.pm index b53f5c7..adf3db5 100644 --- a/dist/Unicode-Normalize/Normalize.pm +++ b/dist/Unicode-Normalize/Normalize.pm @@ -16,7 +16,7 @@ use Carp; no warnings 'utf8'; -our $VERSION = '1.25'; +our $VERSION = '1.26'; our $PACKAGE = __PACKAGE__; our @EXPORT = qw( NFC NFD NFKC NFKD ); @@ -56,9 +56,9 @@ require Exporter; ##### The above part is common to XS and PP ##### -our @ISA = qw(Exporter DynaLoader); -require DynaLoader; -bootstrap Unicode::Normalize $VERSION; +our @ISA = qw(Exporter); +use XSLoader (); +XSLoader::load( 'Unicode::Normalize', $VERSION ); ##### The below part is common to XS and PP ##### -- 1.8.3.1