1 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
3 Copyright (C) 2007-2022 Free Software Foundation, Inc.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 /* Written by Eric Blake. */
21 * ISO C 99 <wchar.h> for platforms that have issues.
22 * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html>
24 * For now, this just ensures proper prerequisite inclusion order and
25 * the declaration of wcwidth().
29 @PRAGMA_SYSTEM_HEADER@
33 #if (((defined __need_mbstate_t || defined __need_wint_t) \
34 && !defined __MINGW32__) \
36 && ((defined _INTTYPES_INCLUDED \
37 && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
38 || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
39 || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
40 || defined _GL_ALREADY_INCLUDING_WCHAR_H)
41 /* Special invocation convention:
42 - Inside glibc and uClibc header files, but not MinGW.
43 - On HP-UX 11.00 we have a sequence of nested includes
44 <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
45 once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
46 and once directly. In both situations 'wint_t' is not yet defined,
47 therefore we cannot provide the function overrides; instead include only
48 the system's <wchar.h>.
49 - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
50 <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
51 - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
52 the latter includes <wchar.h>. But here, we have no way to detect whether
53 <wctype.h> is completely included or is still being included. */
55 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
58 /* Normal invocation convention. */
60 #ifndef _@GUARD_PREFIX@_WCHAR_H
62 #define _GL_ALREADY_INCLUDING_WCHAR_H
65 # include <features.h> /* for __GLIBC__ */
68 /* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
70 But avoid namespace pollution on glibc systems. */
71 #if !(defined __GLIBC__ && !defined __UCLIBC__)
75 /* Include the original <wchar.h> if it exists.
76 Some builds of uClibc lack it. */
77 /* The include_next requires a split double-inclusion guard. */
79 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
82 #undef _GL_ALREADY_INCLUDING_WCHAR_H
84 #ifndef _@GUARD_PREFIX@_WCHAR_H
85 #define _@GUARD_PREFIX@_WCHAR_H
87 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
88 that can be freed by passing them as the Ith argument to the
90 #ifndef _GL_ATTRIBUTE_DEALLOC
92 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
94 # define _GL_ATTRIBUTE_DEALLOC(f, i)
98 /* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
99 can be freed via 'free'; it can be used only after declaring 'free'. */
100 /* Applies to: functions. Cannot be used on inline functions. */
101 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
102 # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
105 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
107 /* Applies to: functions. */
108 #ifndef _GL_ATTRIBUTE_MALLOC
109 # if __GNUC__ >= 3 || defined __clang__
110 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
112 # define _GL_ATTRIBUTE_MALLOC
116 /* The __attribute__ feature is available in gcc versions 2.5 and later.
117 The attribute __pure__ was added in gcc 2.96. */
118 #ifndef _GL_ATTRIBUTE_PURE
119 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
120 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
122 # define _GL_ATTRIBUTE_PURE /* empty */
126 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
128 /* The definition of _GL_ARG_NONNULL is copied here. */
130 /* The definition of _GL_WARN_ON_USE is copied here. */
133 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
134 #if !@HAVE_WINT_T@ && !defined wint_t
140 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
141 <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
142 wint_t must be "unchanged by default argument promotions". Override it. */
143 # if @GNULIBHEADERS_OVERRIDE_WINT_T@
144 # if !GNULIB_defined_wint_t
145 # if @HAVE_CRTDEFS_H@
146 # include <crtdefs.h>
150 typedef unsigned int rpl_wint_t;
152 # define wint_t rpl_wint_t
153 # define GNULIB_defined_wint_t 1
157 # define WEOF ((wint_t) -1)
162 /* Override mbstate_t if it is too small.
163 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
164 implementing mbrtowc for encodings like UTF-8.
165 On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
166 large enough and overriding it would cause problems in C++ mode. */
167 #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
168 # if !GNULIB_defined_mbstate_t
169 # if !(defined _AIX || defined _MSC_VER)
170 typedef int rpl_mbstate_t;
172 # define mbstate_t rpl_mbstate_t
174 # define GNULIB_defined_mbstate_t 1
178 /* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
179 been included yet. */
180 #if @GNULIB_FREE_POSIX@
181 # if (@REPLACE_FREE@ && !defined free \
182 && !(defined __cplusplus && defined GNULIB_NAMESPACE))
183 /* We can't do '#define free rpl_free' here. */
184 _GL_EXTERN_C void rpl_free (void *);
185 # undef _GL_ATTRIBUTE_DEALLOC_FREE
186 # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
188 # if defined _MSC_VER
189 _GL_EXTERN_C void __cdecl free (void *);
191 _GL_EXTERN_C void free (void *);
195 # if defined _MSC_VER
196 _GL_EXTERN_C void __cdecl free (void *);
198 _GL_EXTERN_C void free (void *);
202 /* Convert a single-byte character to a wide character. */
205 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
207 # define btowc rpl_btowc
209 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
210 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
213 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
215 /* Need to cast, because on mingw, the return type is 'unsigned short'. */
216 _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
219 _GL_CXXALIASWARN (btowc);
221 #elif defined GNULIB_POSIXCHECK
223 # if HAVE_RAW_DECL_BTOWC
224 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
225 "use gnulib module btowc for portability");
230 /* Convert a wide character to a single-byte character. */
233 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
235 # define wctob rpl_wctob
237 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
238 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
240 # if !defined wctob && !@HAVE_DECL_WCTOB@
241 /* wctob is provided by gnulib, or wctob exists but is not declared. */
242 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
244 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
247 _GL_CXXALIASWARN (wctob);
249 #elif defined GNULIB_POSIXCHECK
251 # if HAVE_RAW_DECL_WCTOB
252 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
253 "use gnulib module wctob for portability");
258 /* Test whether *PS is in the initial state. */
260 # if @REPLACE_MBSINIT@
261 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
263 # define mbsinit rpl_mbsinit
265 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
266 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
269 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
271 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
274 _GL_CXXALIASWARN (mbsinit);
276 #elif defined GNULIB_POSIXCHECK
278 # if HAVE_RAW_DECL_MBSINIT
279 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
280 "use gnulib module mbsinit for portability");
285 /* Convert a multibyte character to a wide character. */
287 # if @REPLACE_MBRTOWC@
288 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
290 # define mbrtowc rpl_mbrtowc
292 _GL_FUNCDECL_RPL (mbrtowc, size_t,
293 (wchar_t *restrict pwc, const char *restrict s, size_t n,
294 mbstate_t *restrict ps));
295 _GL_CXXALIAS_RPL (mbrtowc, size_t,
296 (wchar_t *restrict pwc, const char *restrict s, size_t n,
297 mbstate_t *restrict ps));
300 _GL_FUNCDECL_SYS (mbrtowc, size_t,
301 (wchar_t *restrict pwc, const char *restrict s, size_t n,
302 mbstate_t *restrict ps));
304 _GL_CXXALIAS_SYS (mbrtowc, size_t,
305 (wchar_t *restrict pwc, const char *restrict s, size_t n,
306 mbstate_t *restrict ps));
309 _GL_CXXALIASWARN (mbrtowc);
311 #elif defined GNULIB_POSIXCHECK
313 # if HAVE_RAW_DECL_MBRTOWC
314 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
315 "use gnulib module mbrtowc for portability");
320 /* Recognize a multibyte character. */
322 # if @REPLACE_MBRLEN@
323 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
325 # define mbrlen rpl_mbrlen
327 _GL_FUNCDECL_RPL (mbrlen, size_t,
328 (const char *restrict s, size_t n, mbstate_t *restrict ps));
329 _GL_CXXALIAS_RPL (mbrlen, size_t,
330 (const char *restrict s, size_t n, mbstate_t *restrict ps));
333 _GL_FUNCDECL_SYS (mbrlen, size_t,
334 (const char *restrict s, size_t n, mbstate_t *restrict ps));
336 _GL_CXXALIAS_SYS (mbrlen, size_t,
337 (const char *restrict s, size_t n, mbstate_t *restrict ps));
340 _GL_CXXALIASWARN (mbrlen);
342 #elif defined GNULIB_POSIXCHECK
344 # if HAVE_RAW_DECL_MBRLEN
345 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
346 "use gnulib module mbrlen for portability");
351 /* Convert a string to a wide string. */
352 #if @GNULIB_MBSRTOWCS@
353 # if @REPLACE_MBSRTOWCS@
354 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
356 # define mbsrtowcs rpl_mbsrtowcs
358 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
359 (wchar_t *restrict dest,
360 const char **restrict srcp, size_t len,
361 mbstate_t *restrict ps)
362 _GL_ARG_NONNULL ((2)));
363 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
364 (wchar_t *restrict dest,
365 const char **restrict srcp, size_t len,
366 mbstate_t *restrict ps));
368 # if !@HAVE_MBSRTOWCS@
369 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
370 (wchar_t *restrict dest,
371 const char **restrict srcp, size_t len,
372 mbstate_t *restrict ps)
373 _GL_ARG_NONNULL ((2)));
375 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
376 (wchar_t *restrict dest,
377 const char **restrict srcp, size_t len,
378 mbstate_t *restrict ps));
381 _GL_CXXALIASWARN (mbsrtowcs);
383 #elif defined GNULIB_POSIXCHECK
385 # if HAVE_RAW_DECL_MBSRTOWCS
386 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
387 "use gnulib module mbsrtowcs for portability");
392 /* Convert a string to a wide string. */
393 #if @GNULIB_MBSNRTOWCS@
394 # if @REPLACE_MBSNRTOWCS@
395 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
397 # define mbsnrtowcs rpl_mbsnrtowcs
399 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
400 (wchar_t *restrict dest,
401 const char **restrict srcp, size_t srclen, size_t len,
402 mbstate_t *restrict ps)
403 _GL_ARG_NONNULL ((2)));
404 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
405 (wchar_t *restrict dest,
406 const char **restrict srcp, size_t srclen, size_t len,
407 mbstate_t *restrict ps));
409 # if !@HAVE_MBSNRTOWCS@
410 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
411 (wchar_t *restrict dest,
412 const char **restrict srcp, size_t srclen, size_t len,
413 mbstate_t *restrict ps)
414 _GL_ARG_NONNULL ((2)));
416 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
417 (wchar_t *restrict dest,
418 const char **restrict srcp, size_t srclen, size_t len,
419 mbstate_t *restrict ps));
421 _GL_CXXALIASWARN (mbsnrtowcs);
422 #elif defined GNULIB_POSIXCHECK
424 # if HAVE_RAW_DECL_MBSNRTOWCS
425 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
426 "use gnulib module mbsnrtowcs for portability");
431 /* Convert a wide character to a multibyte character. */
433 # if @REPLACE_WCRTOMB@
434 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
436 # define wcrtomb rpl_wcrtomb
438 _GL_FUNCDECL_RPL (wcrtomb, size_t,
439 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
440 _GL_CXXALIAS_RPL (wcrtomb, size_t,
441 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
444 _GL_FUNCDECL_SYS (wcrtomb, size_t,
445 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
447 _GL_CXXALIAS_SYS (wcrtomb, size_t,
448 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
451 _GL_CXXALIASWARN (wcrtomb);
453 #elif defined GNULIB_POSIXCHECK
455 # if HAVE_RAW_DECL_WCRTOMB
456 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
457 "use gnulib module wcrtomb for portability");
462 /* Convert a wide string to a string. */
463 #if @GNULIB_WCSRTOMBS@
464 # if @REPLACE_WCSRTOMBS@
465 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
467 # define wcsrtombs rpl_wcsrtombs
469 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
470 (char *restrict dest, const wchar_t **restrict srcp,
472 mbstate_t *restrict ps)
473 _GL_ARG_NONNULL ((2)));
474 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
475 (char *restrict dest, const wchar_t **restrict srcp,
477 mbstate_t *restrict ps));
479 # if !@HAVE_WCSRTOMBS@
480 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
481 (char *restrict dest, const wchar_t **restrict srcp,
483 mbstate_t *restrict ps)
484 _GL_ARG_NONNULL ((2)));
486 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
487 (char *restrict dest, const wchar_t **restrict srcp,
489 mbstate_t *restrict ps));
492 _GL_CXXALIASWARN (wcsrtombs);
494 #elif defined GNULIB_POSIXCHECK
496 # if HAVE_RAW_DECL_WCSRTOMBS
497 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
498 "use gnulib module wcsrtombs for portability");
503 /* Convert a wide string to a string. */
504 #if @GNULIB_WCSNRTOMBS@
505 # if @REPLACE_WCSNRTOMBS@
506 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
508 # define wcsnrtombs rpl_wcsnrtombs
510 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
511 (char *restrict dest,
512 const wchar_t **restrict srcp, size_t srclen,
514 mbstate_t *restrict ps)
515 _GL_ARG_NONNULL ((2)));
516 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
517 (char *restrict dest,
518 const wchar_t **restrict srcp, size_t srclen,
520 mbstate_t *restrict ps));
522 # if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
523 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
524 (char *restrict dest,
525 const wchar_t **restrict srcp, size_t srclen,
527 mbstate_t *restrict ps)
528 _GL_ARG_NONNULL ((2)));
530 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
531 (char *restrict dest,
532 const wchar_t **restrict srcp, size_t srclen,
534 mbstate_t *restrict ps));
537 _GL_CXXALIASWARN (wcsnrtombs);
539 #elif defined GNULIB_POSIXCHECK
541 # if HAVE_RAW_DECL_WCSNRTOMBS
542 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
543 "use gnulib module wcsnrtombs for portability");
548 /* Return the number of screen columns needed for WC. */
550 # if @REPLACE_WCWIDTH@
551 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
553 # define wcwidth rpl_wcwidth
555 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
556 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
558 # if !@HAVE_DECL_WCWIDTH@
559 /* wcwidth exists but is not declared. */
560 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
562 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
565 _GL_CXXALIASWARN (wcwidth);
567 #elif defined GNULIB_POSIXCHECK
569 # if HAVE_RAW_DECL_WCWIDTH
570 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
571 "use gnulib module wcwidth for portability");
576 /* Search N wide characters of S for C. */
579 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
582 /* On some systems, this function is defined as an overloaded function:
584 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
585 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
587 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
588 wchar_t *, (const wchar_t *, wchar_t, size_t),
589 const wchar_t *, (const wchar_t *, wchar_t, size_t));
590 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
591 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
592 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
593 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
594 (const wchar_t *s, wchar_t c, size_t n));
595 # elif __GLIBC__ >= 2
596 _GL_CXXALIASWARN (wmemchr);
598 #elif defined GNULIB_POSIXCHECK
600 # if HAVE_RAW_DECL_WMEMCHR
601 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
602 "use gnulib module wmemchr for portability");
607 /* Compare N wide characters of S1 and S2. */
610 _GL_FUNCDECL_SYS (wmemcmp, int,
611 (const wchar_t *s1, const wchar_t *s2, size_t n)
614 _GL_CXXALIAS_SYS (wmemcmp, int,
615 (const wchar_t *s1, const wchar_t *s2, size_t n));
617 _GL_CXXALIASWARN (wmemcmp);
619 #elif defined GNULIB_POSIXCHECK
621 # if HAVE_RAW_DECL_WMEMCMP
622 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
623 "use gnulib module wmemcmp for portability");
628 /* Copy N wide characters of SRC to DEST. */
631 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
632 (wchar_t *restrict dest,
633 const wchar_t *restrict src, size_t n));
635 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
636 (wchar_t *restrict dest,
637 const wchar_t *restrict src, size_t n));
639 _GL_CXXALIASWARN (wmemcpy);
641 #elif defined GNULIB_POSIXCHECK
643 # if HAVE_RAW_DECL_WMEMCPY
644 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
645 "use gnulib module wmemcpy for portability");
650 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
651 overlapping memory areas. */
652 #if @GNULIB_WMEMMOVE@
653 # if !@HAVE_WMEMMOVE@
654 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
655 (wchar_t *dest, const wchar_t *src, size_t n));
657 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
658 (wchar_t *dest, const wchar_t *src, size_t n));
660 _GL_CXXALIASWARN (wmemmove);
662 #elif defined GNULIB_POSIXCHECK
664 # if HAVE_RAW_DECL_WMEMMOVE
665 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
666 "use gnulib module wmemmove for portability");
671 /* Copy N wide characters of SRC to DEST.
672 Return pointer to wide characters after the last written wide character. */
673 #if @GNULIB_WMEMPCPY@
674 # if !@HAVE_WMEMPCPY@
675 _GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
676 (wchar_t *restrict dest,
677 const wchar_t *restrict src, size_t n));
679 _GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
680 (wchar_t *restrict dest,
681 const wchar_t *restrict src, size_t n));
683 _GL_CXXALIASWARN (wmempcpy);
685 #elif defined GNULIB_POSIXCHECK
687 # if HAVE_RAW_DECL_WMEMPCPY
688 _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
689 "use gnulib module wmempcpy for portability");
694 /* Set N wide characters of S to C. */
697 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
699 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
701 _GL_CXXALIASWARN (wmemset);
703 #elif defined GNULIB_POSIXCHECK
705 # if HAVE_RAW_DECL_WMEMSET
706 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
707 "use gnulib module wmemset for portability");
712 /* Return the number of wide characters in S. */
715 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
717 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
719 _GL_CXXALIASWARN (wcslen);
721 #elif defined GNULIB_POSIXCHECK
723 # if HAVE_RAW_DECL_WCSLEN
724 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
725 "use gnulib module wcslen for portability");
730 /* Return the number of wide characters in S, but at most MAXLEN. */
733 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
736 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
737 _GL_CXXALIASWARN (wcsnlen);
738 #elif defined GNULIB_POSIXCHECK
740 # if HAVE_RAW_DECL_WCSNLEN
741 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
742 "use gnulib module wcsnlen for portability");
747 /* Copy SRC to DEST. */
750 _GL_FUNCDECL_SYS (wcscpy, wchar_t *,
751 (wchar_t *restrict dest, const wchar_t *restrict src));
753 _GL_CXXALIAS_SYS (wcscpy, wchar_t *,
754 (wchar_t *restrict dest, const wchar_t *restrict src));
756 _GL_CXXALIASWARN (wcscpy);
758 #elif defined GNULIB_POSIXCHECK
760 # if HAVE_RAW_DECL_WCSCPY
761 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
762 "use gnulib module wcscpy for portability");
767 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
770 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
771 (wchar_t *restrict dest, const wchar_t *restrict src));
773 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
774 (wchar_t *restrict dest, const wchar_t *restrict src));
775 _GL_CXXALIASWARN (wcpcpy);
776 #elif defined GNULIB_POSIXCHECK
778 # if HAVE_RAW_DECL_WCPCPY
779 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
780 "use gnulib module wcpcpy for portability");
785 /* Copy no more than N wide characters of SRC to DEST. */
788 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
789 (wchar_t *restrict dest,
790 const wchar_t *restrict src, size_t n));
792 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
793 (wchar_t *restrict dest,
794 const wchar_t *restrict src, size_t n));
796 _GL_CXXALIASWARN (wcsncpy);
798 #elif defined GNULIB_POSIXCHECK
800 # if HAVE_RAW_DECL_WCSNCPY
801 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
802 "use gnulib module wcsncpy for portability");
807 /* Copy no more than N characters of SRC to DEST, returning the address of
808 the last character written into DEST. */
811 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
812 (wchar_t *restrict dest,
813 const wchar_t *restrict src, size_t n));
815 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
816 (wchar_t *restrict dest,
817 const wchar_t *restrict src, size_t n));
818 _GL_CXXALIASWARN (wcpncpy);
819 #elif defined GNULIB_POSIXCHECK
821 # if HAVE_RAW_DECL_WCPNCPY
822 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
823 "use gnulib module wcpncpy for portability");
828 /* Append SRC onto DEST. */
831 _GL_FUNCDECL_SYS (wcscat, wchar_t *,
832 (wchar_t *restrict dest, const wchar_t *restrict src));
834 _GL_CXXALIAS_SYS (wcscat, wchar_t *,
835 (wchar_t *restrict dest, const wchar_t *restrict src));
837 _GL_CXXALIASWARN (wcscat);
839 #elif defined GNULIB_POSIXCHECK
841 # if HAVE_RAW_DECL_WCSCAT
842 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
843 "use gnulib module wcscat for portability");
848 /* Append no more than N wide characters of SRC onto DEST. */
851 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
852 (wchar_t *restrict dest, const wchar_t *restrict src,
855 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
856 (wchar_t *restrict dest, const wchar_t *restrict src,
859 _GL_CXXALIASWARN (wcsncat);
861 #elif defined GNULIB_POSIXCHECK
863 # if HAVE_RAW_DECL_WCSNCAT
864 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
865 "use gnulib module wcsncat for portability");
870 /* Compare S1 and S2. */
873 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
876 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
878 _GL_CXXALIASWARN (wcscmp);
880 #elif defined GNULIB_POSIXCHECK
882 # if HAVE_RAW_DECL_WCSCMP
883 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
884 "use gnulib module wcscmp for portability");
889 /* Compare no more than N wide characters of S1 and S2. */
892 _GL_FUNCDECL_SYS (wcsncmp, int,
893 (const wchar_t *s1, const wchar_t *s2, size_t n)
896 _GL_CXXALIAS_SYS (wcsncmp, int,
897 (const wchar_t *s1, const wchar_t *s2, size_t n));
899 _GL_CXXALIASWARN (wcsncmp);
901 #elif defined GNULIB_POSIXCHECK
903 # if HAVE_RAW_DECL_WCSNCMP
904 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
905 "use gnulib module wcsncmp for portability");
910 /* Compare S1 and S2, ignoring case. */
911 #if @GNULIB_WCSCASECMP@
912 # if !@HAVE_WCSCASECMP@
913 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
916 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
917 _GL_CXXALIASWARN (wcscasecmp);
918 #elif defined GNULIB_POSIXCHECK
920 # if HAVE_RAW_DECL_WCSCASECMP
921 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
922 "use gnulib module wcscasecmp for portability");
927 /* Compare no more than N chars of S1 and S2, ignoring case. */
928 #if @GNULIB_WCSNCASECMP@
929 # if !@HAVE_WCSNCASECMP@
930 _GL_FUNCDECL_SYS (wcsncasecmp, int,
931 (const wchar_t *s1, const wchar_t *s2, size_t n)
934 _GL_CXXALIAS_SYS (wcsncasecmp, int,
935 (const wchar_t *s1, const wchar_t *s2, size_t n));
936 _GL_CXXALIASWARN (wcsncasecmp);
937 #elif defined GNULIB_POSIXCHECK
939 # if HAVE_RAW_DECL_WCSNCASECMP
940 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
941 "use gnulib module wcsncasecmp for portability");
946 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
947 category of the current locale. */
950 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
952 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
954 _GL_CXXALIASWARN (wcscoll);
956 #elif defined GNULIB_POSIXCHECK
958 # if HAVE_RAW_DECL_WCSCOLL
959 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
960 "use gnulib module wcscoll for portability");
965 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
966 to two transformed strings the result is the as applying 'wcscoll' to the
970 _GL_FUNCDECL_SYS (wcsxfrm, size_t,
971 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
973 _GL_CXXALIAS_SYS (wcsxfrm, size_t,
974 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
976 _GL_CXXALIASWARN (wcsxfrm);
978 #elif defined GNULIB_POSIXCHECK
980 # if HAVE_RAW_DECL_WCSXFRM
981 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
982 "use gnulib module wcsxfrm for portability");
987 /* Duplicate S, returning an identical malloc'd string. */
989 # if defined _WIN32 && !defined __CYGWIN__
990 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
992 # define wcsdup _wcsdup
994 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
996 # if !@HAVE_WCSDUP@ || __GNUC__ >= 11
997 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
999 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1001 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1003 _GL_CXXALIASWARN (wcsdup);
1005 # if __GNUC__ >= 11 && !defined wcsdup
1006 /* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
1007 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1009 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1011 # if defined GNULIB_POSIXCHECK
1013 # if HAVE_RAW_DECL_WCSDUP
1014 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1015 "use gnulib module wcsdup for portability");
1017 # elif @GNULIB_MDA_WCSDUP@
1018 /* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
1019 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1020 platforms by defining GNULIB_NAMESPACE::wcsdup always. */
1021 # if defined _WIN32 && !defined __CYGWIN__
1022 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1024 # define wcsdup _wcsdup
1026 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1028 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1030 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1031 # if @HAVE_DECL_WCSDUP@
1032 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1035 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
1036 _GL_CXXALIASWARN (wcsdup);
1042 /* Find the first occurrence of WC in WCS. */
1045 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1046 _GL_ATTRIBUTE_PURE);
1048 /* On some systems, this function is defined as an overloaded function:
1050 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1051 wchar_t * std::wcschr (wchar_t *, wchar_t);
1053 _GL_CXXALIAS_SYS_CAST2 (wcschr,
1054 wchar_t *, (const wchar_t *, wchar_t),
1055 const wchar_t *, (const wchar_t *, wchar_t));
1056 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1057 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1058 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1059 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1060 # elif __GLIBC__ >= 2
1061 _GL_CXXALIASWARN (wcschr);
1063 #elif defined GNULIB_POSIXCHECK
1065 # if HAVE_RAW_DECL_WCSCHR
1066 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1067 "use gnulib module wcschr for portability");
1072 /* Find the last occurrence of WC in WCS. */
1073 #if @GNULIB_WCSRCHR@
1074 # if !@HAVE_WCSRCHR@
1075 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1076 _GL_ATTRIBUTE_PURE);
1078 /* On some systems, this function is defined as an overloaded function:
1080 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1081 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1083 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1084 wchar_t *, (const wchar_t *, wchar_t),
1085 const wchar_t *, (const wchar_t *, wchar_t));
1086 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1087 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1088 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1089 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1090 # elif __GLIBC__ >= 2
1091 _GL_CXXALIASWARN (wcsrchr);
1093 #elif defined GNULIB_POSIXCHECK
1095 # if HAVE_RAW_DECL_WCSRCHR
1096 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1097 "use gnulib module wcsrchr for portability");
1102 /* Return the length of the initial segmet of WCS which consists entirely
1103 of wide characters not in REJECT. */
1104 #if @GNULIB_WCSCSPN@
1105 # if !@HAVE_WCSCSPN@
1106 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1107 _GL_ATTRIBUTE_PURE);
1109 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1111 _GL_CXXALIASWARN (wcscspn);
1113 #elif defined GNULIB_POSIXCHECK
1115 # if HAVE_RAW_DECL_WCSCSPN
1116 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1117 "use gnulib module wcscspn for portability");
1122 /* Return the length of the initial segmet of WCS which consists entirely
1123 of wide characters in ACCEPT. */
1126 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1127 _GL_ATTRIBUTE_PURE);
1129 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1131 _GL_CXXALIASWARN (wcsspn);
1133 #elif defined GNULIB_POSIXCHECK
1135 # if HAVE_RAW_DECL_WCSSPN
1136 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1137 "use gnulib module wcsspn for portability");
1142 /* Find the first occurrence in WCS of any character in ACCEPT. */
1143 #if @GNULIB_WCSPBRK@
1144 # if !@HAVE_WCSPBRK@
1145 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1146 (const wchar_t *wcs, const wchar_t *accept)
1147 _GL_ATTRIBUTE_PURE);
1149 /* On some systems, this function is defined as an overloaded function:
1151 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1152 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1154 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1155 wchar_t *, (const wchar_t *, const wchar_t *),
1156 const wchar_t *, (const wchar_t *, const wchar_t *));
1157 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1158 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1159 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1160 (wchar_t *wcs, const wchar_t *accept));
1161 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1162 (const wchar_t *wcs, const wchar_t *accept));
1163 # elif __GLIBC__ >= 2
1164 _GL_CXXALIASWARN (wcspbrk);
1166 #elif defined GNULIB_POSIXCHECK
1168 # if HAVE_RAW_DECL_WCSPBRK
1169 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1170 "use gnulib module wcspbrk for portability");
1175 /* Find the first occurrence of NEEDLE in HAYSTACK. */
1178 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1179 (const wchar_t *restrict haystack,
1180 const wchar_t *restrict needle)
1181 _GL_ATTRIBUTE_PURE);
1183 /* On some systems, this function is defined as an overloaded function:
1185 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1186 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1188 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1190 (const wchar_t *restrict, const wchar_t *restrict),
1192 (const wchar_t *restrict, const wchar_t *restrict));
1193 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1194 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1195 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1196 (wchar_t *restrict haystack,
1197 const wchar_t *restrict needle));
1198 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1199 (const wchar_t *restrict haystack,
1200 const wchar_t *restrict needle));
1201 # elif __GLIBC__ >= 2
1202 _GL_CXXALIASWARN (wcsstr);
1204 #elif defined GNULIB_POSIXCHECK
1206 # if HAVE_RAW_DECL_WCSSTR
1207 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1208 "use gnulib module wcsstr for portability");
1213 /* Divide WCS into tokens separated by characters in DELIM. */
1215 # if @REPLACE_WCSTOK@
1216 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1218 # define wcstok rpl_wcstok
1220 _GL_FUNCDECL_RPL (wcstok, wchar_t *,
1221 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1222 wchar_t **restrict ptr));
1223 _GL_CXXALIAS_RPL (wcstok, wchar_t *,
1224 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1225 wchar_t **restrict ptr));
1228 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1229 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1230 wchar_t **restrict ptr));
1232 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1233 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1234 wchar_t **restrict ptr));
1237 _GL_CXXALIASWARN (wcstok);
1239 #elif defined GNULIB_POSIXCHECK
1241 # if HAVE_RAW_DECL_WCSTOK
1242 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1243 "use gnulib module wcstok for portability");
1248 /* Determine number of column positions required for first N wide
1249 characters (or fewer if S ends before this) in S. */
1250 #if @GNULIB_WCSWIDTH@
1251 # if @REPLACE_WCSWIDTH@
1252 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1254 # define wcswidth rpl_wcswidth
1256 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1257 _GL_ATTRIBUTE_PURE);
1258 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1260 # if !@HAVE_WCSWIDTH@
1261 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1262 _GL_ATTRIBUTE_PURE);
1264 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1267 _GL_CXXALIASWARN (wcswidth);
1269 #elif defined GNULIB_POSIXCHECK
1271 # if HAVE_RAW_DECL_WCSWIDTH
1272 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1273 "use gnulib module wcswidth for portability");
1278 /* Convert *TP to a date and time wide string. See
1279 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */
1280 #if @GNULIB_WCSFTIME@
1281 # if @REPLACE_WCSFTIME@
1282 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1284 # define wcsftime rpl_wcsftime
1286 _GL_FUNCDECL_RPL (wcsftime, size_t,
1287 (wchar_t *restrict __buf, size_t __bufsize,
1288 const wchar_t *restrict __fmt,
1289 const struct tm *restrict __tp)
1290 _GL_ARG_NONNULL ((1, 3, 4)));
1291 _GL_CXXALIAS_RPL (wcsftime, size_t,
1292 (wchar_t *restrict __buf, size_t __bufsize,
1293 const wchar_t *restrict __fmt,
1294 const struct tm *restrict __tp));
1296 # if !@HAVE_WCSFTIME@
1297 _GL_FUNCDECL_SYS (wcsftime, size_t,
1298 (wchar_t *restrict __buf, size_t __bufsize,
1299 const wchar_t *restrict __fmt,
1300 const struct tm *restrict __tp)
1301 _GL_ARG_NONNULL ((1, 3, 4)));
1303 _GL_CXXALIAS_SYS (wcsftime, size_t,
1304 (wchar_t *restrict __buf, size_t __bufsize,
1305 const wchar_t *restrict __fmt,
1306 const struct tm *restrict __tp));
1309 _GL_CXXALIASWARN (wcsftime);
1311 #elif defined GNULIB_POSIXCHECK
1313 # if HAVE_RAW_DECL_WCSFTIME
1314 _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1315 "use gnulib module wcsftime for portability");
1320 #endif /* _@GUARD_PREFIX@_WCHAR_H */
1321 #endif /* _@GUARD_PREFIX@_WCHAR_H */