@@ -268,7 +268,6 @@ pg_set_regex_collation(Oid collation)
268268pg_regex_strategy = PG_REGEX_LOCALE_ICU ;
269269else
270270#endif
271- #ifdef USE_WIDE_UPPER_LOWER
272271if (GetDatabaseEncoding ()== PG_UTF8 )
273272{
274273if (pg_regex_locale )
@@ -277,7 +276,6 @@ pg_set_regex_collation(Oid collation)
277276pg_regex_strategy = PG_REGEX_LOCALE_WIDE ;
278277}
279278else
280- #endif /* USE_WIDE_UPPER_LOWER */
281279{
282280if (pg_regex_locale )
283281pg_regex_strategy = PG_REGEX_LOCALE_1BYTE_L ;
@@ -298,16 +296,14 @@ pg_wc_isdigit(pg_wchar c)
298296return (c <= (pg_wchar )127 &&
299297(pg_char_properties [c ]& PG_ISDIGIT ));
300298case PG_REGEX_LOCALE_WIDE :
301- #ifdef USE_WIDE_UPPER_LOWER
302299if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
303300return iswdigit ((wint_t )c );
304- #endif
305301/* FALL THRU */
306302case PG_REGEX_LOCALE_1BYTE :
307303return (c <= (pg_wchar )UCHAR_MAX &&
308304isdigit ((unsignedchar )c ));
309305case PG_REGEX_LOCALE_WIDE_L :
310- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
306+ #ifdef HAVE_LOCALE_T
311307if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
312308return iswdigit_l ((wint_t )c ,pg_regex_locale -> info .lt );
313309#endif
@@ -336,16 +332,14 @@ pg_wc_isalpha(pg_wchar c)
336332return (c <= (pg_wchar )127 &&
337333(pg_char_properties [c ]& PG_ISALPHA ));
338334case PG_REGEX_LOCALE_WIDE :
339- #ifdef USE_WIDE_UPPER_LOWER
340335if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
341336return iswalpha ((wint_t )c );
342- #endif
343337/* FALL THRU */
344338case PG_REGEX_LOCALE_1BYTE :
345339return (c <= (pg_wchar )UCHAR_MAX &&
346340isalpha ((unsignedchar )c ));
347341case PG_REGEX_LOCALE_WIDE_L :
348- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
342+ #ifdef HAVE_LOCALE_T
349343if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
350344return iswalpha_l ((wint_t )c ,pg_regex_locale -> info .lt );
351345#endif
@@ -374,16 +368,14 @@ pg_wc_isalnum(pg_wchar c)
374368return (c <= (pg_wchar )127 &&
375369(pg_char_properties [c ]& PG_ISALNUM ));
376370case PG_REGEX_LOCALE_WIDE :
377- #ifdef USE_WIDE_UPPER_LOWER
378371if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
379372return iswalnum ((wint_t )c );
380- #endif
381373/* FALL THRU */
382374case PG_REGEX_LOCALE_1BYTE :
383375return (c <= (pg_wchar )UCHAR_MAX &&
384376isalnum ((unsignedchar )c ));
385377case PG_REGEX_LOCALE_WIDE_L :
386- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
378+ #ifdef HAVE_LOCALE_T
387379if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
388380return iswalnum_l ((wint_t )c ,pg_regex_locale -> info .lt );
389381#endif
@@ -412,16 +404,14 @@ pg_wc_isupper(pg_wchar c)
412404return (c <= (pg_wchar )127 &&
413405(pg_char_properties [c ]& PG_ISUPPER ));
414406case PG_REGEX_LOCALE_WIDE :
415- #ifdef USE_WIDE_UPPER_LOWER
416407if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
417408return iswupper ((wint_t )c );
418- #endif
419409/* FALL THRU */
420410case PG_REGEX_LOCALE_1BYTE :
421411return (c <= (pg_wchar )UCHAR_MAX &&
422412isupper ((unsignedchar )c ));
423413case PG_REGEX_LOCALE_WIDE_L :
424- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
414+ #ifdef HAVE_LOCALE_T
425415if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
426416return iswupper_l ((wint_t )c ,pg_regex_locale -> info .lt );
427417#endif
@@ -450,16 +440,14 @@ pg_wc_islower(pg_wchar c)
450440return (c <= (pg_wchar )127 &&
451441(pg_char_properties [c ]& PG_ISLOWER ));
452442case PG_REGEX_LOCALE_WIDE :
453- #ifdef USE_WIDE_UPPER_LOWER
454443if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
455444return iswlower ((wint_t )c );
456- #endif
457445/* FALL THRU */
458446case PG_REGEX_LOCALE_1BYTE :
459447return (c <= (pg_wchar )UCHAR_MAX &&
460448islower ((unsignedchar )c ));
461449case PG_REGEX_LOCALE_WIDE_L :
462- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
450+ #ifdef HAVE_LOCALE_T
463451if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
464452return iswlower_l ((wint_t )c ,pg_regex_locale -> info .lt );
465453#endif
@@ -488,16 +476,14 @@ pg_wc_isgraph(pg_wchar c)
488476return (c <= (pg_wchar )127 &&
489477(pg_char_properties [c ]& PG_ISGRAPH ));
490478case PG_REGEX_LOCALE_WIDE :
491- #ifdef USE_WIDE_UPPER_LOWER
492479if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
493480return iswgraph ((wint_t )c );
494- #endif
495481/* FALL THRU */
496482case PG_REGEX_LOCALE_1BYTE :
497483return (c <= (pg_wchar )UCHAR_MAX &&
498484isgraph ((unsignedchar )c ));
499485case PG_REGEX_LOCALE_WIDE_L :
500- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
486+ #ifdef HAVE_LOCALE_T
501487if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
502488return iswgraph_l ((wint_t )c ,pg_regex_locale -> info .lt );
503489#endif
@@ -526,16 +512,14 @@ pg_wc_isprint(pg_wchar c)
526512return (c <= (pg_wchar )127 &&
527513(pg_char_properties [c ]& PG_ISPRINT ));
528514case PG_REGEX_LOCALE_WIDE :
529- #ifdef USE_WIDE_UPPER_LOWER
530515if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
531516return iswprint ((wint_t )c );
532- #endif
533517/* FALL THRU */
534518case PG_REGEX_LOCALE_1BYTE :
535519return (c <= (pg_wchar )UCHAR_MAX &&
536520isprint ((unsignedchar )c ));
537521case PG_REGEX_LOCALE_WIDE_L :
538- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
522+ #ifdef HAVE_LOCALE_T
539523if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
540524return iswprint_l ((wint_t )c ,pg_regex_locale -> info .lt );
541525#endif
@@ -564,16 +548,14 @@ pg_wc_ispunct(pg_wchar c)
564548return (c <= (pg_wchar )127 &&
565549(pg_char_properties [c ]& PG_ISPUNCT ));
566550case PG_REGEX_LOCALE_WIDE :
567- #ifdef USE_WIDE_UPPER_LOWER
568551if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
569552return iswpunct ((wint_t )c );
570- #endif
571553/* FALL THRU */
572554case PG_REGEX_LOCALE_1BYTE :
573555return (c <= (pg_wchar )UCHAR_MAX &&
574556ispunct ((unsignedchar )c ));
575557case PG_REGEX_LOCALE_WIDE_L :
576- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
558+ #ifdef HAVE_LOCALE_T
577559if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
578560return iswpunct_l ((wint_t )c ,pg_regex_locale -> info .lt );
579561#endif
@@ -602,16 +584,14 @@ pg_wc_isspace(pg_wchar c)
602584return (c <= (pg_wchar )127 &&
603585(pg_char_properties [c ]& PG_ISSPACE ));
604586case PG_REGEX_LOCALE_WIDE :
605- #ifdef USE_WIDE_UPPER_LOWER
606587if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
607588return iswspace ((wint_t )c );
608- #endif
609589/* FALL THRU */
610590case PG_REGEX_LOCALE_1BYTE :
611591return (c <= (pg_wchar )UCHAR_MAX &&
612592isspace ((unsignedchar )c ));
613593case PG_REGEX_LOCALE_WIDE_L :
614- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
594+ #ifdef HAVE_LOCALE_T
615595if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
616596return iswspace_l ((wint_t )c ,pg_regex_locale -> info .lt );
617597#endif
@@ -644,10 +624,8 @@ pg_wc_toupper(pg_wchar c)
644624/* force C behavior for ASCII characters, per comments above */
645625if (c <= (pg_wchar )127 )
646626return pg_ascii_toupper ((unsignedchar )c );
647- #ifdef USE_WIDE_UPPER_LOWER
648627if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
649628return towupper ((wint_t )c );
650- #endif
651629/* FALL THRU */
652630case PG_REGEX_LOCALE_1BYTE :
653631/* force C behavior for ASCII characters, per comments above */
@@ -657,7 +635,7 @@ pg_wc_toupper(pg_wchar c)
657635return toupper ((unsignedchar )c );
658636return c ;
659637case PG_REGEX_LOCALE_WIDE_L :
660- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
638+ #ifdef HAVE_LOCALE_T
661639if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
662640return towupper_l ((wint_t )c ,pg_regex_locale -> info .lt );
663641#endif
@@ -690,10 +668,8 @@ pg_wc_tolower(pg_wchar c)
690668/* force C behavior for ASCII characters, per comments above */
691669if (c <= (pg_wchar )127 )
692670return pg_ascii_tolower ((unsignedchar )c );
693- #ifdef USE_WIDE_UPPER_LOWER
694671if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
695672return towlower ((wint_t )c );
696- #endif
697673/* FALL THRU */
698674case PG_REGEX_LOCALE_1BYTE :
699675/* force C behavior for ASCII characters, per comments above */
@@ -703,7 +679,7 @@ pg_wc_tolower(pg_wchar c)
703679return tolower ((unsignedchar )c );
704680return c ;
705681case PG_REGEX_LOCALE_WIDE_L :
706- #if defined( HAVE_LOCALE_T ) && defined( USE_WIDE_UPPER_LOWER )
682+ #ifdef HAVE_LOCALE_T
707683if (sizeof (wchar_t ) >=4 || c <= (pg_wchar )0xFFFF )
708684return towlower_l ((wint_t )c ,pg_regex_locale -> info .lt );
709685#endif