summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2003-09-30 14:58:59 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2003-09-30 14:58:59 (GMT)
commit83dd43fde1f84fd6acb8388979813eebdea1a05c (patch)
treee7c9fea6e31e0662cc1cf8f1cc96c1f751123105
parent3a01b7d66e4c2359026c5d68ae5ab6556c541be5 (diff)
downloadcpython-83dd43fde1f84fd6acb8388979813eebdea1a05c.zip
cpython-83dd43fde1f84fd6acb8388979813eebdea1a05c.tar.gz
cpython-83dd43fde1f84fd6acb8388979813eebdea1a05c.tar.bz2
workaround for OpenBSD compiler bug w.r.t. handling of overflows.
-rw-r--r--Include/pyport.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 8747271..085833f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -257,8 +257,17 @@ extern "C" {
* in non-overflow cases.
* X is evaluated more than once.
* Some platforms have better way to spell this, so expect some #ifdef'ery.
+ *
+ * OpenBSD uses 'isinf()' because a compiler bug on that platform causes
+ * the longer macro version to be mis-compiled. This isn't optimal, and
+ * should be removed once a newer compiler is available on that platform.
+ * The system that had the failure was running OpenBSD 3.2 on Intel, with
+ * gcc 2.95.3.
+ *
+ * According to Tim's checkin, the FreeBSD systems use isinf() to work
+ * around a FPE bug on that platform.
*/
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#define Py_OVERFLOWED(X) isinf(X)
#else
#define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE || \