summaryrefslogtreecommitdiff
path: root/ext/Time
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 /ext/Time
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
Diffstat (limited to 'ext/Time')
-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
3 files changed, 14 insertions, 5 deletions
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
}