summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2008-06-17 16:09:06 +0000
committerBruce Momjian2008-06-17 16:09:06 +0000
commitdc69c0362f291897273a67cb0ccf5d03d11026f2 (patch)
tree0082403981e6aff67e49b20867721664091dabc1 /src/include
parent2e835a4961eab760d1b08aeebd40a755d507999f (diff)
Move USE_WIDE_UPPER_LOWER define to c.h, and remove TS_USE_WIDE and use
USE_WIDE_UPPER_LOWER instead.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h10
-rw-r--r--src/include/tsearch/ts_locale.h12
2 files changed, 13 insertions, 9 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 86b0d9f9997..16ccb4cf4e3 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.226 2008/04/21 00:26:46 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.227 2008/06/17 16:09:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -813,6 +813,14 @@ 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
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 383acbc1bb3..adeeebac187 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 1998-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.5 2008/01/01 19:45:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.6 2008/06/17 16:09:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,13 +29,9 @@
#include <wctype.h>
#endif
-#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
-#define TS_USE_WIDE
-#endif
-
#define TOUCHAR(x) (*((const unsigned char *) (x)))
-#ifdef TS_USE_WIDE
+#ifdef USE_WIDE_UPPER_LOWER
extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen);
extern size_t char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen);
@@ -49,7 +45,7 @@ extern int t_isprint(const char *ptr);
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
#define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s))
-#else /* not TS_USE_WIDE */
+#else /* not USE_WIDE_UPPER_LOWER */
#define t_isdigit(x) isdigit(TOUCHAR(x))
#define t_isspace(x) isspace(TOUCHAR(x))
@@ -58,7 +54,7 @@ extern int t_isprint(const char *ptr);
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
#define COPYCHAR(d,s) (*((unsigned char *) (d)) = TOUCHAR(s))
-#endif /* TS_USE_WIDE */
+#endif /* USE_WIDE_UPPER_LOWER */
extern char *lowerstr(const char *str);
extern char *lowerstr_with_len(const char *str, int len);