~ubuntu-branches/ubuntu/vivid/gzip/vivid

« back to all changes in this revision

Viewing changes to lib/wchar.in.h

  • Committer: Steve Langasek
  • Date: 2012-06-29 02:07:40 UTC
  • mfrom: (4.1.9 sid)
  • Revision ID: steve.langasek@canonical.com-20120629020740-qqikrblzana08v2y
Merge version 1.5-1.1 from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
4
2
 
5
 
   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
3
   Copyright (C) 2007-2012 Free Software Foundation, Inc.
6
4
 
7
5
   This program is free software; you can redistribute it and/or modify
8
6
   it under the terms of the GNU General Public License as published by
15
13
   GNU General Public License for more details.
16
14
 
17
15
   You should have received a copy of the GNU General Public License
18
 
   along with this program; if not, write to the Free Software Foundation,
19
 
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
16
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
20
17
 
21
18
/* Written by Eric Blake.  */
22
19
 
31
28
#if __GNUC__ >= 3
32
29
@PRAGMA_SYSTEM_HEADER@
33
30
#endif
 
31
@PRAGMA_COLUMNS@
34
32
 
35
33
#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
36
34
/* Special invocation convention:
50
48
#else
51
49
/* Normal invocation convention.  */
52
50
 
53
 
#ifndef _GL_WCHAR_H
 
51
#ifndef _@GUARD_PREFIX@_WCHAR_H
54
52
 
55
53
#define _GL_ALREADY_INCLUDING_WCHAR_H
56
54
 
 
55
#if @HAVE_FEATURES_H@
 
56
# include <features.h> /* for __GLIBC__ */
 
57
#endif
 
58
 
57
59
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
58
60
   <wchar.h>.
59
61
   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
60
62
   included before <wchar.h>.
 
63
   In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
 
64
   by <stddef.h>.
61
65
   But avoid namespace pollution on glibc systems.  */
 
66
#if !(defined __GLIBC__ && !defined __UCLIBC__)
 
67
# include <stddef.h>
 
68
#endif
62
69
#ifndef __GLIBC__
63
 
# include <stddef.h>
64
70
# include <stdio.h>
65
71
# include <time.h>
66
72
#endif
74
80
 
75
81
#undef _GL_ALREADY_INCLUDING_WCHAR_H
76
82
 
77
 
#ifndef _GL_WCHAR_H
78
 
#define _GL_WCHAR_H
79
 
 
80
 
/* The definition of GL_LINK_WARNING is copied here.  */
 
83
#ifndef _@GUARD_PREFIX@_WCHAR_H
 
84
#define _@GUARD_PREFIX@_WCHAR_H
 
85
 
 
86
/* The __attribute__ feature is available in gcc versions 2.5 and later.
 
87
   The attribute __pure__ was added in gcc 2.96.  */
 
88
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 
89
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 
90
#else
 
91
# define _GL_ATTRIBUTE_PURE /* empty */
 
92
#endif
 
93
 
 
94
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
81
95
 
82
96
/* The definition of _GL_ARG_NONNULL is copied here.  */
83
97
 
84
 
#ifdef __cplusplus
85
 
