summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-10-05 01:42:25 +0000
committerTim Peters <tim.peters@gmail.com>2000-10-05 01:42:25 +0000
commit5cdb10faa0d389aa3c305c8c7480dd4c4033907a (patch)
tree1ec0652fcdd89bf4bcf1f9429f1c5a4a9a7c288b /Include
parent50ef960924f71340ee85f84a0d16294d957c2d22 (diff)
downloadcpython-5cdb10faa0d389aa3c305c8c7480dd4c4033907a.tar.gz
Move LONG_BIT from intobject.c to pyport.h. #error if it's already been
#define'd to an unreasonable value (several recent gcc systems have misdefined it, causing bogus overflows in integer multiplication). Nuke CHAR_BIT entirely.
Diffstat (limited to 'Include')
-rw-r--r--Include/pyport.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 4914886df1..f35d8e6615 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -374,6 +374,19 @@ typedef struct fd_set {
#define LONG_MIN (-LONG_MAX-1)
#endif
+#ifndef LONG_BIT
+#define LONG_BIT (8 * SIZEOF_LONG)
+#endif
+
+#if LONG_BIT != 8 * SIZEOF_LONG
+/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
+ * 32-bit platforms using gcc. We try to catch that here at compile-time
+ * rather than waiting for integer multiplication to trigger bogus
+ * overflows.
+ */
+#error "LONG_BIT definition appears wrong for platform (bad gcc config?)."
+#endif
+
#ifdef __NeXT__
#ifdef __sparc__
/*