summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-09-06 13:34:02 (GMT)
committerGuido van Rossum <guido@python.org>1996-09-06 13:34:02 (GMT)
commitcac6c721057d84ebfda870be61aa318819eb4267 (patch)
tree0e9ac9dd190506c32f437a41e9546c2e428a1189
parent3469e997b4cab1927737d45132b416efc17916bb (diff)
downloadcpython-cac6c721057d84ebfda870be61aa318819eb4267.zip
cpython-cac6c721057d84ebfda870be61aa318819eb4267.tar.gz
cpython-cac6c721057d84ebfda870be61aa318819eb4267.tar.bz2
Some changes for better Windows portability.
-rw-r--r--Modules/timemodule.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 7a8c462..ae68508 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -59,14 +59,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifdef __WATCOMC__
#include <i86.h>
#else
-#ifdef _M_IX86
+#ifdef MS_WINDOWS
#include <windows.h>
#define timezone _timezone
+#ifndef tzname
#define tzname _tzname
-#define daylight _daylight
-#define altzone _altzone
#endif
+#ifndef daylight
+#define daylight _daylight
#endif
+#define altzone _altzone
+#endif /* MS_WINDOWS */
+#endif /* !__WATCOMC__ */
/* Forward declarations */
static int floatsleep PROTO((double));
@@ -263,7 +267,7 @@ time_ctime(self, args)
char *p;
if (!getargs(args, "d", &dt))
return NULL;
- tt = dt;
+ tt = (time_t)dt;
p = ctime(&tt);
if (p[24] == '\n')
p[24] = '\0';
@@ -469,13 +473,13 @@ floatsleep(secs)
break;
}
#else /* !MSDOS */
-#ifdef _M_IX86
+#ifdef MS_WINDOWS
/* XXX Can't interrupt this sleep */
Sleep((int)(secs*1000));
-#else /* _M_IX86 */
+#else /* !MS_WINDOWS */
/* XXX Can't interrupt this sleep */
sleep((int)secs);
-#endif /* _M_IX86 */
+#endif /* !MS_WINDOWS */
#endif /* !MSDOS */
#endif /* !__WATCOMC__ */
#endif /* !macintosh */