summaryrefslogtreecommitdiff
path: root/src/include/tsearch
diff options
context:
space:
mode:
authorTom Lane2017-09-22 15:00:58 +0000
committerTom Lane2017-09-22 15:00:58 +0000
commit85feb77aa09cda9ff3e12cf95c757c499dc25343 (patch)
tree313b8bb0eb9cf4cff63a92dd5345d9d5c51b3b3a /src/include/tsearch
parente6023ee7fa73a2d9a2d7524f63584844b2291def (diff)
Assume wcstombs(), towlower(), and sibling functions are always present.
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.GA188913@rfd.leadboat.com
Diffstat (limited to 'src/include/tsearch')
-rw-r--r--src/include/tsearch/ts_locale.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index c32f0743aa6..3ec276fc05d 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -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);