summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gough <alex-p5p@earth.li>2007-10-08 14:10:04 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-08 13:16:44 +0000
commitbe8a15fc9d0d9428f2fb14cc2ecbc0306b52e030 (patch)
treec71b2619de18721fed1e911d152e63f26cb30962
parentba6d381e35d7a4367cfc2727a0ef431f4f967401 (diff)
downloadperl-be8a15fc9d0d9428f2fb14cc2ecbc0306b52e030.tar.gz
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
-rw-r--r--AUTHORS1
-rw-r--r--MANIFEST1
-rw-r--r--ext/Time/Piece/Piece.pm2
-rw-r--r--ext/Time/Piece/Piece.xs6
-rw-r--r--ext/Time/Piece/t/02core.t11
-rw-r--r--hints/qnx.sh12
-rw-r--r--qnx/qnx.c11
7 files changed, 37 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index 1a0c25e8cf..93a0bcb2c6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,7 +35,6 @@ Albert Dvornik <bert@genscan.com>
Alessandro Forghieri <alf@orion.it>
Alexei Alexandrov <alexei.alexandrov@gmail.com>
Alex Davies <adavies@ptc.com>
-Alex Gough <alex@rcon.rog>
Alex Vandiver <alexmv@mit.edu>
Alex Waugh <alex@alexwaugh.com>
Alexander Gough <alex-p5p@earth.li>
diff --git a/MANIFEST b/MANIFEST
index f816b5d9e1..3128cbac83 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 59b9976bc2..f198156c6e 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 4ab97900f0..dc3a73e888 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 <time.h>
#include <ctype.h>
#include <string.h>
diff --git a/ext/Time/Piece/t/02core.t b/ext/Time/Piece/t/02core.t
index 68639d0ac5..d02055833d 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 482c8ab0e5..e4469a176a 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 0000000000..6c819e3209
--- /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 <math.h>
+
+/* Return default value and print no error message */
+int matherr( struct exception *err )
+ {
+ return 1;
+ }
+
+#endif