From: Alexander Gough Date: Mon, 8 Oct 2007 13:10:04 +0000 (+0100) Subject: Time::Piece & matherr on qnx4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be8a15fc9d0d9428f2fb14cc2ecbc0306b52e030;p=p5sagit%2Fp5-mst-13.2.git Time::Piece & matherr on qnx4 Message-ID: <20071008121004.GB24241@the.earth.li> Plus, bump version number of Time::Piece to 1.11_03 p4raw-id: //depot/perl@32069 --- diff --git a/AUTHORS b/AUTHORS index 1a0c25e..93a0bcb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -35,7 +35,6 @@ Albert Dvornik Alessandro Forghieri Alexei Alexandrov Alex Davies -Alex Gough Alex Vandiver Alex Waugh Alexander Gough diff --git a/MANIFEST b/MANIFEST index f816b5d..3128cba 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3260,6 +3260,7 @@ pp_sys.c Push/Pop code for system interaction proto.h Prototypes qnx/ar QNX implementation of "ar" utility qnx/cpp QNX implementation of preprocessor filter +qnx/qnx.c QNX silent matherr callback README The Instructions README.aix Perl notes for AIX README.amiga Perl notes for AmigaOS diff --git a/ext/Time/Piece/Piece.pm b/ext/Time/Piece/Piece.pm index 59b9976..f198156 100644 --- a/ext/Time/Piece/Piece.pm +++ b/ext/Time/Piece/Piece.pm @@ -22,7 +22,7 @@ our %EXPORT_TAGS = ( ':override' => 'internal', ); -our $VERSION = '1.11_02'; +our $VERSION = '1.11_03'; bootstrap Time::Piece $VERSION; diff --git a/ext/Time/Piece/Piece.xs b/ext/Time/Piece/Piece.xs index 4ab9790..dc3a73e 100644 --- a/ext/Time/Piece/Piece.xs +++ b/ext/Time/Piece/Piece.xs @@ -241,9 +241,13 @@ my_mini_mktime(struct tm *ptm) ptm->tm_wday = (jday + WEEKDAY_BIAS) % 7; } -#if defined(WIN32) /* No strptime on Win32 */ +#if defined(WIN32) || (defined(__QNX__) && defined(__WATCOMC__)) /* No strptime on Win32 or QNX4 */ #define strncasecmp(x,y,n) strnicmp(x,y,n) + +#if defined(WIN32) #define alloca _alloca +#endif + #include #include #include diff --git a/ext/Time/Piece/t/02core.t b/ext/Time/Piece/t/02core.t index 68639d0..d020558 100644 --- a/ext/Time/Piece/t/02core.t +++ b/ext/Time/Piece/t/02core.t @@ -1,6 +1,7 @@ use Test::More tests => 93; my $is_win32 = ($^O =~ /Win32/); +my $is_qnx = ($^O eq 'qnx'); BEGIN { use_ok('Time::Piece'); } ok(1); @@ -60,8 +61,12 @@ cmp_ok($t->week, '==', 9); cmp_ok($t->strftime('%d'), '==', 29); SKIP: { - skip "can't strftime %D, %R, %T or %e on Win32", 2 if $is_win32; + skip "can't strftime %D, %R, %T or %e on Win32", 1 if $is_win32; cmp_ok($t->strftime('%D'), 'eq', '02/29/00'); # Yech! +} +SKIP:{ + skip "can't strftime %D, %R, %T or %e on Win32", 1 if $is_win32; + skip "can't strftime %e on QNX", 1 if $is_qnx; cmp_ok($t->strftime('%e'), 'eq', '29'); # should test with < 10 } @@ -76,7 +81,7 @@ cmp_ok($t->strftime('%M'), 'eq', '34'); # should test with < 10 # and are possibly unportable (am or AM or a.m., and so on) SKIP: { - skip "can't strftime %R on Win32", 1 if $is_win32; + skip "can't strftime %R on Win32 or QNX", 1 if $is_win32 or $is_qnx; cmp_ok($t->strftime('%R'), 'eq', '12:34'); # should test with > 12 } @@ -94,7 +99,7 @@ SKIP: { cmp_ok($t->strftime('%U'), 'eq', '09'); # Sun cmp Mon SKIP: { - skip "can't strftime %V on Win32", 1 if $is_win32; + skip "can't strftime %V on Win32 or QNX", 1 if $is_win32 or $is_qnx; # is this test really broken on Mac OS? -- rjbs, 2006-02-08 cmp_ok($t->strftime('%V'), 'eq', '09'); # Sun cmp Mon } diff --git a/hints/qnx.sh b/hints/qnx.sh index 482c8ab..e4469a1 100644 --- a/hints/qnx.sh +++ b/hints/qnx.sh @@ -9,7 +9,12 @@ # socket3r.lib Nov21 1996. # perl-5.7.3 fails 2 known tests under QNX6.1.0 # -# As with many unix ports, this one depends on a few "standard" +# perl-5.10.0-tobe compiles with Watcom C 10.6 +# and QNX 4.25 patch G w/TCPSDK installed +# Some tests still fail, mostly to do with dynamic/static +# or unsuported features in QNX. +# +## As with many unix ports, this one depends on a few "standard" # unix utilities which are not necessarily standard for QNX4. # # /bin/sh This is used heavily by Configure and then by @@ -229,6 +234,11 @@ if [ "$osname" = "qnx" ]; then /usr/local/bin or some other suitable location. EOF fi + + # includes a matherr() to silence noise from watcom libc + archobjs="qnx.o" + test -f qnx.c || cp qnx/qnx.c . + else # $^O eq nto diff --git a/qnx/qnx.c b/qnx/qnx.c new file mode 100644 index 0000000..6c819e3 --- /dev/null +++ b/qnx/qnx.c @@ -0,0 +1,11 @@ +/* If we're compiling with watcom, we want to silence domain errors */ +#if defined(__QNX__) && defined(__WATCOMC__) +#include + +/* Return default value and print no error message */ +int matherr( struct exception *err ) + { + return 1; + } + +#endif