extern "C" {
86
 
#endif
87
 
 
88
 
 
89
 
/* Define wint_t.  (Also done in wctype.in.h.)  */
 
98
/* The definition of _GL_WARN_ON_USE is copied here.  */
 
99
 
 
100
 
 
101
/* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
90
102
#if !@HAVE_WINT_T@ && !defined wint_t
91
103
# define wint_t int
92
104
# ifndef WEOF
93
105
#  define WEOF -1
94
106
# endif
 
107
#else
 
108
/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
 
109
   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
 
110
   "unchanged by default argument promotions".  Override it.  */
 
111
# if defined _MSC_VER
 
112
#  if !GNULIB_defined_wint_t
 
113
#   include <crtdefs.h>
 
114
typedef unsigned int rpl_wint_t;
 
115
#   undef wint_t
 
116
#   define wint_t rpl_wint_t
 
117
#   define GNULIB_defined_wint_t 1
 
118
#  endif
 
119
# endif
 
120
# ifndef WEOF
 
121
#  define WEOF ((wint_t) -1)
 
122
# endif
95
123
#endif
96
124
 
97
125
 
99
127
   On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
100
128
   implementing mbrtowc for encodings like UTF-8.  */
101
129
#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
 
130
# if !GNULIB_defined_mbstate_t
102
131
typedef int rpl_mbstate_t;
103
 
# undef mbstate_t
104
 
# define mbstate_t rpl_mbstate_t
105
 
# define GNULIB_defined_mbstate_t 1
 
132
#  undef mbstate_t
 
133
#  define mbstate_t rpl_mbstate_t
 
134
#  define GNULIB_defined_mbstate_t 1
 
135
# endif
106
136
#endif
107
137
 
108
138
 
109
139
/* Convert a single-byte character to a wide character.  */
110
140
#if @GNULIB_BTOWC@
111
141
# if @REPLACE_BTOWC@
112
 
#  undef btowc
113
 
#  define btowc rpl_btowc
114
 
# endif
115
 
# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
116
 
extern wint_t btowc (int c);
117
 
# endif
 
142
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
143
#   undef btowc
 
144
#   define btowc rpl_btowc
 
145
#  endif
 
146
_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 
147
_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
 
148
# else
 
149
#  if !@HAVE_BTOWC@
 
150
_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 
151
#  endif
 
152
_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
 
153
# endif
 
154
_GL_CXXALIASWARN (btowc);
118
155
#elif defined GNULIB_POSIXCHECK
119
156
# undef btowc
120
 
# define btowc(c) \
121
 
    (GL_LINK_WARNING ("btowc is unportable - " \
122
 
                      "use gnulib module btowc for portability"), \
123
 
     btowc (c))
 
157
# if HAVE_RAW_DECL_BTOWC
 
158
_GL_WARN_ON_USE (btowc, "btowc is unportable - "
 
159
                 "use gnulib module btowc for portability");
 
160
# endif
124
161
#endif
125
162
 
126
163
 
127
164
/* Convert a wide character to a single-byte character.  */
128
165
#if @GNULIB_WCTOB@
129
166
# if @REPLACE_WCTOB@
130
 
#  undef wctob
131
 
#  define wctob rpl_wctob
132
 
# endif
133
 
# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
 
167
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
168
#   undef wctob
 
169
#   define wctob rpl_wctob
 
170
#  endif
 
171
_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 
172
_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
 
173
# else
 
174
#  if !defined wctob && !@HAVE_DECL_WCTOB@
134
175
/* wctob is provided by gnulib, or wctob exists but is not declared.  */
135
 
extern int wctob (wint_t wc);
 
176
_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 
177
#  endif
 
178
_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
136
179
# endif
 
180
_GL_CXXALIASWARN (wctob);
137
181
#elif defined GNULIB_POSIXCHECK
138
182
# undef wctob
139
 
# define wctob(w) \
140
 
    (GL_LINK_WARNING ("wctob is unportable - " \
141
 
                      "use gnulib module wctob for portability"), \
142
 
     wctob (w))
 
183
# if HAVE_RAW_DECL_WCTOB
 
184
_GL_WARN_ON_USE (wctob, "wctob is unportable - "
 
185
                 "use gnulib module wctob for portability");
 
186
# endif
143
187
#endif
144
188
 
145
189
 
146
190
/* Test whether *PS is in the initial state.  */
147
191
#if @GNULIB_MBSINIT@
148
192
# if @REPLACE_MBSINIT@
149
 
#  undef mbsinit
150
 
#  define mbsinit rpl_mbsinit
151
 
# endif
152
 
# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
153
 
extern int mbsinit (const mbstate_t *ps);
154
 
# endif
 
193
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
194
#   undef mbsinit
 
195
#   define mbsinit rpl_mbsinit
 
196
#  endif
 
197
_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
 
198
_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
 
199
# else
 
200
#  if !@HAVE_MBSINIT@
 
201
_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
 
202
#  endif
 
203
_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
 
204
# endif
 
205
_GL_CXXALIASWARN (mbsinit);
155
206
#elif defined GNULIB_POSIXCHECK
156
207
# undef mbsinit
157
 
# define mbsinit(p) \
158
 
    (GL_LINK_WARNING ("mbsinit is unportable - " \
159
 
                      "use gnulib module mbsinit for portability"), \
160
 
     mbsinit (p))
 
208
# if HAVE_RAW_DECL_MBSINIT
 
209
_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
 
210
                 "use gnulib module mbsinit for portability");
 
211
# endif
161
212
#endif
162
213
 
163
214
 
164
215
/* Convert a multibyte character to a wide character.  */
165
216
#if @GNULIB_MBRTOWC@
166
217
# if @REPLACE_MBRTOWC@
167
 
#  undef mbrtowc
168
 
#  define mbrtowc rpl_mbrtowc
169
 
# endif
170
 
# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
171
 
extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
172
 
# endif
 
218
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
219
#   undef mbrtowc
 
220
#   define mbrtowc rpl_mbrtowc
 
221
#  endif
 
222
_GL_FUNCDECL_RPL (mbrtowc, size_t,
 
223
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 
224
_GL_CXXALIAS_RPL (mbrtowc, size_t,
 
225
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 
226
# else
 
227
#  if !@HAVE_MBRTOWC@
 
228
_GL_FUNCDECL_SYS (mbrtowc, size_t,
 
229
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 
230
#  endif
 
231
_GL_CXXALIAS_SYS (mbrtowc, size_t,
 
232
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 
233
# endif
 
234
_GL_CXXALIASWARN (mbrtowc);
173
235
#elif defined GNULIB_POSIXCHECK
174
236
# undef mbrtowc
175
 
# define mbrtowc(w,s,n,p) \
176
 
    (GL_LINK_WARNING ("mbrtowc is unportable - " \
177
 
                      "use gnulib module mbrtowc for portability"), \
178
 
     mbrtowc (w, s, n, p))
 
237
# if HAVE_RAW_DECL_MBRTOWC
 
238
_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
 
239
                 "use gnulib module mbrtowc for portability");
 
240
# endif
179
241
#endif
180
242
 
181
243
 
182
244
/* Recognize a multibyte character.  */
183
245
#if @GNULIB_MBRLEN@
184
246
# if @REPLACE_MBRLEN@
185
 
#  undef mbrlen
186
 
#  define mbrlen rpl_mbrlen
187
 
# endif
188
 
# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
189
 
extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
190
 
# endif
 
247
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
248
#   undef mbrlen
 
249
#   define mbrlen rpl_mbrlen
 
250
#  endif
 
251
_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 
252
_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 
253
# else
 
254
#  if !@HAVE_MBRLEN@
 
255
_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 
256
#  endif
 
257
_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 
258
# endif
 
259
_GL_CXXALIASWARN (mbrlen);
191
260
#elif defined GNULIB_POSIXCHECK
192
261
# undef mbrlen
193
 
# define mbrlen(s,n,p) \
194
 
    (GL_LINK_WARNING ("mbrlen is unportable - " \
195
 
                      "use gnulib module mbrlen for portability"), \
196
 
     mbrlen (s, n, p))
 
262
# if HAVE_RAW_DECL_MBRLEN
 
263
_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
 
264
                 "use gnulib module mbrlen for portability");
 
265
# endif
197
266
#endif
198
267
 
199
268
 
200
269
/* Convert a string to a wide string.  */
201
270
#if @GNULIB_MBSRTOWCS@
202
271
# if @REPLACE_MBSRTOWCS@
203
 
#  undef mbsrtowcs
204
 
#  define mbsrtowcs rpl_mbsrtowcs
205
 
# endif
206
 
# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
207
 
extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
208
 
     _GL_ARG_NONNULL ((2));
209
 
# endif
 
272
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
273
#   undef mbsrtowcs
 
274
#   define mbsrtowcs rpl_mbsrtowcs
 
275
#  endif
 
276
_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
 
277
                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
 
278
                  _GL_ARG_NONNULL ((2)));
 
279
_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
 
280
                  (wchar_t *dest, const char **srcp, size_t len,
 
281
                   mbstate_t *ps));
 
