Mercurial > cpython-lru_cache-weakref
diff Include/Python.h @ 31250:dfd0114cf9ec legacy-trunk
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.)
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Mon, 22 Dec 2003 16:31:41 +0000 |
| parents | 54ff68e973ee |
| children | e118e4e8e224 |
line wrap: on
line diff
--- a/Include/Python.h Mon Dec 22 01:33:08 2003 +0000 +++ b/Include/Python.h Mon Dec 22 16:31:41 2003 +0000 @@ -21,6 +21,14 @@ #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?" #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 #endif
