Skip to content

Commit dc69c03

Browse files
committed
Move USE_WIDE_UPPER_LOWER define to c.h, and remove TS_USE_WIDE and use
USE_WIDE_UPPER_LOWER instead.
1 parent 2e835a4 commit dc69c03

File tree

7 files changed

+31
-32
lines changed

7 files changed

+31
-32
lines changed

src/backend/tsearch/regis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.4 2008/01/21 02:46:10 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.5 2008/06/17 16:09:06 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -178,7 +178,7 @@ RS_free(Regis *r)
178178
r->node = NULL;
179179
}
180180

181-
#ifdef TS_USE_WIDE
181+
#ifdef USE_WIDE_UPPER_LOWER
182182
static bool
183183
mb_strchr(char *str, char *c)
184184
{

src/backend/tsearch/ts_locale.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.7 2008/01/01 19:45:52 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.8 2008/06/17 16:09:06 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -17,7 +17,7 @@
1717
#include "tsearch/ts_public.h"
1818

1919

20-
#ifdef TS_USE_WIDE
20+
#ifdef USE_WIDE_UPPER_LOWER
2121

2222
/*
2323
* wchar2char --- convert wide characters to multibyte format
@@ -190,7 +190,7 @@ t_isprint(const char *ptr)
190190

191191
return iswprint((wint_t) character[0]);
192192
}
193-
#endif /* TS_USE_WIDE */
193+
#endif /* USE_WIDE_UPPER_LOWER */
194194

195195

196196
/*
@@ -260,7 +260,7 @@ lowerstr_with_len(const char *str, int len)
260260
if (len == 0)
261261
return pstrdup("");
262262

263-
#ifdef TS_USE_WIDE
263+
#ifdef USE_WIDE_UPPER_LOWER
264264

265265
/*
266266
* Use wide char code only when max encoding length > 1 and ctype != C.
@@ -307,7 +307,7 @@ lowerstr_with_len(const char *str, int len)
307307
Assert(wlen < len);
308308
}
309309
else
310-
#endif /* TS_USE_WIDE */
310+
#endif /* USE_WIDE_UPPER_LOWER */
311311
{
312312
const char *ptr = str;
313313
char *outptr;

src/backend/tsearch/wparser_def.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.14 2008/01/01 19:45:52 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.15 2008/06/17 16:09:06 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -238,7 +238,7 @@ typedef struct TParser
238238
/* string and position information */
239239
char *str; /* multibyte string */
240240
int lenstr; /* length of mbstring */
241-
#ifdef TS_USE_WIDE
241+
#ifdef USE_WIDE_UPPER_LOWER
242242
wchar_t *wstr; /* wide character string */
243243
int lenwstr; /* length of wsting */
244244
#endif
@@ -291,7 +291,7 @@ TParserInit(char *str, int len)
291291
prs->str = str;
292292
prs->lenstr = len;
293293

294-
#ifdef TS_USE_WIDE
294+
#ifdef USE_WIDE_UPPER_LOWER
295295

296296
/*
297297
* Use wide char code only when max encoding length > 1.
@@ -328,7 +328,7 @@ TParserClose(TParser *prs)
328328
prs->state = ptr;
329329
}
330330

331-
#ifdef TS_USE_WIDE
331+
#ifdef USE_WIDE_UPPER_LOWER
332332
if (prs->wstr)
333333
pfree(prs->wstr);
334334
#endif
@@ -344,7 +344,7 @@ TParserClose(TParser *prs)
344344
* often are used for Asian languages
345345
*/
346346

347-
#ifdef TS_USE_WIDE
347+
#ifdef USE_WIDE_UPPER_LOWER
348348

349349
#define p_iswhat(type) \
350350
static int \
@@ -439,7 +439,7 @@ p_iseq(TParser *prs, char c)
439439
Assert(prs->state);
440440
return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
441441
}
442-
#else /* TS_USE_WIDE */
442+
#else /* USE_WIDE_UPPER_LOWER */
443443

444444
#define p_iswhat(type) \
445445
static int \
@@ -463,7 +463,7 @@ p_iseq(TParser *prs, char c)
463463

464464
p_iswhat(alnum)
465465
p_iswhat(alpha)
466-
#endif /* TS_USE_WIDE */
466+
#endif /* USE_WIDE_UPPER_LOWER */
467467

468468
p_iswhat(digit)
469469
p_iswhat(lower)

src/backend/utils/adt/formatting.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.141 2008/05/20 01:41:02 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.142 2008/06/17 16:09:06 momjian Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -948,8 +948,7 @@ static NUMCacheEntry *NUM_cache_search(char *str);
948948
static NUMCacheEntry *NUM_cache_getnew(char *str);
949949
static void NUM_cache_remove(NUMCacheEntry *ent);
950950

951-
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
952-
#define USE_WIDE_UPPER_LOWER
951+
#ifdef USE_WIDE_UPPER_LOWER
953952
/* externs are in oracle_compat.c */
954953
extern char *wstring_upper(char *str);
955954
extern char *wstring_lower(char *str);

src/backend/utils/adt/oracle_compat.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.79 2008/05/19 18:08:16 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.80 2008/06/17 16:09:06 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -40,12 +40,8 @@
4040
* functions, which of course will not work as desired in multibyte character
4141
* sets. Note that in either case we are effectively assuming that the
4242
* database character encoding matches the encoding implied by LC_CTYPE.
43-
*
44-
* We assume if we have these two functions, we have their friends too, and
45-
* can use the wide-character method.
4643
*/
47-
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
48-
#define USE_WIDE_UPPER_LOWER
44+
#ifdef USE_WIDE_UPPER_LOWER
4945
char *wstring_lower(char *str);
5046
char *wstring_upper(char *str);
5147
wchar_t *texttowcs(const text *txt);

src/include/c.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/c.h,v 1.226 2008/04/21 00:26:46 tgl Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.227 2008/06/17 16:09:06 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -813,6 +813,14 @@ extern int fdatasync(int fildes);
813813
#define HAVE_STRTOULL 1
814814
#endif
815815

816+
/*
817+
* We assume if we have these two functions, we have their friends too, and
818+
* can use the wide-character functions.
819+
*/
820+
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
821+
#define USE_WIDE_UPPER_LOWER
822+
#endif
823+
816824
/* EXEC_BACKEND defines */
817825
#ifdef EXEC_BACKEND
818826
#define NON_EXEC_STATIC

src/include/tsearch/ts_locale.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1998-2008, PostgreSQL Global Development Group
77
*
8-
* $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.5 2008/01/01 19:45:59 momjian Exp $
8+
* $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.6 2008/06/17 16:09:06 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -29,13 +29,9 @@
2929
#include <wctype.h>
3030
#endif
3131

32-
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
33-
#define TS_USE_WIDE
34-
#endif
35-
3632
#define TOUCHAR(x) (*((const unsigned char *) (x)))
3733

38-
#ifdef TS_USE_WIDE
34+
#ifdef USE_WIDE_UPPER_LOWER
3935

4036
extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen);
4137
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);
4945
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
5046

5147
#define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s))
52-
#else /* not TS_USE_WIDE */
48+
#else /* not USE_WIDE_UPPER_LOWER */
5349

5450
#define t_isdigit(x) isdigit(TOUCHAR(x))
5551
#define t_isspace(x) isspace(TOUCHAR(x))
@@ -58,7 +54,7 @@ extern int t_isprint(const char *ptr);
5854
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
5955

6056
#define COPYCHAR(d,s) (*((unsigned char *) (d)) = TOUCHAR(s))
61-
#endif /* TS_USE_WIDE */
57+
#endif /* USE_WIDE_UPPER_LOWER */
6258

6359
extern char *lowerstr(const char *str);
6460
extern char *lowerstr_with_len(const char *str, int len);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy