File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10304,8 +10304,19 @@ unicode_compare(PyObject *str1, PyObject *str2)
1030410304 COMPARE (Py_UCS2 , Py_UCS1 );
1030510305 break ;
1030610306 case PyUnicode_2BYTE_KIND :
10307+ {
10308+ #if defined(HAVE_WMEMCMP ) && SIZEOF_WCHAR_T == 2
10309+ int cmp = wmemcmp ((wchar_t * )data1 , (wchar_t * )data2 , len );
10310+ /* normalize result of wmemcmp() into the range [-1; 1] */
10311+ if (cmp < 0 )
10312+ return -1 ;
10313+ if (cmp > 0 )
10314+ return 1 ;
10315+ #else
1030710316 COMPARE (Py_UCS2 , Py_UCS2 );
10317+ #endif
1030810318 break ;
10319+ }
1030910320 case PyUnicode_4BYTE_KIND :
1031010321 COMPARE (Py_UCS2 , Py_UCS4 );
1031110322 break ;
@@ -10324,8 +10335,19 @@ unicode_compare(PyObject *str1, PyObject *str2)
1032410335 COMPARE (Py_UCS4 , Py_UCS2 );
1032510336 break ;
1032610337 case PyUnicode_4BYTE_KIND :
10338+ {
10339+ #if defined(HAVE_WMEMCMP ) && SIZEOF_WCHAR_T == 4
10340+ int cmp = wmemcmp ((wchar_t * )data1 , (wchar_t * )data2 , len );
10341+ /* normalize result of wmemcmp() into the range [-1; 1] */
10342+ if (cmp < 0 )
10343+ return -1 ;
10344+ if (cmp > 0 )
10345+ return 1 ;
10346+ #else
1032710347 COMPARE (Py_UCS4 , Py_UCS4 );
10348+ #endif
1032810349 break ;
10350+ }
1032910351 default :
1033010352 assert (0 );
1033110353 }
Original file line number Diff line number Diff line change @@ -645,6 +645,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
645645#define HAVE_WCSXFRM 1
646646#endif
647647
648+ /* Define to 1 if you have the `wmemcmp' function. */
649+ #define HAVE_WMEMCMP 1
650+
648651/* Define if the zlib library has inflateCopy */
649652#define HAVE_ZLIB_COPY 1
650653
Original file line number Diff line number Diff line change @@ -10273,7 +10273,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
1027310273 sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
1027410274 sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
1027510275 truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
10276- wcscoll wcsftime wcsxfrm writev _getpty
10276+ wcscoll wcsftime wcsxfrm wmemcmp writev _getpty
1027710277do :
1027810278 as_ac_var=` $as_echo " ac_cv_func_$ac_func " | $as_tr_sh `
1027910279ac_fn_c_check_func " $LINENO " " $ac_func " " $as_ac_var "
Original file line number Diff line number Diff line change @@ -2816,7 +2816,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
28162816 sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
28172817 sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
28182818 truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
2819- wcscoll wcsftime wcsxfrm writev _getpty )
2819+ wcscoll wcsftime wcsxfrm wmemcmp writev _getpty )
28202820
28212821AC_CHECK_DECL ( dirfd ,
28222822 AC_DEFINE ( HAVE_DIRFD , 1 ,
Original file line number Diff line number Diff line change 11181118/* Define to 1 if you have the `wcsxfrm' function. */
11191119#undef HAVE_WCSXFRM
11201120
1121+ /* Define to 1 if you have the `wmemcmp' function. */
1122+ #undef HAVE_WMEMCMP
1123+
11211124/* Define if tzset() actually switches the local timezone in a meaningful way.
11221125 */
11231126#undef HAVE_WORKING_TZSET
11901193/* Define if setpgrp() must be called as setpgrp(0, 0). */
11911194#undef SETPGRP_HAVE_ARG
11921195
1193- /* Define this to be extension of shared libraries (including the dot!). */
1194- #undef SHLIB_EXT
1195-
11961196/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
11971197#undef SIGNED_RIGHT_SHIFT_ZERO_FILLS
11981198
You can’t perform that action at this time.
0 commit comments