diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/unicodeobject.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index f91a5a0..e330fd1 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -58,6 +58,19 @@ Copyright (c) Corporation for National Research Initiatives. /* --- Internal Unicode Format -------------------------------------------- */ +/* experimental UCS-4 support. enable at your own risk! */ +#undef USE_UCS4_STORAGE + +/* + * Use this typedef when you need to represent a UTF-16 surrogate pair + * as single unsigned integer. + */ +#if SIZEOF_INT >= 4 +typedef unsigned int Py_UCS4; +#elif SIZEOF_LONG >= 4 +typedef unsigned long Py_UCS4; +#endif + /* Set these flags if the platform has "wchar.h", "wctype.h" and the wchar_t type is a 16-bit unsigned type */ /* #define HAVE_WCHAR_H */ @@ -66,8 +79,8 @@ Copyright (c) Corporation for National Research Initiatives. /* Defaults for various platforms */ #ifndef HAVE_USABLE_WCHAR_T -/* Windows has a usable wchar_t type */ -# if defined(MS_WIN32) +/* Windows has a usable wchar_t type (unless we're using UCS-4) */ +# if defined(MS_WIN32) && !defined(USE_UCS4_STORAGE) # define HAVE_USABLE_WCHAR_T # endif @@ -105,19 +118,13 @@ typedef wchar_t Py_UNICODE; If a short is not 16 bits on your platform, you have to fix the typedef below, or the module initialization code will complain. */ +#ifdef USE_UCS4_STORAGE +typedef Py_UCS4 Py_UNICODE; +#else typedef unsigned short Py_UNICODE; - #endif -/* - * Use this typedef when you need to represent a UTF-16 surrogate pair - * as single unsigned integer. - */ -#if SIZEOF_INT >= 4 -typedef unsigned int Py_UCS4; -#elif SIZEOF_LONG >= 4 -typedef unsigned long Py_UCS4; -#endif +#endif /* --- Internal Unicode Operations ---------------------------------------- */ |