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