Kaydet (Commit) cac6c721 authored tarafından Guido van Rossum's avatar Guido van Rossum

Some changes for better Windows portability.

üst 3469e997
...@@ -59,14 +59,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -59,14 +59,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifdef __WATCOMC__ #ifdef __WATCOMC__
#include <i86.h> #include <i86.h>
#else #else
#ifdef _M_IX86 #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
#define timezone _timezone #define timezone _timezone
#ifndef tzname
#define tzname _tzname #define tzname _tzname
#define daylight _daylight
#define altzone _altzone
#endif #endif
#ifndef daylight
#define daylight _daylight
#endif #endif
#define altzone _altzone
#endif /* MS_WINDOWS */
#endif /* !__WATCOMC__ */
/* Forward declarations */ /* Forward declarations */
static int floatsleep PROTO((double)); static int floatsleep PROTO((double));
...@@ -263,7 +267,7 @@ time_ctime(self, args) ...@@ -263,7 +267,7 @@ time_ctime(self, args)
char *p; char *p;
if (!getargs(args, "d", &dt)) if (!getargs(args, "d", &dt))
return NULL; return NULL;
tt = dt; tt = (time_t)dt;
p = ctime(&tt); p = ctime(&tt);
if (p[24] == '\n') if (p[24] == '\n')
p[24] = '\0'; p[24] = '\0';
...@@ -469,13 +473,13 @@ floatsleep(secs) ...@@ -469,13 +473,13 @@ floatsleep(secs)
break; break;
} }
#else /* !MSDOS */ #else /* !MSDOS */
#ifdef _M_IX86 #ifdef MS_WINDOWS
/* XXX Can't interrupt this sleep */ /* XXX Can't interrupt this sleep */
Sleep((int)(secs*1000)); Sleep((int)(secs*1000));
#else /* _M_IX86 */ #else /* !MS_WINDOWS */
/* XXX Can't interrupt this sleep */ /* XXX Can't interrupt this sleep */
sleep((int)secs); sleep((int)secs);
#endif /* _M_IX86 */ #endif /* !MS_WINDOWS */
#endif /* !MSDOS */ #endif /* !MSDOS */
#endif /* !__WATCOMC__ */ #endif /* !__WATCOMC__ */
#endif /* !macintosh */ #endif /* !macintosh */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment