[Python-checkins] CVS: python/dist/src/Include pyport.h,2.20,2.21

Tim Peters python-dev@python.org
Wed, 4 Oct 2000 18:42:32 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory slayer.i.sourceforge.net:/tmp/cvs-serv5758/python/dist/src/Include

Modified Files:
	pyport.h 
Log Message:
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.


Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.20
retrieving revision 2.21
diff -C2 -r2.20 -r2.21
*** pyport.h	2000/09/26 05:46:00	2.20
--- pyport.h	2000/10/05 01:42:23	2.21
***************
*** 375,378 ****
--- 375,391 ----
  #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__