summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-07-03 03:31:20 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-07-03 03:31:20 (GMT)
commit1de41bfbc0afadc0b1fa2f4076b54385fa5b33ba (patch)
tree52424666d625db95f85599e6a8035f5344cd7f8e
parent60ae701b3a20e3678e8bbb923fc7a06e2907b7f0 (diff)
downloadcpython-1de41bfbc0afadc0b1fa2f4076b54385fa5b33ba.zip
cpython-1de41bfbc0afadc0b1fa2f4076b54385fa5b33ba.tar.gz
cpython-1de41bfbc0afadc0b1fa2f4076b54385fa5b33ba.tar.bz2
Stop trying to cater to platforms with a broken HUGE_VAL definition. It
breaks other platforms (in this case, the hack for broken Cray systems in turn caused failure on a Mac system broken in a different way).
-rw-r--r--Include/pyport.h19
-rw-r--r--Misc/NEWS18
2 files changed, 25 insertions, 12 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 5c3e0a9..3f0923f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -229,19 +229,14 @@ extern "C" {
*/
#define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X))
-/* According to
- * http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
- * on some Cray systems HUGE_VAL is incorrectly (according to the C std)
- * defined to be the largest positive finite rather than infinity. We need
- * the std-conforming infinity meaning (provided the platform has one!).
- *
- * Then, according to a bug report on SourceForge, defining Py_HUGE_VAL as
- * INFINITY caused internal compiler errors under BeOS using some version
- * of gcc. Explicitly casting INFINITY to double made that problem go away.
+/* HUGE_VAL is supposed to expand to a positive double infinity. Python
+ * uses Py_HUGE_VAL instead because some platforms are broken in this
+ * respect. We used to embed code in pyport.h to try to worm around that,
+ * but different platforms are broken in conflicting ways. If you're on
+ * a platform where HUGE_VAL is defined incorrectly, fiddle your Python
+ * config to #define Py_HUGE_VAL to something that works on your platform.
*/
-#ifdef INFINITY
-#define Py_HUGE_VAL ((double)INFINITY)
-#else
+#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
diff --git a/Misc/NEWS b/Misc/NEWS
index defbc47..c8bda83 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -289,6 +289,24 @@ Tools/Demos
Build
+- Accoring to Annex F of the current C standard,
+
+ The Standard C macro HUGE_VAL and its float and long double analogs,
+ HUGE_VALF and HUGE_VALL, expand to expressions whose values are
+ positive infinities.
+
+ Python only uses the double HUGE_VAL, and only to #define its own symbol
+ Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
+ pyport.h used to try to worm around that, but the workarounds triggered
+ other bugs on other platforms, so we gave up. If your platform defines
+ HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
+ that works on your platform. The only instance of this I'm sure about
+ is on an unknown subset of Cray systems, described here:
+
+ http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
+
+ Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
+
- The configure option --without-doc-strings can be used to remove the
doc strings from the builtin functions and modules; this reduces the
size of the executable.