282
# else
 
283
#  if !@HAVE_MBSRTOWCS@
 
284
_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
 
285
                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
 
286
                  _GL_ARG_NONNULL ((2)));
 
287
#  endif
 
288
_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
 
289
                  (wchar_t *dest, const char **srcp, size_t len,
 
290
                   mbstate_t *ps));
 
291
# endif
 
292
_GL_CXXALIASWARN (mbsrtowcs);
210
293
#elif defined GNULIB_POSIXCHECK
211
294
# undef mbsrtowcs
212
 
# define mbsrtowcs(d,s,l,p) \
213
 
    (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
214
 
                      "use gnulib module mbsrtowcs for portability"), \
215
 
     mbsrtowcs (d, s, l, p))
 
295
# if HAVE_RAW_DECL_MBSRTOWCS
 
296
_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
 
297
                 "use gnulib module mbsrtowcs for portability");
 
298
# endif
216
299
#endif
217
300
 
218
301
 
219
302
/* Convert a string to a wide string.  */
220
303
#if @GNULIB_MBSNRTOWCS@
221
304
# if @REPLACE_MBSNRTOWCS@
222
 
#  undef mbsnrtowcs
223
 
#  define mbsnrtowcs rpl_mbsnrtowcs
224
 
# endif
225
 
# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
226
 
extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps)
227
 
     _GL_ARG_NONNULL ((2));
228
 
# endif
 
305
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
306
#   undef mbsnrtowcs
 
307
#   define mbsnrtowcs rpl_mbsnrtowcs
 
308
#  endif
 
309
_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
 
310
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
 
311
                   mbstate_t *ps)
 
312
                  _GL_ARG_NONNULL ((2)));
 
313
_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
 
314
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
 
315
                   mbstate_t *ps));
 
316
# else
 
317
#  if !@HAVE_MBSNRTOWCS@
 
318
_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
 
319
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
 
320
                   mbstate_t *ps)
 
321
                  _GL_ARG_NONNULL ((2)));
 
322
#  endif
 
323
_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
 
324
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
 
325
                   mbstate_t *ps));
 
326
# endif
 
327
_GL_CXXALIASWARN (mbsnrtowcs);
229
328
#elif defined GNULIB_POSIXCHECK
230
329
# undef mbsnrtowcs
231
 
# define mbsnrtowcs(d,s,n,l,p) \
232
 
    (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
233
 
                      "use gnulib module mbsnrtowcs for portability"), \
234
 
     mbsnrtowcs (d, s, n, l, p))
 
330
# if HAVE_RAW_DECL_MBSNRTOWCS
 
331
_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
 
332
                 "use gnulib module mbsnrtowcs for portability");
 
333
# endif
235
334
#endif
236
335
 
237
336
 
238
337
/* Convert a wide character to a multibyte character.  */
239
338
#if @GNULIB_WCRTOMB@
240
339
# if @REPLACE_WCRTOMB@
241
 
#  undef wcrtomb
242
 
#  define wcrtomb rpl_wcrtomb
243
 
# endif
244
 
# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
245
 
extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
246
 
# endif
 
340
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
341
#   undef wcrtomb
 
342
#   define wcrtomb rpl_wcrtomb
 
343
#  endif
 
344
_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 
345
_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 
346
# else
 
347
#  if !@HAVE_WCRTOMB@
 
348
_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 
349
#  endif
 
350
_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 
351
# endif
 
352
_GL_CXXALIASWARN (wcrtomb);
247
353
#elif defined GNULIB_POSIXCHECK
248
354
# undef wcrtomb
249
 
# define wcrtomb(s,w,p) \
250
 
    (GL_LINK_WARNING ("wcrtomb is unportable - " \
251
 
                      "use gnulib module wcrtomb for portability"), \
252
 
     wcrtomb (s, w, p))
 
355
# if HAVE_RAW_DECL_WCRTOMB
 
356
_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
 
357
                 "use gnulib module wcrtomb for portability");
 
358
# endif
253
359
#endif
254
360
 
255
361
 
256
362
/* Convert a wide string to a string.  */
257
363
#if @GNULIB_WCSRTOMBS@
258
364
# if @REPLACE_WCSRTOMBS@
259
 
