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