Message 192163 - Python tracker (original) (raw)
Updated patch (version 3), addressing last issues of Mark's review:
- add a simple unit test in _testcapi: check that PyLong_AsIntMax_t(INTMAX_INT - 1), PyLong_AsIntMax_t(INTMAX_MAX + 1) and PyLong_AsUintMax_t(UINTMAX_MAX + 1) fail with OverflowError
- rely on stdint.h on Windows, with a fallback on __int64 for Visual Studio 2008
- PyLong_AsIntMax_t() and PyLong_AsUintMax_t() compute directly the result (rather than calling _PyLong_AsByteArray)
I give you one or two days for a last review, and then I'm going to commit the new functions.