Index: Include/unicodeobject.h =================================================================== --- Include/unicodeobject.h (révision 82729) +++ Include/unicodeobject.h (copie de travail) @@ -78,7 +78,7 @@ #define Py_UNICODE_WIDE #endif -/* Set these flags if the platform has "wchar.h", "wctype.h" and the +/* Set these flags if the platform has "wchar.h" and the wchar_t type is a 16-bit unsigned type */ /* #define HAVE_WCHAR_H */ /* #define HAVE_USABLE_WCHAR_T */ @@ -344,39 +344,7 @@ /* --- Internal Unicode Operations ---------------------------------------- */ -/* If you want Python to use the compiler's wctype.h functions instead - of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS or - configure Python using --with-wctype-functions. This reduces the - interpreter's code size. */ -#if defined(HAVE_USABLE_WCHAR_T) && defined(WANT_WCTYPE_FUNCTIONS) - -#include - -#define Py_UNICODE_ISSPACE(ch) iswspace(ch) - -#define Py_UNICODE_ISLOWER(ch) iswlower(ch) -#define Py_UNICODE_ISUPPER(ch) iswupper(ch) -#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) -#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) - -#define Py_UNICODE_TOLOWER(ch) towlower(ch) -#define Py_UNICODE_TOUPPER(ch) towupper(ch) -#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) - -#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) -#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) -#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) -#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) - -#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) -#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) -#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) - -#define Py_UNICODE_ISALPHA(ch) iswalpha(ch) - -#else - /* Since splitting on whitespace is an important use case, and whitespace in most situations is solely ASCII whitespace, we optimize for the common case by using a quick look-up table @@ -406,8 +374,6 @@ #define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) -#endif - #define Py_UNICODE_ISALNUM(ch) \ (Py_UNICODE_ISALPHA(ch) || \ Py_UNICODE_ISDECIMAL(ch) || \ Index: configure.in =================================================================== --- configure.in (révision 82729) +++ configure.in (copie de travail) @@ -2501,21 +2501,6 @@ OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi -# Check for --with-wctype-functions -AC_MSG_CHECKING(for --with-wctype-functions) -AC_ARG_WITH(wctype-functions, - AS_HELP_STRING([--with-wctype-functions], [use wctype.h functions]), -[ -if test "$withval" != no -then - AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1, - [Define if you want wctype.h functions to be used instead of the - one supplied by Python itself. (see Include/unicodectype.h).]) - AC_MSG_RESULT(yes) -else AC_MSG_RESULT(no) -fi], -[AC_MSG_RESULT(no)]) - # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) DLINCLDIR=. Index: Objects/unicodectype.c =================================================================== --- Objects/unicodectype.c (révision 82729) +++ Objects/unicodectype.c (copie de travail) @@ -165,8 +165,6 @@ return (ctype->flags & PRINTABLE_MASK) != 0; } -#ifndef WANT_WCTYPE_FUNCTIONS - /* Returns 1 for Unicode characters having the category 'Ll', 0 otherwise. */ @@ -225,34 +223,3 @@ return (ctype->flags & ALPHA_MASK) != 0; } -#else - -/* Export the interfaces using the wchar_t type for portability - reasons: */ - -int _PyUnicode_IsLowercase(Py_UNICODE ch) -{ - return iswlower(ch); -} - -int _PyUnicode_IsUppercase(Py_UNICODE ch) -{ - return iswupper(ch); -} - -Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch) -{ - return towlower(ch); -} - -Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch) -{ - return towupper(ch); -} - -int _PyUnicode_IsAlpha(Py_UNICODE ch) -{ - return iswalpha(ch); -} - -#endif Index: Objects/unicodetype_db.h =================================================================== --- Objects/unicodetype_db.h (révision 82729) +++ Objects/unicodetype_db.h (copie de travail) @@ -3355,9 +3355,6 @@ */ int _PyUnicode_IsWhitespace(register const Py_UNICODE ch) { -#ifdef WANT_WCTYPE_FUNCTIONS - return iswspace(ch); -#else switch (ch) { case 0x0009: case 0x000A: @@ -3392,7 +3389,6 @@ return 1; } return 0; -#endif } /* Returns 1 for Unicode characters having the line break Index: Tools/unicode/makeunicodedata.py =================================================================== --- Tools/unicode/makeunicodedata.py (révision 82729) +++ Tools/unicode/makeunicodedata.py (copie de travail) @@ -514,9 +514,6 @@ print(" */", file=fp) print('int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)', file=fp) print('{', file=fp) - print('#ifdef WANT_WCTYPE_FUNCTIONS', file=fp) - print(' return iswspace(ch);', file=fp) - print('#else', file=fp) print(' switch (ch) {', file=fp) haswide = False @@ -536,7 +533,6 @@ print(' }', file=fp) print(' return 0;', file=fp) - print('#endif', file=fp) print('}', file=fp) print(file=fp) Index: pyconfig.h.in =================================================================== --- pyconfig.h.in (révision 82729) +++ pyconfig.h.in (copie de travail) @@ -1068,10 +1068,6 @@ /* Define if you want SIGFPE handled (see Include/pyfpe.h). */ #undef WANT_SIGFPE_HANDLER -/* Define if you want wctype.h functions to be used instead of the one - supplied by Python itself. (see Include/unicodectype.h). */ -#undef WANT_WCTYPE_FUNCTIONS - /* Define if WINDOW in curses.h offers a field _flags. */ #undef WINDOW_HAS_FLAGS