diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-06-30 15:26:10 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-06-30 15:26:10 (GMT) |
commit | 6238d2b024f061159b2613387ff700695c10deef (patch) | |
tree | 2c882431a5f1a348c7b4589f0e51a7e0d8bdef46 /Modules/timemodule.c | |
parent | adfa7409f8286bd9581d5decfac5a5edcc1aa7de (diff) | |
download | cpython-6238d2b024f061159b2613387ff700695c10deef.zip cpython-6238d2b024f061159b2613387ff700695c10deef.tar.gz cpython-6238d2b024f061159b2613387ff700695c10deef.tar.bz2 |
Patch #569753: Remove support for WIN16.
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index b2b58bf..8f2c4f8 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -29,23 +29,20 @@ extern int ftime(struct timeb *); #else #ifdef MS_WINDOWS #include <windows.h> -#if defined(MS_WIN16) || defined(__BORLANDC__) +#if defined(__BORLANDC__) /* These overrides not needed for Win32 */ #define timezone _timezone #define tzname _tzname #define daylight _daylight -#endif /* MS_WIN16 || __BORLANDC__ */ -#ifdef MS_WIN16 -#define altzone _altzone -#endif /* MS_WIN16 */ +#endif /* __BORLANDC__ */ #endif /* MS_WINDOWS */ #endif /* !__WATCOMC__ || __QNX__ */ -#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) +#if defined(MS_WINDOWS) && !defined(MS_WIN64) && !defined(__BORLANDC__) /* Win32 has better clock replacement XXX Win64 does not yet, but might when the platform matures. */ #undef HAVE_CLOCK /* We have our own version down below */ -#endif /* MS_WIN32 && !MS_WIN64 */ +#endif /* MS_WINDOWS && !MS_WIN64 */ #if defined(PYOS_OS2) #define INCL_DOS @@ -141,7 +138,7 @@ time_clock(PyObject *self, PyObject *args) } #endif /* HAVE_CLOCK */ -#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) +#if defined(MS_WINDOWS) && !defined(MS_WIN64) && !defined(__BORLANDC__) /* Due to Mark Hammond and Tim Peters */ static PyObject * time_clock(PyObject *self, PyObject *args) @@ -170,7 +167,7 @@ time_clock(PyObject *self, PyObject *args) } #define HAVE_CLOCK /* So it gets included in the methods */ -#endif /* MS_WIN32 && !MS_WIN64 */ +#endif /* MS_WINDOWS && !MS_WIN64 */ #ifdef HAVE_CLOCK PyDoc_STRVAR(clock_doc, @@ -736,7 +733,7 @@ floattime(void) static int floatsleep(double secs) { -/* XXX Should test for MS_WIN32 first! */ +/* XXX Should test for MS_WINDOWS first! */ #if defined(HAVE_SELECT) && !defined(__BEOS__) && !defined(__EMX__) struct timeval t; double frac; @@ -771,36 +768,7 @@ floatsleep(double secs) Py_BEGIN_ALLOW_THREADS delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */ Py_END_ALLOW_THREADS -#elif defined(MSDOS) - struct timeb t1, t2; - double frac; - extern double fmod(double, double); - extern double floor(double); - if (secs <= 0.0) - return; - frac = fmod(secs, 1.0); - secs = floor(secs); - ftime(&t1); - t2.time = t1.time + (int)secs; - t2.millitm = t1.millitm + (int)(frac*1000.0); - while (t2.millitm >= 1000) { - t2.time++; - t2.millitm -= 1000; - } - for (;;) { -#ifdef QUICKWIN - Py_BEGIN_ALLOW_THREADS - _wyield(); - Py_END_ALLOW_THREADS -#endif - if (PyErr_CheckSignals()) - return -1; - ftime(&t1); - if (t1.time > t2.time || - t1.time == t2.time && t1.millitm >= t2.millitm) - break; - } -#elif defined(MS_WIN32) +#elif defined(MS_WINDOWS) { double millisecs = secs * 1000.0; if (millisecs > (double)ULONG_MAX) { |