summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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' ;