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.
5 Copyright (C) 2007-2011 Free Software Foundation, Inc.
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)
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.
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. */
21 /* Written by Eric Blake. */
24 * ISO C 99 <wchar.h> for platforms that have issues.
25 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
27 * For now, this just ensures proper prerequisite inclusion order and
28 * the declaration of wcwidth().
32 @PRAGMA_SYSTEM_HEADER@
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. */
49 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
52 /* Normal invocation convention. */
54 #ifndef _@GUARD_PREFIX@_WCHAR_H
56 #define _GL_ALREADY_INCLUDING_WCHAR_H
59 # include <features.h> /* for __GLIBC__ */
62 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
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
68 But avoid namespace pollution on glibc systems. */
69 #if !(defined __GLIBC__ && !defined __UCLIBC__)
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. */
81 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
84 #undef _GL_ALREADY_INCLUDING_WCHAR_H
86 #ifndef _@GUARD_PREFIX@_WCHAR_H
87 #define _@GUARD_PREFIX@_WCHAR_H
89 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
91 /* The definition of _GL_ARG_NONNULL is copied here. */
93 /* The definition of _GL_WARN_ON_USE is copied here. */
96 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
97 #if !@HAVE_WINT_T@ && !defined wint_t
104 # define WEOF ((wint_t) -1)
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;
116 # define mbstate_t rpl_mbstate_t
117 # define GNULIB_defined_mbstate_t 1
122 /* Convert a single-byte character to a wide character. */
125 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
127 # define btowc rpl_btowc
129 _GL_FUNCDECL_RPL (btowc, wint_t, (int c));
130 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
133 _GL_FUNCDECL_SYS (btowc, wint_t, (int c));
135 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
137 _GL_CXXALIASWARN (btowc);
138 #elif defined GNULIB_POSIXCHECK
140 # if HAVE_RAW_DECL_BTOWC
141 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
142 "use gnulib module btowc for portability");
147 /* Convert a wide character to a single-byte character. */
150 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
152 # define wctob rpl_wctob
154 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
155 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
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));
161 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
163 _GL_CXXALIASWARN (wctob);
164 #elif defined GNULIB_POSIXCHECK
166 # if HAVE_RAW_DECL_WCTOB
167 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
168 "use gnulib module wctob for portability");
173 /* Test whether *PS is in the initial state. */
175 # if @REPLACE_MBSINIT@
176 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
178 # define mbsinit rpl_mbsinit
180 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
181 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
184 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
186 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
188 _GL_CXXALIASWARN (mbsinit);
189 #elif defined GNULIB_POSIXCHECK
191 # if HAVE_RAW_DECL_MBSINIT
192 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
193 "use gnulib module mbsinit for portability");
198 /* Convert a multibyte character to a wide character. */
200 # if @REPLACE_MBRTOWC@
201 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
203 # define mbrtowc rpl_mbrtowc
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));
211 _GL_FUNCDECL_SYS (mbrtowc, size_t,
212 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
214 _GL_CXXALIAS_SYS (mbrtowc, size_t,
215 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
217 _GL_CXXALIASWARN (mbrtowc);
218 #elif defined GNULIB_POSIXCHECK
220 # if HAVE_RAW_DECL_MBRTOWC
221 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
222 "use gnulib module mbrtowc for portability");
227 /* Recognize a multibyte character. */
229 # if @REPLACE_MBRLEN@
230 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
232 # define mbrlen rpl_mbrlen
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));
238 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
240 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
242 _GL_CXXALIASWARN (mbrlen);
243 #elif defined GNULIB_POSIXCHECK
245 # if HAVE_RAW_DECL_MBRLEN
246 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
247 "use gnulib module mbrlen for portability");
252 /* Convert a string to a wide string. */
253 #if @GNULIB_MBSRTOWCS@
254 # if @REPLACE_MBSRTOWCS@
255 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
257 # define mbsrtowcs rpl_mbsrtowcs
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,
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)));
271 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
272 (wchar_t *dest, const char **srcp, size_t len,
275 _GL_CXXALIASWARN (mbsrtowcs);
276 #elif defined GNULIB_POSIXCHECK
278 # if HAVE_RAW_DECL_MBSRTOWCS
279 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
280 "use gnulib module mbsrtowcs for portability");
285 /* Convert a string to a wide string. */
286 #if @GNULIB_MBSNRTOWCS@
287 # if @REPLACE_MBSNRTOWCS@
288 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
290 # define mbsnrtowcs rpl_mbsnrtowcs
292 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
293 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
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,
300 # if !@HAVE_MBSNRTOWCS@
301 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
302 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
304 _GL_ARG_NONNULL ((2)));
306 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
307 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
310 _GL_CXXALIASWARN (mbsnrtowcs);
311 #elif defined GNULIB_POSIXCHECK
313 # if HAVE_RAW_DECL_MBSNRTOWCS
314 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
315 "use gnulib module mbsnrtowcs for portability");
320 /* Convert a wide character to a multibyte character. */
322 # if @REPLACE_WCRTOMB@
323 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
325 # define wcrtomb rpl_wcrtomb
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));
331 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
333 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
335 _GL_CXXALIASWARN (wcrtomb);
336 #elif defined GNULIB_POSIXCHECK
338 # if HAVE_RAW_DECL_WCRTOMB
339 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
340 "use gnulib module wcrtomb for portability");
345 /* Convert a wide string to a string. */
346 #if @GNULIB_WCSRTOMBS@
347 # if @REPLACE_WCSRTOMBS@
348 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
350 # define wcsrtombs rpl_wcsrtombs
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,
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)));
364 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
365 (char *dest, const wchar_t **srcp, size_t len,
368 _GL_CXXALIASWARN (wcsrtombs);
369 #elif defined GNULIB_POSIXCHECK
371 # if HAVE_RAW_DECL_WCSRTOMBS
372 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
373 "use gnulib module wcsrtombs for portability");
378 /* Convert a wide string to a string. */
379 #if @GNULIB_WCSNRTOMBS@
380 # if @REPLACE_WCSNRTOMBS@
381 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
383 # define wcsnrtombs rpl_wcsnrtombs
385 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
386 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
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,
393 # if !@HAVE_WCSNRTOMBS@
394 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
395 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
397 _GL_ARG_NONNULL ((2)));
399 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
400 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
403 _GL_CXXALIASWARN (wcsnrtombs);
404 #elif defined GNULIB_POSIXCHECK
406 # if HAVE_RAW_DECL_WCSNRTOMBS
407 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
408 "use gnulib module wcsnrtombs for portability");
413 /* Return the number of screen columns needed for WC. */
415 # if @REPLACE_WCWIDTH@
416 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
418 # define wcwidth rpl_wcwidth
420 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
421 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
423 # if !@HAVE_DECL_WCWIDTH@
424 /* wcwidth exists but is not declared. */
425 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
427 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
429 _GL_CXXALIASWARN (wcwidth);
430 #elif defined GNULIB_POSIXCHECK
432 # if HAVE_RAW_DECL_WCWIDTH
433 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
434 "use gnulib module wcwidth for portability");
439 /* Search N wide characters of S for C. */
442 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
444 /* On some systems, this function is defined as an overloaded function:
446 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
447 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
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));
458 _GL_CXXALIASWARN (wmemchr);
460 #elif defined GNULIB_POSIXCHECK
462 # if HAVE_RAW_DECL_WMEMCHR
463 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
464 "use gnulib module wmemchr for portability");
469 /* Compare N wide characters of S1 and S2. */
472 _GL_FUNCDECL_SYS (wmemcmp, int,
473 (const wchar_t *s1, const wchar_t *s2, size_t n));
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
480 # if HAVE_RAW_DECL_WMEMCMP
481 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
482 "use gnulib module wmemcmp for portability");
487 /* Copy N wide characters of SRC to DEST. */
490 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
491 (wchar_t *dest, const wchar_t *src, size_t n));
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
498 # if HAVE_RAW_DECL_WMEMCPY
499 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
500 "use gnulib module wmemcpy for portability");
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));
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
517 # if HAVE_RAW_DECL_WMEMMOVE
518 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
519 "use gnulib module wmemmove for portability");
524 /* Set N wide characters of S to C. */
527 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
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
533 # if HAVE_RAW_DECL_WMEMSET
534 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
535 "use gnulib module wmemset for portability");
540 /* Return the number of wide characters in S. */
543 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
545 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
546 _GL_CXXALIASWARN (wcslen);
547 #elif defined GNULIB_POSIXCHECK
549 # if HAVE_RAW_DECL_WCSLEN
550 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
551 "use gnulib module wcslen for portability");
556 /* Return the number of wide characters in S, but at most MAXLEN. */
559 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
561 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
562 _GL_CXXALIASWARN (wcsnlen);
563 #elif defined GNULIB_POSIXCHECK
565 # if HAVE_RAW_DECL_WCSNLEN
566 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
567 "use gnulib module wcsnlen for portability");
572 /* Copy SRC to DEST. */
575 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
577 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
578 _GL_CXXALIASWARN (wcscpy);
579 #elif defined GNULIB_POSIXCHECK
581 # if HAVE_RAW_DECL_WCSCPY
582 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
583 "use gnulib module wcscpy for portability");
588 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
591 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
593 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
594 _GL_CXXALIASWARN (wcpcpy);
595 #elif defined GNULIB_POSIXCHECK
597 # if HAVE_RAW_DECL_WCPCPY
598 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
599 "use gnulib module wcpcpy for portability");
604 /* Copy no more than N wide characters of SRC to DEST. */
607 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
608 (wchar_t *dest, const wchar_t *src, size_t n));
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
615 # if HAVE_RAW_DECL_WCSNCPY
616 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
617 "use gnulib module wcsncpy for portability");
622 /* Copy no more than N characters of SRC to DEST, returning the address of
623 the last character written into DEST. */
626 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
627 (wchar_t *dest, const wchar_t *src, size_t n));
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
634 # if HAVE_RAW_DECL_WCPNCPY
635 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
636 "use gnulib module wcpncpy for portability");
641 /* Append SRC onto DEST. */
644 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
646 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
647 _GL_CXXALIASWARN (wcscat);
648 #elif defined GNULIB_POSIXCHECK
650 # if HAVE_RAW_DECL_WCSCAT
651 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
652 "use gnulib module wcscat for portability");
657 /* Append no more than N wide characters of SRC onto DEST. */
660 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
661 (wchar_t *dest, const wchar_t *src, size_t n));
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
668 # if HAVE_RAW_DECL_WCSNCAT
669 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
670 "use gnulib module wcsncat for portability");
675 /* Compare S1 and S2. */
678 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
680 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
681 _GL_CXXALIASWARN (wcscmp);
682 #elif defined GNULIB_POSIXCHECK
684 # if HAVE_RAW_DECL_WCSCMP
685 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
686 "use gnulib module wcscmp for portability");
691 /* Compare no more than N wide characters of S1 and S2. */
694 _GL_FUNCDECL_SYS (wcsncmp, int,
695 (const wchar_t *s1, const wchar_t *s2, size_t n));
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
702 # if HAVE_RAW_DECL_WCSNCMP
703 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
704 "use gnulib module wcsncmp for portability");
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));
714 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
715 _GL_CXXALIASWARN (wcscasecmp);
716 #elif defined GNULIB_POSIXCHECK
718 # if HAVE_RAW_DECL_WCSCASECMP
719 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
720 "use gnulib module wcscasecmp for portability");
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));
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
736 # if HAVE_RAW_DECL_WCSNCASECMP
737 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
738 "use gnulib module wcsncasecmp for portability");
743 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
744 category of the current locale. */
747 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
749 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
750 _GL_CXXALIASWARN (wcscoll);
751 #elif defined GNULIB_POSIXCHECK
753 # if HAVE_RAW_DECL_WCSCOLL
754 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
755 "use gnulib module wcscoll for portability");
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
765 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
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
771 # if HAVE_RAW_DECL_WCSXFRM
772 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
773 "use gnulib module wcsxfrm for portability");
778 /* Duplicate S, returning an identical malloc'd string. */
781 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
783 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
784 _GL_CXXALIASWARN (wcsdup);
785 #elif defined GNULIB_POSIXCHECK
787 # if HAVE_RAW_DECL_WCSDUP
788 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
789 "use gnulib module wcsdup for portability");
794 /* Find the first occurrence of WC in WCS. */
797 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
799 /* On some systems, this function is defined as an overloaded function:
801 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
802 wchar_t * std::wcschr (wchar_t *, wchar_t);
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));
812 _GL_CXXALIASWARN (wcschr);
814 #elif defined GNULIB_POSIXCHECK
816 # if HAVE_RAW_DECL_WCSCHR
817 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
818 "use gnulib module wcschr for portability");
823 /* Find the last occurrence of WC in WCS. */
826 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
828 /* On some systems, this function is defined as an overloaded function:
830 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
831 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
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));
841 _GL_CXXALIASWARN (wcsrchr);
843 #elif defined GNULIB_POSIXCHECK
845 # if HAVE_RAW_DECL_WCSRCHR
846 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
847 "use gnulib module wcsrchr for portability");
852 /* Return the length of the initial segmet of WCS which consists entirely
853 of wide characters not in REJECT. */
856 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
858 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
859 _GL_CXXALIASWARN (wcscspn);
860 #elif defined GNULIB_POSIXCHECK
862 # if HAVE_RAW_DECL_WCSCSPN
863 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
864 "use gnulib module wcscspn for portability");
869 /* Return the length of the initial segmet of WCS which consists entirely
870 of wide characters in ACCEPT. */
873 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
875 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
876 _GL_CXXALIASWARN (wcsspn);
877 #elif defined GNULIB_POSIXCHECK
879 # if HAVE_RAW_DECL_WCSSPN
880 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
881 "use gnulib module wcsspn for portability");
886 /* Find the first occurrence in WCS of any character in ACCEPT. */
889 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
890 (const wchar_t *wcs, const wchar_t *accept));
892 /* On some systems, this function is defined as an overloaded function:
894 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
895 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
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));
907 _GL_CXXALIASWARN (wcspbrk);
909 #elif defined GNULIB_POSIXCHECK
911 # if HAVE_RAW_DECL_WCSPBRK
912 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
913 "use gnulib module wcspbrk for portability");
918 /* Find the first occurrence of NEEDLE in HAYSTACK. */
921 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
922 (const wchar_t *haystack, const wchar_t *needle));
924 /* On some systems, this function is defined as an overloaded function:
926 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
927 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
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));
939 _GL_CXXALIASWARN (wcsstr);
941 #elif defined GNULIB_POSIXCHECK
943 # if HAVE_RAW_DECL_WCSSTR
944 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
945 "use gnulib module wcsstr for portability");
950 /* Divide WCS into tokens separated by characters in DELIM. */
953 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
954 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
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
961 # if HAVE_RAW_DECL_WCSTOK
962 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
963 "use gnulib module wcstok for portability");
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)
974 # define wcswidth rpl_wcswidth
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));
979 # if !@HAVE_WCSWIDTH@
980 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
982 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
984 _GL_CXXALIASWARN (wcswidth);
985 #elif defined GNULIB_POSIXCHECK
987 # if HAVE_RAW_DECL_WCSWIDTH
988 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
989 "use gnulib module wcswidth for portability");
994 #endif /* _@GUARD_PREFIX@_WCHAR_H */
995 #endif /* _@GUARD_PREFIX@_WCHAR_H */