Assume wcstombs(), towlower(), and sibling functions are always present.
authorTom Lane <[email protected]>
Fri, 22 Sep 2017 15:00:58 +0000 (11:00 -0400)
committerTom Lane <[email protected]>
Fri, 22 Sep 2017 15:00:58 +0000 (11:00 -0400)
These functions are required by SUS v2, which is our minimum baseline
for Unix platforms, and are present on all interesting Windows versions
as well.  Even our oldest buildfarm members have them.  Thus, we were not
testing the "!USE_WIDE_UPPER_LOWER" code paths, which explains why the bug
fixed in commit e6023ee7f escaped detection.  Per discussion, there seems
to be no more real-world value in maintaining this option.  Hence, remove
the configure-time tests for wcstombs() and towlower(), remove the
USE_WIDE_UPPER_LOWER symbol, and remove all the !USE_WIDE_UPPER_LOWER code.
There's not actually all that much of the latter, but simplifying the #if
nests is a win in itself.

Discussion: https://postgr.es/m/20170921052928[email protected]

13 files changed:
configure
configure.in
src/backend/regex/regc_pg_locale.c
src/backend/tsearch/regis.c
src/backend/tsearch/ts_locale.c
src/backend/tsearch/wparser_def.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/pg_locale.c
src/include/c.h
src/include/pg_config.h.in
src/include/pg_config.h.win32
src/include/tsearch/ts_locale.h
src/include/utils/pg_locale.h

index 5c38149a3df74a73dd2016d33ce2b9bcee23dde2..70d8aa649d5cfb956c42b7260418ac4a6dd96813 100755 (executable)
--- a/configure
+++ b/configure
@@ -12970,7 +12970,7 @@ fi
 LIBS_including_readline="$LIBS"
 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
-for ac_func in cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
+for ac_func in cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range utime utimes wcstombs_l
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index 176b29a79205470b607d0b4022e6adc978c03b8d..cdf11bf67342a132da3c72f1e02bc7272e231230 100644 (file)
@@ -1399,7 +1399,7 @@ PGAC_FUNC_WCSTOMBS_L
 LIBS_including_readline="$LIBS"
 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
-AC_CHECK_FUNCS([cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l])
+AC_CHECK_FUNCS([cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range utime utimes wcstombs_l])
 
 AC_REPLACE_FUNCS(fseeko)
 case $host_os in
index 6982879688b638a0eda047ed8bcfa99899900707..b2122e9e8fabc437bac439e2f1fa706890a0b8de 100644 (file)
@@ -268,7 +268,6 @@ pg_set_regex_collation(Oid collation)
            pg_regex_strategy = PG_REGEX_LOCALE_ICU;
        else
 #endif
-#ifdef USE_WIDE_UPPER_LOWER
        if (GetDatabaseEncoding() == PG_UTF8)
        {
            if (pg_regex_locale)
@@ -277,7 +276,6 @@ pg_set_regex_collation(Oid collation)
                pg_regex_strategy = PG_REGEX_LOCALE_WIDE;
        }
        else