#  undef wcsrtombs
260
 
#  define wcsrtombs rpl_wcsrtombs
261
 
# endif
262
 
# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
263
 
extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
264
 
     _GL_ARG_NONNULL ((2));
265
 
# endif
 
365
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
366
#   undef wcsrtombs
 
367
#   define wcsrtombs rpl_wcsrtombs
 
368
#  endif
 
369
_GL_FUNCDECL_RPL (wcsrtombs, size_t,
 
370
                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
 
371
                  _GL_ARG_NONNULL ((2)));
 
372
_GL_CXXALIAS_RPL (wcsrtombs, size_t,
 
373
                  (char *dest, const wchar_t **srcp, size_t len,
 
374
                   mbstate_t *ps));
 
375
# else
 
376
#  if !@HAVE_WCSRTOMBS@
 
377
_GL_FUNCDECL_SYS (wcsrtombs, size_t,
 
378
                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
 
379
                  _GL_ARG_NONNULL ((2)));
 
380
#  endif
 
381
_GL_CXXALIAS_SYS (wcsrtombs, size_t,
 
382
                  (char *dest, const wchar_t **srcp, size_t len,
 
383
                   mbstate_t *ps));
 
384
# endif
 
385
_GL_CXXALIASWARN (wcsrtombs);
266
386
#elif defined GNULIB_POSIXCHECK
267
387
# undef wcsrtombs
268
 
# define wcsrtombs(d,s,l,p) \
269
 
    (GL_LINK_WARNING ("wcsrtombs is unportable - " \
270
 
                      "use gnulib module wcsrtombs for portability"), \
271
 
     wcsrtombs (d, s, l, p))
 
388
# if HAVE_RAW_DECL_WCSRTOMBS
 
389
_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
 
390
                 "use gnulib module wcsrtombs for portability");
 
391
# endif
272
392
#endif
273
393
 
274
394
 
275
395
/* Convert a wide string to a string.  */
276
396
#if @GNULIB_WCSNRTOMBS@
277
397
# if @REPLACE_WCSNRTOMBS@
278
 
#  undef wcsnrtombs
279
 
#  define wcsnrtombs rpl_wcsnrtombs
280
 
# endif
281
 
# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@
282
 
extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps)
283
 
     _GL_ARG_NONNULL ((2));
284
 
# endif
 
398
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
399
#   undef wcsnrtombs
 
400
#   define wcsnrtombs rpl_wcsnrtombs
 
401
#  endif
 
402
_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
 
403
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
 
404
                   mbstate_t *ps)
 
405
                  _GL_ARG_NONNULL ((2)));
 
406
_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
 
407
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
 
408
                   mbstate_t *ps));
 
409
# else
 
410
#  if !@HAVE_WCSNRTOMBS@
 
411
_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
 
412
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
 
413
                   mbstate_t *ps)
 
414
                  _GL_ARG_NONNULL ((2)));
 
415
#  endif
 
416
_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
 
417
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
 
418
                   mbstate_t *ps));
 
419
# endif
 
420
_GL_CXXALIASWARN (wcsnrtombs);
285
421
#elif defined GNULIB_POSIXCHECK
286
422
# undef wcsnrtombs
287
 
# define wcsnrtombs(d,s,n,l,p) \
288
 
    (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
289
 
                      "use gnulib module wcsnrtombs for portability"), \
290
 
     wcsnrtombs (d, s, n, l, p))
 
423
# if HAVE_RAW_DECL_WCSNRTOMBS
 
424
_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 
425
                 "use gnulib module wcsnrtombs for portability");
 
426
# endif
291
427
#endif
292
428
 
293
429
 
294
430
/* Return the number of screen columns needed for WC.  */
295
431
#if @GNULIB_WCWIDTH@
296
432
# if @REPLACE_WCWIDTH@
297
 
#  undef wcwidth
298
 
#  define wcwidth rpl_wcwidth
299
 
extern int wcwidth (wchar_t);
 
433
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
434
#   undef wcwidth
 
435
#   define wcwidth rpl_wcwidth
 
436
#  endif
 
437
_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 
438
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
300
439
# else
301
 
#  if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
 
440
#  if !@HAVE_DECL_WCWIDTH@
302
441
/* wcwidth exists but is not declared.  */
303
 
extern int wcwidth (int /* actually wchar_t */);
 
442
_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
304
443
#  endif
 
444
_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
305
445
# endif
 
446
_GL_CXXALIASWARN (wcwidth);
306
447
#elif defined GNULIB_POSIXCHECK
307
448
# undef wcwidth
308
 
# define wcwidth(w) \
309
 
    (GL_LINK_WARNING ("wcwidth is unportable - " \
310
 
                      "use gnulib module wcwidth for portability"), \
311
 
     wcwidth (w))
312
 
#endif
313
 
 
314
 
 
315
 
#ifdef __cplusplus
316
 
}
317
 
#endif
318
 
 
319
 
#endif /* _GL_WCHAR_H */
320
 
#endif /* _GL_WCHAR_H */
 
449
# if HAVE_RAW_DECL_WCWIDTH
 
450
_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
 
451
                 "use gnulib module wcwidth for portability");
 
452
# endif
 
453
#endif
 
454
 
 
455
 
 
456
/* Search N wide characters of S for C.  */
 
457
#if @GNULIB_WMEMCHR@
 
458
# if !@HAVE_WMEMCHR@
 
459
_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
 
460
                                      _GL_ATTRIBUTE_PURE);
 
