Skip to content

Commit

Permalink
Upgrade to Time-HiRes-1.9703
Browse files Browse the repository at this point in the history
p4raw-id: //depot/perl@29495
  • Loading branch information
smpeters committed Dec 9, 2006
1 parent 50caf62 commit f337060
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
15 changes: 12 additions & 3 deletions ext/Time/HiRes/Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Revision history for the Perl extension Time::HiRes.

1.9703 [2006-12-08]
- use int main(int argc, char **argv) consistently in Makefile.PL,
should help with
[rt.cpan.org #23868] nanosleep not detected under Mac OS 10.3.9 starting with Time::HiRes 1.96
- if someone still has the locale-broken Perl 5.8.0,
suggest that they upgrade their Perl

1.9702 [2006-12-06]
- restore the -DATLEASTFIVEOHOHFIVE
- restore the -DATLEASTFIVEOHOHFIVE, Win32 needed it still

1.9701 [2006-12-04]
- upgrade to ppport.h 3.10_02
Expand Down Expand Up @@ -87,14 +94,16 @@ Revision history for the Perl extension Time::HiRes.

Contributions for more systems (especially non-UNIX,
e.g. but not limited to: Win32, VMS, OS/2) gladly accepted.
(also more UNIX variants welcome: HP-UX? IRIX?)

Thanks to H.Merijn Brand, John Peacock, and Craig
Berry for brave beta testing.

1.91 [2006-09-29]
- ualarm() in SuSE 10.1 was overflowing after ~4.2 seconds,
possibly due to a glibc bug/feature, workaround by using the
setitimer() implementation of ualarm() if either useconds or
possibly due to a glibc bug/feature (suspected overflow at
2**32 microseconds?), workaround by using the setitimer()
implementation of ualarm() if either useconds or
interval > 999_999 (this case seems to vary between systems:
are useconds more than 999_999 for ualarm() defined or not)
Added more ualarm() tests to catch various overflow points,
Expand Down
2 changes: 1 addition & 1 deletion ext/Time/HiRes/HiRes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require DynaLoader;
stat
);

$VERSION = '1.9702';
$VERSION = '1.9703';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down
31 changes: 17 additions & 14 deletions ext/Time/HiRes/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static int foo()
struct timeval tv;
gettimeofday(&tv, 0);
}
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
foo();
}
Expand Down Expand Up @@ -233,7 +233,7 @@ sub has_x {
# include <sys/time.h>
#endif
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
$x;
}
Expand All @@ -253,7 +253,7 @@ sub has_nanosleep {
/* int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); */
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct timespec ts1, ts2;
int ret;
ts1.tv_sec = 0;
Expand All @@ -276,7 +276,7 @@ sub has_include {
#include "XSUB.h"
#include <$inc>
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
return 0;
}
Expand All @@ -293,7 +293,7 @@ sub has_clock_xxx_syscall {
#include "perl.h"
#include "XSUB.h"
#include <$SYSCALL_H>
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
struct timespec ts;
/* Many Linuxes get ENOSYS even though the syscall exists. */
Expand All @@ -311,7 +311,7 @@ sub has_clock_xxx {
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
struct timespec ts;
int ret = clock_$xxx(CLOCK_REALTIME, &ts); /* Many Linuxes get ENOSYS. */
Expand All @@ -327,7 +327,7 @@ sub has_clock {
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
clock_t tictoc;
clock_t ret = clock();
Expand All @@ -342,7 +342,7 @@ sub has_clock_nanosleep {
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main _((int argc, char** argv, char** env))
int main(int argc, char** argv)
{
int ret;
struct timerspec ts1;
Expand Down Expand Up @@ -601,12 +601,14 @@ EOD
print "NOT found.\n";
}

print "Looking for stat() subsecond timestamps...\n";

print "Trying struct stat st_atimespec.tv_nsec...";
my $has_stat_st_xtimespec;
if (try_compile_and_link(<<EOM)) {
$TIME_HEADERS
#include <sys/stat.h>
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct stat st;
st.st_atimespec.tv_nsec = 0;
}
Expand All @@ -626,7 +628,7 @@ EOM
if (try_compile_and_link(<<EOM)) {
$TIME_HEADERS
#include <sys/stat.h>
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct stat st;
st.st_atimensec = 0;
}
Expand All @@ -646,7 +648,7 @@ EOM
if (try_compile_and_link(<<EOM)) {
$TIME_HEADERS
#include <sys/stat.h>
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct stat st;
st.st_atime_n = 0;
}
Expand All @@ -666,7 +668,7 @@ EOM
if (try_compile_and_link(<<EOM)) {
$TIME_HEADERS
#include <sys/stat.h>
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct stat st;
st.st_atim.tv_nsec = 0;
}
Expand All @@ -686,7 +688,7 @@ EOM
if (try_compile_and_link(<<EOM)) {
$TIME_HEADERS
#include <sys/stat.h>
int main _((int argc, char** argv, char** env)) {
int main(int argc, char** argv) {
struct stat st;
st.st_uatime = 0;
}
Expand All @@ -702,7 +704,7 @@ EOM
}

if ($DEFINE =~ /-DTIME_HIRES_STAT=\d+/) {
print "You seem to have stat subsecond timestamps.\n";
print "You seem to have stat() subsecond timestamps.\n";
print "(Your struct stat has them, but the filesystems must help.)\n";
} else {
print "You do not seem to have stat subsecond timestamps.\n";
Expand Down Expand Up @@ -845,6 +847,7 @@ NOTE: if you get an error like this (the Makefile line number may vary):
Makefile:91: *** missing separator
then set the environment variable LC_ALL to "C" and retry
from scratch (re-run perl "Makefile.PL").
(And consider upgrading your Perl.)
EOM
}
}
Expand Down

0 comments on commit f337060

Please sign in to comment.