summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-06 17:16:21 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-06 17:16:21 (GMT)
commit60cd8138105581451592c8a6cc3e712588294595 (patch)
tree71e57677bc98a05c310777587068607d988233d6 /Modules/timemodule.c
parent1809975a298e619697b06b835d0c46574638315b (diff)
downloadcpython-60cd8138105581451592c8a6cc3e712588294595.zip
cpython-60cd8138105581451592c8a6cc3e712588294595.tar.gz
cpython-60cd8138105581451592c8a6cc3e712588294595.tar.bz2
Check for HAVE_MKTIME (if you don't have it, some tests will fail, but
at least the build will now succeed). For Sony NEWS-OS, BSD 4.3 based.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index b49bffc..8f5695d 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -321,7 +321,12 @@ time_strftime(self, args)
buf.tm_mon--;
buf.tm_wday = (buf.tm_wday + 1) % 7;
buf.tm_yday--;
+#ifdef HAVE_MKTIME
+ /* This call is only there to adjust the numbers to be within
+ bounds. When we don't have mktime(), we say the caller is
+ responsible for that... */
(void) mktime(&buf);
+#endif
/* I hate these functions that presume you know how big the output
* will be ahead of time...
*/
@@ -380,6 +385,7 @@ time_ctime(self, args)
return PyString_FromString(p);
}
+#ifdef HAVE_MKTIME
static PyObject *
time_mktime(self, args)
PyObject *self;
@@ -399,6 +405,7 @@ time_mktime(self, args)
}
return PyFloat_FromDouble((double)tt);
}
+#endif /* HAVE_MKTIME */
static PyMethodDef time_methods[] = {
{"time", time_time},
@@ -410,7 +417,9 @@ static PyMethodDef time_methods[] = {
{"localtime", time_localtime},
{"asctime", time_asctime},
{"ctime", time_ctime},
+#ifdef HAVE_MKTIME
{"mktime", time_mktime},
+#endif
#ifdef HAVE_STRFTIME
{"strftime", time_strftime, 1},
#endif