461
# endif
 
462
  /* On some systems, this function is defined as an overloaded function:
 
463
       extern "C++" {
 
464
         const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
 
465
         wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
 
466
       }  */
 
467
_GL_CXXALIAS_SYS_CAST2 (wmemchr,
 
468
                        wchar_t *, (const wchar_t *, wchar_t, size_t),
 
469
                        const wchar_t *, (const wchar_t *, wchar_t, size_t));
 
470
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 
471
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 
472
_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 
473
_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
 
474
                   (const wchar_t *s, wchar_t c, size_t n));
 
475
# else
 
476
_GL_CXXALIASWARN (wmemchr);
 
477
# endif
 
478
#elif defined GNULIB_POSIXCHECK
 
479
# undef wmemchr
 
480
# if HAVE_RAW_DECL_WMEMCHR
 
481
_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
 
482
                 "use gnulib module wmemchr for portability");
 
483
# endif
 
484
#endif
 
485
 
 
486
 
 
487
/* Compare N wide characters of S1 and S2.  */
 
488
#if @GNULIB_WMEMCMP@
 
489
# if !@HAVE_WMEMCMP@
 
490
_GL_FUNCDECL_SYS (wmemcmp, int,
 
491
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
 
492
                  _GL_ATTRIBUTE_PURE);
 
493
# endif
 
494
_GL_CXXALIAS_SYS (wmemcmp, int,
 
495
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
 
496
_GL_CXXALIASWARN (wmemcmp);
 
497
#elif defined GNULIB_POSIXCHECK
 
498
# undef wmemcmp
 
499
# if HAVE_RAW_DECL_WMEMCMP
 
500
_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
 
501
                 "use gnulib module wmemcmp for portability");
 
502
# endif
 
503
#endif
 
504
 
 
505
 
 
506
/* Copy N wide characters of SRC to DEST.  */
 
507
#if @GNULIB_WMEMCPY@
 
508
# if !@HAVE_WMEMCPY@
 
509
_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
 
510
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
511
# endif
 
512
_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
 
513
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
514
_GL_CXXALIASWARN (wmemcpy);
 
515
#elif defined GNULIB_POSIXCHECK
 
516
# undef wmemcpy
 
517
# if HAVE_RAW_DECL_WMEMCPY
 
518
_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
 
519
                 "use gnulib module wmemcpy for portability");
 
520
# endif
 
521
#endif
 
522
 
 
523
 
 
524
/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
 
525
   overlapping memory areas.  */
 
526
#if @GNULIB_WMEMMOVE@
 
527
# if !@HAVE_WMEMMOVE@
 
528
_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
 
529
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
530
# endif
 
531
_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
 
532
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
533
_GL_CXXALIASWARN (wmemmove);
 
534
#elif defined GNULIB_POSIXCHECK
 
535
# undef wmemmove
 
536
# if HAVE_RAW_DECL_WMEMMOVE
 
537
_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
 
538
                 "use gnulib module wmemmove for portability");
 
539
# endif
 
540
#endif
 
541
 
 
542
 
 
543
/* Set N wide characters of S to C.  */
 
544
#if @GNULIB_WMEMSET@
 
545
# if !@HAVE_WMEMSET@
 
546
_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 
547
# endif
 
548
_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 
549
_GL_CXXALIASWARN (wmemset);
 
550
#elif defined GNULIB_POSIXCHECK
 
551
# undef wmemset
 
552
# if HAVE_RAW_DECL_WMEMSET
 
553
_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
 
554
                 "use gnulib module wmemset for portability");
 
555
# endif
 
556
#endif
 
557
 
 
558
 
 
559
/* Return the number of wide characters in S.  */
 
560
#if @GNULIB_WCSLEN@
 
561
# if !@HAVE_WCSLEN@
 
562
_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
 
563
# endif
 
564
_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
 
565
_GL_CXXALIASWARN (wcslen);
 
566
#elif defined GNULIB_POSIXCHECK
 
567
# undef wcslen
 
568
# if HAVE_RAW_DECL_WCSLEN
 
569
_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
 
570
                 "use gnulib module wcslen for portability");
 
571
# endif
 
572
#endif
 
573
 
 
574
 
 
575
/* Return the number of wide characters in S, but at most MAXLEN.  */
 
576
#if @GNULIB_WCSNLEN@
 
577
# if !@HAVE_WCSNLEN@
 
578
_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
 
579
                                   _GL_ATTRIBUTE_PURE);
 
580
# endif
 
581
_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
 
582
_GL_CXXALIASWARN (wcsnlen);
 
583
#elif defined GNULIB_POSIXCHECK
 
584
# undef wcsnlen
 
585
# if HAVE_RAW_DECL_WCSNLEN
 
586
_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
 
587
                 "use gnulib module wcsnlen for portability");
 
588
# endif
 
589
#endif
 
590
 
 
591
 
 
592
/* Copy SRC to DEST.  */
 
593
#if @GNULIB_WCSCPY@
 
594
# if !@HAVE_WCSCPY@
 
595
_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
596
# endif
 
597
_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
598
_GL_CXXALIASWARN (wcscpy);
 
599
#elif defined GNULIB_POSIXCHECK
 
600
# undef wcscpy
 
601
# if HAVE_RAW_DECL_WCSCPY
 
602
_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
 
603
                 "use gnulib module wcscpy for portability");
 
604
# endif
 
605
#endif
 
606
 
 
607
 
 
608
/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
 
609
#if @GNULIB_WCPCPY@
 
