Mercurial > cpython-lru_cache-weakref
diff Modules/itertoolsmodule.c @ 41590:1c1705bf36b8 legacy-trunk
Fix problems in x64 build that were discovered by the testsuite:
- Reenable modules on x64 that had been disabled aeons ago for Itanium.
- Cleared up confusion about compilers for 64 bit windows. There is only Itanium and x64. Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above.
- Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms.
- Fixed thread_nt.h. The emulated InterlockedCompareExchange function didn“t work on x64, probaby due to the lack of a "volatile" specifier. Anyway, win95 is no longer a target platform.
- Itertools module used wrong constant to check for overflow in count()
- PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member.
- PyLong_FromSsize_t() incorrectly specified that the operand were unsigned.
With these changes, the x64 passes the testsuite, for those modules present.
| author | Kristján Valur Jónsson <kristjan@ccpgames.com> |
|---|---|
| date | Thu, 03 May 2007 20:27:03 +0000 |
| parents | 8128619e984d |
| children | 6620a510e9a9 |
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c Thu May 03 20:09:56 2007 +0000 +++ b/Modules/itertoolsmodule.c Thu May 03 20:27:03 2007 +0000 @@ -2073,9 +2073,9 @@ static PyObject * count_next(countobject *lz) { - if (lz->cnt == LONG_MAX) { + if (lz->cnt == PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, - "cannot count beyond LONG_MAX"); + "cannot count beyond PY_SSIZE_T_MAX"); return NULL; } return PyInt_FromSsize_t(lz->cnt++);