-#endif                         /* USE_WIDE_UPPER_LOWER */
        {
            if (pg_regex_locale)
                pg_regex_strategy = PG_REGEX_LOCALE_1BYTE_L;
@@ -298,16 +296,14 @@ pg_wc_isdigit(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISDIGIT));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswdigit((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isdigit((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswdigit_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -336,16 +332,14 @@ pg_wc_isalpha(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISALPHA));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswalpha((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isalpha((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswalpha_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -374,16 +368,14 @@ pg_wc_isalnum(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISALNUM));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswalnum((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isalnum((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswalnum_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -412,16 +404,14 @@ pg_wc_isupper(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISUPPER));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswupper((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isupper((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswupper_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -450,16 +440,14 @@ pg_wc_islower(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISLOWER));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswlower((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    islower((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswlower_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -488,16 +476,14 @@ pg_wc_isgraph(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISGRAPH));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswgraph((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isgraph((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswgraph_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -526,16 +512,14 @@ pg_wc_isprint(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISPRINT));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswprint((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isprint((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswprint_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -564,16 +548,14 @@ pg_wc_ispunct(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISPUNCT));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswpunct((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    ispunct((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswpunct_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -602,16 +584,14 @@ pg_wc_isspace(pg_wchar c)
            return (c <= (pg_wchar) 127 &&
                    (pg_char_properties[c] & PG_ISSPACE));
        case PG_REGEX_LOCALE_WIDE:
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswspace((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            return (c <= (pg_wchar) UCHAR_MAX &&
                    isspace((unsigned char) c));
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return iswspace_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -644,10 +624,8 @@ pg_wc_toupper(pg_wchar c)
            /* force C behavior for ASCII characters, per comments above */
            if (c <= (pg_wchar) 127)
                return pg_ascii_toupper((unsigned char) c);
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return towupper((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            /* force C behavior for ASCII characters, per comments above */
@@ -657,7 +635,7 @@ pg_wc_toupper(pg_wchar c)
                return toupper((unsigned char) c);
            return c;
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return towupper_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
@@ -690,10 +668,8 @@ pg_wc_tolower(pg_wchar c)
            /* force C behavior for ASCII characters, per comments above */
            if (c <= (pg_wchar) 127)
                return pg_ascii_tolower((unsigned char) c);
-#ifdef USE_WIDE_UPPER_LOWER
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return towlower((wint_t) c);
-#endif
            /* FALL THRU */
        case PG_REGEX_LOCALE_1BYTE:
            /* force C behavior for ASCII characters, per comments above */
@@ -703,7 +679,7 @@ pg_wc_tolower(pg_wchar c)
                return tolower((unsigned char) c);
            return c;
        case PG_REGEX_LOCALE_WIDE_L:
-#if defined(HAVE_LOCALE_T) && defined(USE_WIDE_UPPER_LOWER)
+#ifdef HAVE_LOCALE_T
            if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
                return towlower_l((wint_t) c, pg_regex_locale->info.lt);
 #endif
index 2b89f596f080bd319ed2b97f8e3ca1de3da2949c..4a799f258597e02817e3271a1b92ea1996657740 100644 (file)
@@ -178,7 +178,6 @@ RS_free(Regis *r)
    r->node = NULL;
 }
 
-#ifdef USE_WIDE_UPPER_LOWER
 static bool
 mb_strchr(char *str, char *c)
 {
@@ -209,10 +208,6 @@ mb_strchr(char *str, char *c)
 
    return res;
 }
-#else
-#define mb_strchr(s,c) ( (strchr((s),*(c)) == NULL) ? false : true )
-#endif
-
 
 bool
 RS_execute(Regis *r, char *str)
index 1aa3e237338af6b16dfc63309b1c3b694fb1f6bc..7a6f0bc722122e0fe0ca3fbb3990e213e927bf03 100644 (file)
@@ -21,8 +21,6 @@
 static void tsearch_readline_callback(void *arg);
 
 
-#ifdef USE_WIDE_UPPER_LOWER
-
 int
 t_isdigit(const char *ptr)
 {
@@ -86,7 +84,6 @@ t_isprint(const char *ptr)
 
    return iswprint((wint_t) character[0]);
 }
-#endif                         /* USE_WIDE_UPPER_LOWER */
 
 
 /*
@@ -244,17 +241,12 @@ char *
 lowerstr_with_len(const char *str, int len)
 {
    char       *out;
-
-#ifdef USE_WIDE_UPPER_LOWER
    Oid         collation = DEFAULT_COLLATION_OID;  /* TODO */
    pg_locale_t mylocale = 0;   /* TODO */
-#endif
 
    if (len == 0)
        return pstrdup("");
 
-#ifdef USE_WIDE_UPPER_LOWER
-
    /*
     * Use wide char code only when max encoding length > 1 and ctype != C.
     * Some operating systems fail with multi-byte encodings and a C locale.
@@ -300,7 +292,6 @@ lowerstr_with_len(const char *str, int len)
        Assert(wlen < len);
    }
    else
-#endif                         /* USE_WIDE_UPPER_LOWER */
    {
        const char *ptr = str;
        char       *outptr;
index e841a1ccf0ed869c251252a40ea7a01ad6ab3736..c118357336d5023948f87fa094e764c06a10d970 100644 (file)
@@ -241,11 +241,9 @@ typedef struct TParser
    /* string and position information */
    char       *str;            /* multibyte string */
    int         lenstr;         /* length of mbstring */
-#ifdef USE_WIDE_UPPER_LOWER
    wchar_t    *wstr;           /* wide character string */
    pg_wchar   *pgwstr;         /* wide character string for C-locale */
    bool        usewide;
-#endif
 
    /* State of parse */
    int         charmaxlen;
@@ -294,8 +292,6 @@ TParserInit(char *str, int len)
    prs->str = str;
    prs->lenstr = len;
 
-#ifdef USE_WIDE_UPPER_LOWER
-
    /*
     * Use wide char code only when max encoding length > 1.
     */
@@ -323,7 +319,6 @@ TParserInit(char *str, int len)
    }
    else
        prs->usewide = false;
-#endif
 
    prs->state = newTParserPosition(NULL);
    prs->state->state = TPS_Base;
@@ -360,15 +355,12 @@ TParserCopyInit(const TParser *orig)
    prs->charmaxlen = orig->charmaxlen;
    prs->str = orig->str + orig->state->posbyte;
    prs->lenstr = orig->lenstr - orig->state->posbyte;
-
-#ifdef USE_WIDE_UPPER_LOWER
    prs->usewide = orig->usewide;
 
    if (orig->pgwstr)
        prs->pgwstr = orig->pgwstr + orig->state->poschar;
    if (orig->wstr)
        prs->wstr = orig->wstr + orig->state->poschar;
-#endif
 
    prs->state = newTParserPosition(NULL);
    prs->state->state = TPS_Base;
@@ -393,12 +385,10 @@ TParserClose(TParser *prs)
        prs->state = ptr;
    }
 
-#ifdef USE_WIDE_UPPER_LOWER
    if (prs->wstr)
        pfree(prs->wstr);
    if (prs->pgwstr)
        pfree(prs->pgwstr);
-#endif
 
 #ifdef WPARSER_TRACE
    fprintf(stderr, "closing parser\n");
@@ -437,8 +427,6 @@ TParserCopyClose(TParser *prs)
  * - if locale is C then we use pgwstr instead of wstr.
  */
 
-#ifdef USE_WIDE_UPPER_LOWER
-
 #define p_iswhat(type)                                                     \
 static int                                                                 \
 p_is##type(TParser *prs) {                                                 \
@@ -536,31 +524,6 @@ p_iseq(TParser *prs, char c)
    Assert(prs->state);
    return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
 }
-#else                          /* USE_WIDE_UPPER_LOWER */
-
-#define p_iswhat(type)                                                     \
-static int                                                                 \
-p_is##type(TParser *prs) {                                                 \
-   Assert( prs->state );                                                   \
-   return is##type( (unsigned char)*( prs->str + prs->state->posbyte ) );  \
-}  \
-                                                                           \
-static int                                                                 \
-p_isnot##type(TParser *prs) {                                              \
-   return !p_is##type(prs);                                                \
-}
-
-
-static int
-p_iseq(TParser *prs, char c)
-{
-   Assert(prs->state);
-   return (*(prs->str + prs->state->posbyte) == c) ? 1 : 0;
-}
-
-p_iswhat(alnum)
-p_iswhat(alpha)
-#endif                         /* USE_WIDE_UPPER_LOWER */
 
 p_iswhat(digit)
 p_iswhat(lower)
@@ -785,8 +748,6 @@ p_isspecial(TParser *prs)
    if (pg_dsplen(prs->str + prs->state->posbyte) == 0)
        return 1;
 
-#ifdef USE_WIDE_UPPER_LOWER
-
    /*
     * Unicode Characters in the 'Mark, Spacing Combining' Category That
     * characters are not alpha although they are not breakers of word too.
@@ -1050,7 +1011,6 @@ p_isspecial(TParser *prs)
                StopHigh = StopMiddle;
        }
    }
-#endif
 
    return 0;
 }
index 2bf484cda3178c22393336e94963e557bc0d4ef5..7877af2d6be3abeb63ed82383ec349ca6734372e 100644 (file)
@@ -1565,7 +1565,6 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
        else
 #endif
        {
-#ifdef USE_WIDE_UPPER_LOWER
            if (pg_database_encoding_max_length() > 1)
            {
                wchar_t    *workspace;
@@ -1604,7 +1603,6 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
                pfree(workspace);
            }
            else
-#endif                         /* USE_WIDE_UPPER_LOWER */
            {
                char       *p;
 
@@ -1689,7 +1687,6 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
        else
 #endif
        {
-#ifdef USE_WIDE_UPPER_LOWER
            if (pg_database_encoding_max_length() > 1)
            {
                wchar_t    *workspace;
@@ -1728,7 +1725,6 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
                pfree(workspace);
            }
            else
-#endif                         /* USE_WIDE_UPPER_LOWER */
            {
                char       *p;
 
@@ -1814,7 +1810,6 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
        else
 #endif
        {
-#ifdef USE_WIDE_UPPER_LOWER
            if (pg_database_encoding_max_length() > 1)
            {
                wchar_t    *workspace;
@@ -1865,7 +1860,6 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
                pfree(workspace);
            }
            else
-#endif                         /* USE_WIDE_UPPER_LOWER */
            {
                char       *p;
 
index 3d3d8aa4b6534bfceb65a7c0c06d312f5c104d9b..5ad75efb7a244cb41056ab58ff9c9e95e967889c 100644 (file)
@@ -1587,6 +1587,7 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
 
    return len_result;
 }
+
 #endif                         /* USE_ICU */
 
 /*
@@ -1594,8 +1595,6 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
  * Therefore we keep them here rather than with the mbutils code.
  */
 
-#ifdef USE_WIDE_UPPER_LOWER
-
 /*
  * wchar2char --- convert wide characters to multibyte format
  *
@@ -1762,5 +1761,3 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
 
    return result;
 }
-
-#endif                         /* USE_WIDE_UPPER_LOWER */
index fd53010e249f65ecf85d48536bfb96d206f6c9af..b6a969787aca19b2bc39114ea57020b0c88a2b3a 100644 (file)
@@ -1095,14 +1095,6 @@ extern int   fdatasync(int fildes);
 #define HAVE_STRTOULL 1
 #endif
 
-/*
- * We assume if we have these two functions, we have their friends too, and
- * can use the wide-character functions.
- */
-#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
-#define USE_WIDE_UPPER_LOWER
-#endif
-
 /* EXEC_BACKEND defines */
 #ifdef EXEC_BACKEND
 #define NON_EXEC_STATIC
index 85deb29d8316c2a2472feab2cdc7667ff33a747d..2a4e9f60500b22502fb383e6d1c3792ea3e95442 100644 (file)
    `HAVE_STRUCT_TM_TM_ZONE' instead. */
 #undef HAVE_TM_ZONE
 
-/* Define to 1 if you have the `towlower' function. */
-#undef HAVE_TOWLOWER
-
 /* Define to 1 if your compiler understands `typeof' or something similar. */
 #undef HAVE_TYPEOF
 
 /* Define to 1 if you have the <wchar.h> header file. */
 #undef HAVE_WCHAR_H
 
-/* Define to 1 if you have the `wcstombs' function. */
-#undef HAVE_WCSTOMBS
-
 /* Define to 1 if you have the `wcstombs_l' function. */
 #undef HAVE_WCSTOMBS_L
 
index 27aab21be7785029b862c46ce9cf1a9e26df0eff..b6808d581b9a0e482287948b615baa325e101cd6 100644 (file)
    `HAVE_STRUCT_TM_TM_ZONE' instead. */
 /* #undef HAVE_TM_ZONE */
 
-/* Define to 1 if you have the `towlower' function. */
-#define HAVE_TOWLOWER 1
-
 /* Define to 1 if your compiler understands `typeof' or something similar. */
 /* #undef HAVE_TYPEOF */
 
 /* Define to 1 if you have the <wchar.h> header file. */
 #define HAVE_WCHAR_H 1
 
-/* Define to 1 if you have the `wcstombs' function. */
-#define HAVE_WCSTOMBS 1
-
 /* Define to 1 if you have the `wcstombs_l' function. */
 #define HAVE_WCSTOMBS_L 1
 
index c32f0743aa68200302151bf3f72412a630b443f3..3ec276fc05d80b2b27ffa5093413d3dfeb1ae335 100644 (file)
@@ -41,27 +41,15 @@ typedef struct
 
 #define TOUCHAR(x) (*((const unsigned char *) (x)))
 
-#ifdef USE_WIDE_UPPER_LOWER
-
-extern int t_isdigit(const char *ptr);
-extern int t_isspace(const char *ptr);
-extern int t_isalpha(const char *ptr);
-extern int t_isprint(const char *ptr);
-
 /* The second argument of t_iseq() must be a plain ASCII character */
 #define t_iseq(x,c)        (TOUCHAR(x) == (unsigned char) (c))
 
 #define COPYCHAR(d,s)  memcpy(d, s, pg_mblen(s))
-#else                          /* not USE_WIDE_UPPER_LOWER */
 
-#define t_isdigit(x)   isdigit(TOUCHAR(x))
-#define t_isspace(x)   isspace(TOUCHAR(x))
-#define t_isalpha(x)   isalpha(TOUCHAR(x))
-#define t_isprint(x)   isprint(TOUCHAR(x))
-#define t_iseq(x,c)        (TOUCHAR(x) == (unsigned char) (c))
-
-#define COPYCHAR(d,s)  (*((unsigned char *) (d)) = TOUCHAR(s))
-#endif                         /* USE_WIDE_UPPER_LOWER */
+extern int t_isdigit(const char *ptr);
+extern int t_isspace(const char *ptr);
+extern int t_isalpha(const char *ptr);
+extern int t_isprint(const char *ptr);
 
 extern char *lowerstr(const char *str);
 extern char *lowerstr_with_len(const char *str, int len);
index f3e04d4d8cee66c08bf848f8da067e97250878b4..b633511a7a5e07cb3c6a454f0fad6c16bac6c1ba 100644 (file)
@@ -110,11 +110,9 @@ extern int32_t icu_from_uchar(char **result, const UChar *buff_uchar, int32_t le
 #endif
 
 /* These functions convert from/to libc's wchar_t, *not* pg_wchar_t */
-#ifdef USE_WIDE_UPPER_LOWER
 extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen,
           pg_locale_t locale);
 extern size_t char2wchar(wchar_t *to, size_t tolen,
           const char *from, size_t fromlen, pg_locale_t locale);
-#endif
 
 #endif                         /* _PG_LOCALE_ */