[Python-checkins] python/dist/src/Include Python.h,2.58,2.59

montanaro at users.sourceforge.net montanaro at users.sourceforge.net
Mon Dec 22 11:31:43 EST 2003


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv14738/Include

Modified Files:
	Python.h 
Log Message:
There are places in Python which assume bytes have 8-bits.  Formalize that a
bit by checking the value of UCHAR_MAX in Include/Python.h.  There was a
check in Objects/stringobject.c.  Remove that.  (Note that we don't define
UCHAR_MAX if it's not defined as the old test did.)


Index: Python.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v
retrieving revision 2.58
retrieving revision 2.59
diff -C2 -d -r2.58 -r2.59
*** Python.h	16 Nov 2003 16:17:48 -0000	2.58
--- Python.h	22 Dec 2003 16:31:33 -0000	2.59
***************
*** 22,25 ****
--- 22,33 ----
  #endif
  
+ #ifndef UCHAR_MAX
+ #error "Something's broken.  UCHAR_MAX should be defined in limits.h."
+ #endif
+ 
+ #if UCHAR_MAX != 255
+ #error "Python's source code currently assumes 8-bit characters."
+ #endif
+ 
  #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
  #define _SGI_MP_SOURCE





More information about the Python-checkins mailing list