610
# if !@HAVE_WCPCPY@
 
611
_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
612
# endif
 
613
_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
614
_GL_CXXALIASWARN (wcpcpy);
 
615
#elif defined GNULIB_POSIXCHECK
 
616
# undef wcpcpy
 
617
# if HAVE_RAW_DECL_WCPCPY
 
618
_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
 
619
                 "use gnulib module wcpcpy for portability");
 
620
# endif
 
621
#endif
 
622
 
 
623
 
 
624
/* Copy no more than N wide characters of SRC to DEST.  */
 
625
#if @GNULIB_WCSNCPY@
 
626
# if !@HAVE_WCSNCPY@
 
627
_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
 
628
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
629
# endif
 
630
_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
 
631
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
632
_GL_CXXALIASWARN (wcsncpy);
 
633
#elif defined GNULIB_POSIXCHECK
 
634
# undef wcsncpy
 
635
# if HAVE_RAW_DECL_WCSNCPY
 
636
_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
 
637
                 "use gnulib module wcsncpy for portability");
 
638
# endif
 
639
#endif
 
640
 
 
641
 
 
642
/* Copy no more than N characters of SRC to DEST, returning the address of
 
643
   the last character written into DEST.  */
 
644
#if @GNULIB_WCPNCPY@
 
645
# if !@HAVE_WCPNCPY@
 
646
_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
 
647
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
648
# endif
 
649
_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
 
650
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
651
_GL_CXXALIASWARN (wcpncpy);
 
652
#elif defined GNULIB_POSIXCHECK
 
653
# undef wcpncpy
 
654
# if HAVE_RAW_DECL_WCPNCPY
 
655
_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
 
656
                 "use gnulib module wcpncpy for portability");
 
657
# endif
 
658
#endif
 
659
 
 
660
 
 
661
/* Append SRC onto DEST.  */
 
662
#if @GNULIB_WCSCAT@
 
663
# if !@HAVE_WCSCAT@
 
664
_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
665
# endif
 
666
_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
 
667
_GL_CXXALIASWARN (wcscat);
 
668
#elif defined GNULIB_POSIXCHECK
 
669
# undef wcscat
 
670
# if HAVE_RAW_DECL_WCSCAT
 
671
_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
 
672
                 "use gnulib module wcscat for portability");
 
673
# endif
 
674
#endif
 
675
 
 
676
 
 
677
/* Append no more than N wide characters of SRC onto DEST.  */
 
678
#if @GNULIB_WCSNCAT@
 
679
# if !@HAVE_WCSNCAT@
 
680
_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
 
681
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
682
# endif
 
683
_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
 
684
                  (wchar_t *dest, const wchar_t *src, size_t n));
 
685
_GL_CXXALIASWARN (wcsncat);
 
686
#elif defined GNULIB_POSIXCHECK
 
687
# undef wcsncat
 
688
# if HAVE_RAW_DECL_WCSNCAT
 
689
_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
 
690
                 "use gnulib module wcsncat for portability");
 
691
# endif
 
692
#endif
 
693
 
 
694
 
 
695
/* Compare S1 and S2.  */
 
696
#if @GNULIB_WCSCMP@
 
697
# if !@HAVE_WCSCMP@
 
698
_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
 
699
                               _GL_ATTRIBUTE_PURE);
 
700
# endif
 
701
_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
 
702
_GL_CXXALIASWARN (wcscmp);
 
703
#elif defined GNULIB_POSIXCHECK
 
704
# undef wcscmp
 
705
# if HAVE_RAW_DECL_WCSCMP
 
706
_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
 
707
                 "use gnulib module wcscmp for portability");
 
708
# endif
 
709
#endif
 
710
 
 
711
 
 
712
/* Compare no more than N wide characters of S1 and S2.  */
 
713
#if @GNULIB_WCSNCMP@
 
714
# if !@HAVE_WCSNCMP@
 
715
_GL_FUNCDECL_SYS (wcsncmp, int,
 
716
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
 
717
                  _GL_ATTRIBUTE_PURE);
 
718
# endif
 
719
_GL_CXXALIAS_SYS (wcsncmp, int,
 
720
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
 
721
_GL_CXXALIASWARN (wcsncmp);
 
722
#elif defined GNULIB_POSIXCHECK
 
723
# undef wcsncmp
 
724
# if HAVE_RAW_DECL_WCSNCMP
 
725
_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
 
726
                 "use gnulib module wcsncmp for portability");
 
727
# endif
 
728
#endif
 
729
 
 
730
 
 
731
/* Compare S1 and S2, ignoring case.  */
 
732
#if @GNULIB_WCSCASECMP@
 
733
# if !@HAVE_WCSCASECMP@
 
734
_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
 
735
                                   _GL_ATTRIBUTE_PURE);
 
736
# endif
 
737
_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
 
738
_GL_CXXALIASWARN (wcscasecmp);
 
739
#elif defined GNULIB_POSIXCHECK
 
740
# undef wcscasecmp
 
741
# if HAVE_RAW_DECL_WCSCASECMP
 
742
_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
 
743
                 "use gnulib module wcscasecmp for portability");
 
744
# endif
 
745
#endif
 
746
 
 
747
 
 
748
/* Compare no more than N chars of S1 and S2, ignoring case.  */
 
749
#if @GNULIB_WCSNCASECMP@
 
750
# if !@HAVE_WCSNCASECMP@
 
751
_GL_FUNCDECL_SYS (wcsncasecmp, int,
 
752
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
 
753
                  _GL_ATTRIBUTE_PURE);
 
