Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83dd43f

Browse files
committed
workaround for OpenBSD compiler bug w.r.t. handling of overflows.
1 parent 3a01b7d commit 83dd43f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Include/pyport.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,17 @@ extern "C" {
257257
* in non-overflow cases.
258258
* X is evaluated more than once.
259259
* Some platforms have better way to spell this, so expect some #ifdef'ery.
260+
*
261+
* OpenBSD uses 'isinf()' because a compiler bug on that platform causes
262+
* the longer macro version to be mis-compiled. This isn't optimal, and
263+
* should be removed once a newer compiler is available on that platform.
264+
* The system that had the failure was running OpenBSD 3.2 on Intel, with
265+
* gcc 2.95.3.
266+
*
267+
* According to Tim's checkin, the FreeBSD systems use isinf() to work
268+
* around a FPE bug on that platform.
260269
*/
261-
#ifdef __FreeBSD__
270+
#if defined(__FreeBSD__) || defined(__OpenBSD__)
262271
#define Py_OVERFLOWED(X) isinf(X)
263272
#else
264273
#define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE || \

0 commit comments

Comments
 (0)