Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 31249:35393a92acd1 | 31250:dfd0114cf9ec |
|---|---|
| 17 | 17 |
| 18 #ifdef HAVE_LIMITS_H | 18 #ifdef HAVE_LIMITS_H |
| 19 #include <limits.h> | 19 #include <limits.h> |
| 20 #else | 20 #else |
| 21 #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?" | 21 #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?" |
| 22 #endif | |
| 23 | |
| 24 #ifndef UCHAR_MAX | |
| 25 #error "Something's broken. UCHAR_MAX should be defined in limits.h." | |
| 26 #endif | |
| 27 | |
| 28 #if UCHAR_MAX != 255 | |
| 29 #error "Python's source code currently assumes 8-bit characters." | |
| 22 #endif | 30 #endif |
| 23 | 31 |
| 24 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) | 32 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) |
| 25 #define _SGI_MP_SOURCE | 33 #define _SGI_MP_SOURCE |
| 26 #endif | 34 #endif |