754
# endif
 
755
_GL_CXXALIAS_SYS (wcsncasecmp, int,
 
756
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
 
757
_GL_CXXALIASWARN (wcsncasecmp);
 
758
#elif defined GNULIB_POSIXCHECK
 
759
# undef wcsncasecmp
 
760
# if HAVE_RAW_DECL_WCSNCASECMP
 
761
_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
 
762
                 "use gnulib module wcsncasecmp for portability");
 
763
# endif
 
764
#endif
 
765
 
 
766
 
 
767
/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
 
768
   category of the current locale.  */
 
769
#if @GNULIB_WCSCOLL@
 
770
# if !@HAVE_WCSCOLL@
 
771
_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
 
772
# endif
 
773
_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
 
774
_GL_CXXALIASWARN (wcscoll);
 
775
#elif defined GNULIB_POSIXCHECK
 
776
# undef wcscoll
 
777
# if HAVE_RAW_DECL_WCSCOLL
 
778
_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
 
779
                 "use gnulib module wcscoll for portability");
 
780
# endif
 
781
#endif
 
782
 
 
783
 
 
784
/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
 
785
   to two transformed strings the result is the as applying 'wcscoll' to the
 
786
   original strings.  */
 
787
#if @GNULIB_WCSXFRM@
 
788
# if !@HAVE_WCSXFRM@
 
789
_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
 
790
# endif
 
791
_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
 
792
_GL_CXXALIASWARN (wcsxfrm);
 
793
#elif defined GNULIB_POSIXCHECK
 
794
# undef wcsxfrm
 
795
# if HAVE_RAW_DECL_WCSXFRM
 
796
_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
 
797
                 "use gnulib module wcsxfrm for portability");
 
798
# endif
 
799
#endif
 
800
 
 
801
 
 
802
/* Duplicate S, returning an identical malloc'd string.  */
 
803
#if @GNULIB_WCSDUP@
 
804
# if !@HAVE_WCSDUP@
 
805
_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
 
806
# endif
 
807
_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
 
808
_GL_CXXALIASWARN (wcsdup);
 
809
#elif defined GNULIB_POSIXCHECK
 
810
# undef wcsdup
 
811
# if HAVE_RAW_DECL_WCSDUP
 
812
_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
 
813
                 "use gnulib module wcsdup for portability");
 
814
# endif
 
815
#endif
 
816
 
 
817
 
 
818
/* Find the first occurrence of WC in WCS.  */
 
819
#if @GNULIB_WCSCHR@
 
820
# if !@HAVE_WCSCHR@
 
821
_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
 
822
                                     _GL_ATTRIBUTE_PURE);
 
823
# endif
 
824
  /* On some systems, this function is defined as an overloaded function:
 
825
       extern "C++" {
 
826
         const wchar_t * std::wcschr (const wchar_t *, wchar_t);
 
827
         wchar_t * std::wcschr (wchar_t *, wchar_t);
 
828
       }  */
 
829
_GL_CXXALIAS_SYS_CAST2 (wcschr,
 
830
                        wchar_t *, (const wchar_t *, wchar_t),
 
831
                        const wchar_t *, (const wchar_t *, wchar_t));
 
832
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 
833
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 
834
_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
 
835
_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
 
836
# else
 
837
_GL_CXXALIASWARN (wcschr);
 
838
# endif
 
839
#elif defined GNULIB_POSIXCHECK
 
840
# undef wcschr
 
841
# if HAVE_RAW_DECL_WCSCHR
 
842
_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
 
843
                 "use gnulib module wcschr for portability");
 
844
# endif
 
845
#endif
 
846
 
 
847
 
 
848
/* Find the last occurrence of WC in WCS.  */
 
849
#if @GNULIB_WCSRCHR@
 
850
# if !@HAVE_WCSRCHR@
 
851
_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
 
852
                                      _GL_ATTRIBUTE_PURE);
 
853
# endif
 
854
  /* On some systems, this function is defined as an overloaded function:
 
855
       extern "C++" {
 
856
         const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
 
857
         wchar_t * std::wcsrchr (wchar_t *, wchar_t);
 
858
       }  */
 
859
_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
 
860
                        wchar_t *, (const wchar_t *, wchar_t),
 
861
                        const wchar_t *, (const wchar_t *, wchar_t));
 
862
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 
863
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 
864
_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
 
865
_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
 
866
# else
 
867
_GL_CXXALIASWARN (wcsrchr);
 
868
# endif
 
869
#elif defined GNULIB_POSIXCHECK
 
870
# undef wcsrchr
 
871
# if HAVE_RAW_DECL_WCSRCHR
 
872
_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
 
873
                 "use gnulib module wcsrchr for portability");
 
874
# endif
 
875
#endif
 
876
 
 
877
 
 
878
/* Return the length of the initial segmet of WCS which consists entirely
 
879
   of wide characters not in REJECT.  */
 
880
#if @GNULIB_WCSCSPN@
 
881
# if !@HAVE_WCSCSPN@
 
882
_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
 
883
                                   _GL_ATTRIBUTE_PURE);
 
884
# endif
 
885
_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
 
886
_GL_CXXALIASWARN (wcscspn);
 
887
#elif defined GNULIB_POSIXCHECK
 
888
# undef wcscspn
 
889
# if HAVE_RAW_DECL_WCSCSPN
 
890
_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
 
891
                 "use gnulib module wcscspn for portability");
 
892
# endif
 
