From: Rafael Garcia-Suarez Date: Sat, 2 Jul 2005 07:41:14 +0000 (+0000) Subject: Upgrade to Time::HiRes 1.72 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0cf8ddea3351f0ff9eef736dfa13bc866d0d1f97;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Time::HiRes 1.72 p4raw-id: //depot/perl@25044 --- diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes index 8c148df..4b73101 100644 --- a/ext/Time/HiRes/Changes +++ b/ext/Time/HiRes/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension Time::HiRes. +1.72 - going back to the 1.68 loader setup (using DynaLoader) + since too many weird things starting breaking + - fix a typo in José Auguste-Etienne's name + 1.71 - a thinko in the nanosleep() detection - move more changes stuff from the README to Changes - add -w to the Makefile.PL @@ -17,8 +21,12 @@ Revision history for Perl extension Time::HiRes. (realtime POSIX?) libs and whatnot, but in the general case running a real test case is better. (Of course, this change will no doubt run into portability problems because of the - execution step...) - (from José Auguste-tienne) + execution step...) Note that because of hysterical raisins + most Perls do NOT have $Config{d_nanosleep} (scanning for + it by Configure would in many platforms require linking in + things like -lrt, which would in many platforms be a bad idea + for Perl itself). + (from José Auguste-Etienne) - support XSLoader also since it's much faster (from Alexey Tourbin) - add SEE ALSO (BSD::Resource and Time::TAI64) diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index 0cbbba4..4936dad 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -6,7 +6,7 @@ use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); require Exporter; require DynaLoader; -@ISA = qw(Exporter); +@ISA = qw(Exporter DynaLoader); @EXPORT = qw( ); @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval @@ -15,7 +15,7 @@ require DynaLoader; d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer d_nanosleep); -$VERSION = '1.71'; +$VERSION = '1.72'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -24,7 +24,10 @@ sub AUTOLOAD { ($constname = $AUTOLOAD) =~ s/.*:://; die "&Time::HiRes::constant not defined" if $constname eq 'constant'; my ($error, $val) = constant($constname); - if ($error) { die $error; } + if ($error) { + my (undef,$file,$line) = caller; + die "$error at $file line $line.\n"; + } { no strict 'refs'; *$AUTOLOAD = sub { $val }; @@ -32,15 +35,7 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -eval { - require XSLoader; - XSLoader::load('Time::HiRes', $XS_VERSION); - 1; -} or do { - require DynaLoader; - local @ISA = qw(DynaLoader); - bootstrap Time::HiRes $XS_VERSION; -}; +bootstrap Time::HiRes; # Preloaded methods go here. @@ -119,9 +114,9 @@ C<&Time::HiRes::d_nanosleep> to see whether you have nanosleep, and then carefully read your C C API documentation for any peculiarities. -Unless using C for mixing sleeping with signals, give -some thought to whether Perl is the tool you should be using for -work requiring nanosecond accuracies. +If you are using C for something else than mixing sleeping +with signals, give some thought to whether Perl is the tool you should +be using for work requiring nanosecond accuracies. The following functions can be imported from this module. No functions are exported by default. @@ -386,7 +381,7 @@ G. Aas Copyright (c) 1996-2002 Douglas E. Wegscheid. All rights reserved. -Copyright (c) 2002,2003,2004,2005 Jarkko Hietaniemi. All rights reserved. +Copyright (c) 2002, 2003, 2004, 2005 Jarkko Hietaniemi. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL index 7262381..f7d62fd 100644 --- a/ext/Time/HiRes/Makefile.PL +++ b/ext/Time/HiRes/Makefile.PL @@ -153,7 +153,7 @@ sub try_compile_and_link { $ok = 1; } else { $ok = 0; - print "system('$abs_tmp_exe') failed: $?\n"; + print "[ system('$abs_tmp_exe') failed: status $? ] "; } } unlink("$tmp.c", $tmp_exe); diff --git a/ext/Time/HiRes/t/HiRes.t b/ext/Time/HiRes/t/HiRes.t index 617468e..3bc58ed 100644 --- a/ext/Time/HiRes/t/HiRes.t +++ b/ext/Time/HiRes/t/HiRes.t @@ -14,7 +14,7 @@ BEGIN { BEGIN { $| = 1; print "1..28\n"; } -END {print "not ok 1\n" unless $loaded;} +END { print "not ok 1\n" unless $loaded } use Time::HiRes qw(tv_interval);