summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-28 22:07:11 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-28 22:07:11 (GMT)
commit2645241adda213a2f65c7792f4e13c0686bb0daf (patch)
tree0d2c087a335a3bc9b682186c03f7aa05e26b164e
parent03dc5384d701ff378f1b9f934e6d8d3b3a8f570d (diff)
downloadcpython-2645241adda213a2f65c7792f4e13c0686bb0daf.zip
cpython-2645241adda213a2f65c7792f4e13c0686bb0daf.tar.gz
cpython-2645241adda213a2f65c7792f4e13c0686bb0daf.tar.bz2
Fixes for OS/2 by Jeff Rush.
-rw-r--r--Modules/timemodule.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 7ad8a6f..cde4897 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -90,16 +90,8 @@ extern int ftime();
#undef HAVE_CLOCK /* We have our own version down below */
#endif /* MS_WIN32 */
-#if defined(PYOS_OS2)
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_NOPMAPI
-#include <os2.h>
-#endif
-
#if defined(PYCC_VACPP)
-#include <time.h>
-#define timezone _timezone
+#include <sys/time.h>
#endif
#ifdef __BEOS__
@@ -611,11 +603,19 @@ inittime()
d = PyModule_GetDict(m);
#ifdef HAVE_TZNAME
tzset();
+#ifdef PYOS_OS2
+ ins(d, "timezone", PyInt_FromLong((long)_timezone));
+#else /* !PYOS_OS2 */
ins(d, "timezone", PyInt_FromLong((long)timezone));
+#endif /* PYOS_OS2 */
#ifdef HAVE_ALTZONE
ins(d, "altzone", PyInt_FromLong((long)altzone));
#else
+#ifdef PYOS_OS2
+ ins(d, "altzone", PyInt_FromLong((long)_timezone-3600));
+#else /* !PYOS_OS2 */
ins(d, "altzone", PyInt_FromLong((long)timezone-3600));
+#endif /* PYOS_OS2 */
#endif
ins(d, "daylight", PyInt_FromLong((long)daylight));
ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));