Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc69c03

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 parent2e835a4 commitdc69c03

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-
#ifdefTS_USE_WIDE
181+
#ifdefUSE_WIDE_UPPER_LOWER
182182
staticbool
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-
#ifdefTS_USE_WIDE
20+
#ifdefUSE_WIDE_UPPER_LOWER
2121

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

191191
returniswprint((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
returnpstrdup("");
262262

263-
#ifdefTS_USE_WIDE
263+
#ifdefUSE_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
constchar*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
intlenstr;/* length of mbstring */
241-
#ifdefTS_USE_WIDE
241+
#ifdefUSE_WIDE_UPPER_LOWER
242242
wchar_t*wstr;/* wide character string */
243243
intlenwstr;/* length of wsting */
244244
#endif
@@ -291,7 +291,7 @@ TParserInit(char *str, int len)
291291
prs->str=str;
292292
prs->lenstr=len;
293293

294-
#ifdefTS_USE_WIDE
294+
#ifdefUSE_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-
#ifdefTS_USE_WIDE
331+
#ifdefUSE_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-
#ifdefTS_USE_WIDE
347+
#ifdefUSE_WIDE_UPPER_LOWER
348348

349349
#definep_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
#definep_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
staticNUMCacheEntry*NUM_cache_getnew(char*str);
949949
staticvoidNUM_cache_remove(NUMCacheEntry*ent);
950950

951-
#if defined(HAVE_WCSTOMBS)&& defined(HAVE_TOWLOWER)
952-
#defineUSE_WIDE_UPPER_LOWER
951+
#ifdefUSE_WIDE_UPPER_LOWER
953952
/* externs are in oracle_compat.c */
954953
externchar*wstring_upper(char*str);
955954
externchar*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-
#defineUSE_WIDE_UPPER_LOWER
44+
#ifdefUSE_WIDE_UPPER_LOWER
4945
char*wstring_lower(char*str);
5046
char*wstring_upper(char*str);
5147
wchar_t*texttowcs(consttext*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 intfdatasync(int fildes);
813813
#defineHAVE_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+
#defineUSE_WIDE_UPPER_LOWER
822+
#endif
823+
816824
/* EXEC_BACKEND defines */
817825
#ifdefEXEC_BACKEND
818826
#defineNON_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-
#defineTS_USE_WIDE
34-
#endif
35-
3632
#defineTOUCHAR(x)(*((const unsigned char *) (x)))
3733

38-
#ifdefTS_USE_WIDE
34+
#ifdefUSE_WIDE_UPPER_LOWER
3935

4036
externsize_twchar2char(char*to,constwchar_t*from,size_ttolen);
4137
externsize_tchar2wchar(wchar_t*to,size_ttolen,constchar*from,size_tfromlen);
@@ -49,7 +45,7 @@ extern intt_isprint(const char *ptr);
4945
#definet_iseq(x,c)(TOUCHAR(x) == (unsigned char) (c))
5046

5147
#defineCOPYCHAR(d,s)memcpy(d, s, pg_mblen(s))
52-
#else/* notTS_USE_WIDE */
48+
#else/* notUSE_WIDE_UPPER_LOWER */
5349

5450
#definet_isdigit(x)isdigit(TOUCHAR(x))
5551
#definet_isspace(x)isspace(TOUCHAR(x))
@@ -58,7 +54,7 @@ extern intt_isprint(const char *ptr);
5854
#definet_iseq(x,c)(TOUCHAR(x) == (unsigned char) (c))
5955

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

6359
externchar*lowerstr(constchar*str);
6460
externchar*lowerstr_with_len(constchar*str,intlen);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp