diff options
author | Tomasz Konojacki <me@xenu.pl> | 2019-07-15 23:36:40 +0200 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-08-15 11:38:31 +1000 |
commit | 6abf31dff474e18c0edb8741e9ab319599bf6894 (patch) | |
tree | 694c40a455584aa115f5464d27e39089c9d41b0e /dist/Time-HiRes | |
parent | 708180a33d23470bc69d1bb1cd9ef17cc3198a68 (diff) | |
download | perl-6abf31dff474e18c0edb8741e9ab319599bf6894.tar.gz |
Time::HiRes: remove code for perls older than 5.6
Both Makefile.PL and HiRes.pm contain "use 5.006", so it was dead
code anyway.
[perl #134288]
Diffstat (limited to 'dist/Time-HiRes')
-rw-r--r-- | dist/Time-HiRes/HiRes.xs | 13 | ||||
-rw-r--r-- | dist/Time-HiRes/Makefile.PL | 61 |
2 files changed, 6 insertions, 68 deletions
diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs index de2061aae1..3cc70533e9 100644 --- a/dist/Time-HiRes/HiRes.xs +++ b/dist/Time-HiRes/HiRes.xs @@ -229,15 +229,6 @@ _gettimeofday(pTHX_ struct timeval *tp, void *not_used) } #endif /* #if defined(WIN32) || defined(CYGWIN_WITH_W32API) */ -#if defined(WIN32) && !defined(ATLEASTFIVEOHOHFIVE) -static unsigned int -sleep(unsigned int t) -{ - Sleep(t*1000); - return 0; -} -#endif - #if !defined(HAS_GETTIMEOFDAY) && defined(VMS) # define HAS_GETTIMEOFDAY @@ -1023,15 +1014,13 @@ BOOT: #ifdef MY_CXT_KEY MY_CXT_INIT; #endif -#ifdef ATLEASTFIVEOHOHFIVE -# ifdef HAS_GETTIMEOFDAY +#ifdef HAS_GETTIMEOFDAY { (void) hv_store(PL_modglobal, "Time::NVtime", 12, newSViv(PTR2IV(myNVtime)), 0); (void) hv_store(PL_modglobal, "Time::U2time", 12, newSViv(PTR2IV(myU2time)), 0); } -# endif #endif #if defined(PERL_DARWIN) # if defined(USE_ITHREADS) && defined(PERL_DARWIN_MUTEX) diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL index 0245eaa8d9..da5c1b53f5 100644 --- a/dist/Time-HiRes/Makefile.PL +++ b/dist/Time-HiRes/Makefile.PL @@ -11,6 +11,8 @@ use Config; use ExtUtils::MakeMaker; use strict; +use File::Spec; + my $VERBOSE = $ENV{VERBOSE}; my $DEFINE; my $LIBS = []; @@ -29,55 +31,6 @@ unless($ENV{PERL_CORE}) { $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV; } -# Perls 5.002 and 5.003 did not have File::Spec, fake what we need. - -sub my_dirsep { - $^O eq 'VMS' ? '.' : - $^O =~ /mswin32|netware|djgpp/i ? '\\' : - $^O eq 'MacOS' ? ':' - : '/'; -} - -sub my_catdir { - shift; - my $catdir = join(my_dirsep, @_); - $^O eq 'VMS' ? "[$catdir]" : $catdir; -} - -sub my_catfile { - shift; - return join(my_dirsep, @_) unless $^O eq 'VMS'; - my $file = pop; - return my_catdir (undef, @_) . $file; -} - -sub my_updir { - shift; - $^O eq 'VMS' ? "-" : ".."; -} - -BEGIN { - eval { require File::Spec }; - if ($@) { - *File::Spec::catdir = \&my_catdir; - *File::Spec::updir = \&my_updir; - *File::Spec::catfile = \&my_catfile; - } -} - -# Avoid 'used only once' warnings. -my $nop1 = *File::Spec::catdir; -my $nop2 = *File::Spec::updir; -my $nop3 = *File::Spec::catfile; - -# if you have 5.004_03 (and some slightly older versions?), xsubpp -# tries to generate line numbers in the C code generated from the .xs. -# unfortunately, it is a little buggy around #ifdef'd code. -# my choice is leave it in and have people with old perls complain -# about the "Usage" bug, or leave it out and be unable to compile myself -# without changing it, and then I'd always forget to change it before a -# release. Sorry, Edward :) - sub try_compile_and_link { my ($c, %args) = @_; @@ -889,17 +842,12 @@ EOM sub doMakefile { my @makefileopts = (); - if ($] >= 5.005) { - push (@makefileopts, - 'AUTHOR' => 'Jarkko Hietaniemi <jhi@iki.fi>', - 'ABSTRACT_FROM' => 'HiRes.pm', - ); - DEFINE('ATLEASTFIVEOHOHFIVE'); - } DEFINE('USE_PPPORT_H') unless $ENV{PERL_CORE}; push (@makefileopts, 'NAME' => 'Time::HiRes', + 'AUTHOR' => 'Jarkko Hietaniemi <jhi@iki.fi>', + 'ABSTRACT_FROM' => 'HiRes.pm', 'VERSION_FROM' => 'HiRes.pm', # finds $VERSION 'LIBS' => $LIBS, # e.g., '-lm' 'DEFINE' => $DEFINE, # e.g., '-DHAS_SOMETHING' @@ -916,6 +864,7 @@ sub doMakefile { 'Test::More' => 0, 'XSLoader' => 0, 'strict' => 0, + 'File::Spec' => 0, }, 'dist' => { 'CI' => 'ci -l', |