893
#endif
 
894
 
 
895
 
 
896
/* Return the length of the initial segmet of WCS which consists entirely
 
897
   of wide characters in ACCEPT.  */
 
898
#if @GNULIB_WCSSPN@
 
899
# if !@HAVE_WCSSPN@
 
900
_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
 
901
                                  _GL_ATTRIBUTE_PURE);
 
902
# endif
 
903
_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
 
904
_GL_CXXALIASWARN (wcsspn);
 
905
#elif defined GNULIB_POSIXCHECK
 
906
# undef wcsspn
 
907
# if HAVE_RAW_DECL_WCSSPN
 
908
_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
 
909
                 "use gnulib module wcsspn for portability");
 
910
# endif
 
911
#endif
 
912
 
 
913
 
 
914
/* Find the first occurrence in WCS of any character in ACCEPT.  */
 
915
#if @GNULIB_WCSPBRK@
 
916
# if !@HAVE_WCSPBRK@
 
917
_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
 
918
                  (const wchar_t *wcs, const wchar_t *accept)
 
919
                  _GL_ATTRIBUTE_PURE);
 
920
# endif
 
921
  /* On some systems, this function is defined as an overloaded function:
 
922
       extern "C++" {
 
923
         const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
 
924
         wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
 
925
       }  */
 
926
_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
 
927
                        wchar_t *, (const wchar_t *, const wchar_t *),
 
928
                        const wchar_t *, (const wchar_t *, const wchar_t *));
 
929
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 
930
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 
931
_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
 
932
                   (wchar_t *wcs, const wchar_t *accept));
 
933
_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
 
934
                   (const wchar_t *wcs, const wchar_t *accept));
 
935
# else
 
936
_GL_CXXALIASWARN (wcspbrk);
 
937
# endif
 
938
#elif defined GNULIB_POSIXCHECK
 
939
# undef wcspbrk
 
940
# if HAVE_RAW_DECL_WCSPBRK
 
941
_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
 
942
                 "use gnulib module wcspbrk for portability");
 
943
# endif
 
944
#endif
 
945
 
 
946
 
 
947
/* Find the first occurrence of NEEDLE in HAYSTACK.  */
 
948
#if @GNULIB_WCSSTR@
 
949
# if !@HAVE_WCSSTR@
 
950
_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
 
951
                  (const wchar_t *haystack, const wchar_t *needle)
 
952
                  _GL_ATTRIBUTE_PURE);
 
953
# endif
 
954
  /* On some systems, this function is defined as an overloaded function:
 
955
       extern "C++" {
 
956
         const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
 
957
         wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
 
958
       }  */
 
959
_GL_CXXALIAS_SYS_CAST2 (wcsstr,
 
960
                        wchar_t *, (const wchar_t *, const wchar_t *),
 
961
                        const wchar_t *, (const wchar_t *, const wchar_t *));
 
962
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 
963
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 
964
_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
 
965
                   (wchar_t *haystack, const wchar_t *needle));
 
966
_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
 
967
                   (const wchar_t *haystack, const wchar_t *needle));
 
968
# else
 
969
_GL_CXXALIASWARN (wcsstr);
 
970
# endif
 
971
#elif defined GNULIB_POSIXCHECK
 
972
# undef wcsstr
 
973
# if HAVE_RAW_DECL_WCSSTR
 
974
_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
 
975
                 "use gnulib module wcsstr for portability");
 
976
# endif
 
977
#endif
 
978
 
 
979
 
 
980
/* Divide WCS into tokens separated by characters in DELIM.  */
 
981
#if @GNULIB_WCSTOK@
 
982
# if !@HAVE_WCSTOK@
 
983
_GL_FUNCDECL_SYS (wcstok, wchar_t *,
 
984
                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
 
985
# endif
 
986
_GL_CXXALIAS_SYS (wcstok, wchar_t *,
 
987
                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
 
988
_GL_CXXALIASWARN (wcstok);
 
989
#elif defined GNULIB_POSIXCHECK
 
990
# undef wcstok
 
991
# if HAVE_RAW_DECL_WCSTOK
 
992
_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
 
993
                 "use gnulib module wcstok for portability");
 
994
# endif
 
995
#endif
 
996
 
 
997
 
 
998
/* Determine number of column positions required for first N wide
 
999
   characters (or fewer if S ends before this) in S.  */
 
1000
#if @GNULIB_WCSWIDTH@
 
1001
# if @REPLACE_WCSWIDTH@
 
1002
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1003
#   undef wcswidth
 
1004
#   define wcswidth rpl_wcswidth
 
1005
#  endif
 
1006
_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
 
1007
                                 _GL_ATTRIBUTE_PURE);
 
1008
_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
 
1009
# else
 
1010
#  if !@HAVE_WCSWIDTH@
 
1011
_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
 
1012
                                 _GL_ATTRIBUTE_PURE);
 
1013
#  endif
 
1014
_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
 
1015
# endif
 
1016
_GL_CXXALIASWARN (wcswidth);
 
1017
#elif defined GNULIB_POSIXCHECK
 
1018
# undef wcswidth
 
1019
# if HAVE_RAW_DECL_WCSWIDTH
 
1020
_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
 
1021
                 "use gnulib module wcswidth for portability");
 
1022
# endif
 
1023
#endif
 
1024
 
 
1025
 
 
1026
#endif /* _@GUARD_PREFIX@_WCHAR_H */
 
1027
#endif /* _@GUARD_PREFIX@_WCHAR_H */
321
1028
#endif