summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-09-19 22:14:29 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-09-19 22:14:29 +0000
commit371b7e1ad2e46c79c7794d9b0f41b49157e7653c (patch)
tree630f132792287f6a0122045d7c82ef0fafedd646
parentd8b46c1bb1e2856c8ae13cfa7f0b032537c8f918 (diff)
downloadperl-371b7e1ad2e46c79c7794d9b0f41b49157e7653c.tar.gz
control change#1914 via hints (causes problems on some platforms)
p4raw-link: @1914 on //depot/perl: e44f695ee9be4f523999589b52c7c8e9ddc1bed9 p4raw-id: //depot/perl@4196
-rw-r--r--ext/POSIX/POSIX.pod2
-rw-r--r--ext/POSIX/POSIX.xs2
-rw-r--r--ext/POSIX/hints/linux.pl4
3 files changed, 6 insertions, 2 deletions
diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod
index 6ad74b74b9..75d4d1d2a6 100644
--- a/ext/POSIX/POSIX.pod
+++ b/ext/POSIX/POSIX.pod
@@ -1023,7 +1023,7 @@ about these and the other arguments.
If you want your code to be portable, your format (C<fmt>) argument
should use only the conversion specifiers defined by the ANSI C
standard. These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
-The given arguments are made consistent
+On platforms that need it, the given arguments are made consistent
by calling C<mktime()> before calling your system's C<strftime()> function.
The string for Tuesday, December 12, 1995.
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 16217f0936..e828d52e5e 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -3652,7 +3652,9 @@ strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
mytm.tm_wday = wday;
mytm.tm_yday = yday;
mytm.tm_isdst = isdst;
+#if defined(HINT_STRFTIME_NEEDS_MKTIME)
(void) mktime(&mytm);
+#endif
len = strftime(tmpbuf, sizeof tmpbuf, fmt, &mytm);
/*
** The following is needed to handle to the situation where
diff --git a/ext/POSIX/hints/linux.pl b/ext/POSIX/hints/linux.pl
index f1d19814ae..8cec446044 100644
--- a/ext/POSIX/hints/linux.pl
+++ b/ext/POSIX/hints/linux.pl
@@ -2,4 +2,6 @@
# Thanks to Bart Schuller <schuller@Lunatech.com>
# See Message-ID: <19971009002636.50729@tanglefoot>
# XXX A Configure test is needed.
-$self->{CCFLAGS} = $Config{ccflags} . ' -DSTRUCT_TM_HASZONE -DHINT_SC_EXIST' ;
+$self->{CCFLAGS} = $Config{ccflags}
+ . ' -DHINT_STRFTIME_NEEDS_MKTIME'
+ . ' -DSTRUCT_TM_HASZONE -DHINT_SC_EXIST' ;