summaryrefslogtreecommitdiffstats
path: root/gl/wchar.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/wchar.in.h')
-rw-r--r--gl/wchar.in.h313
1 files changed, 210 insertions, 103 deletions
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index a33a10f7..a6c52eb9 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -1,6 +1,6 @@
1/* A substitute for ISO C99 <wchar.h>, for platforms that have issues. 1/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
2 2
3 Copyright (C) 2007-2024 Free Software Foundation, Inc. 3 Copyright (C) 2007-2025 Free Software Foundation, Inc.
4 4
5 This file is free software: you can redistribute it and/or modify 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 6 it under the terms of the GNU Lesser General Public License as
@@ -37,7 +37,7 @@
37 && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \ 37 && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
38 || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \ 38 || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
39 || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \ 39 || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
40 || defined _GL_ALREADY_INCLUDING_WCHAR_H) 40 || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H)
41/* Special invocation convention: 41/* Special invocation convention:
42 - Inside glibc and uClibc header files, but not MinGW. 42 - Inside glibc and uClibc header files, but not MinGW.
43 - On HP-UX 11.00 we have a sequence of nested includes 43 - On HP-UX 11.00 we have a sequence of nested includes
@@ -53,13 +53,16 @@
53 <wctype.h> is completely included or is still being included. */ 53 <wctype.h> is completely included or is still being included. */
54 54
55#@INCLUDE_NEXT@ @NEXT_WCHAR_H@ 55#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
56/* The glibc 2.5 /usr/include/wchar.h defines __need_wint_t but never undefines
57 it. We need to do that here. */
58#undef __need_wint_t
56 59
57#else 60#else
58/* Normal invocation convention. */ 61/* Normal invocation convention. */
59 62
60#ifndef _@GUARD_PREFIX@_WCHAR_H 63#ifndef _@GUARD_PREFIX@_WCHAR_H
61 64
62#define _GL_ALREADY_INCLUDING_WCHAR_H 65#define _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H
63 66
64#if @HAVE_FEATURES_H@ 67#if @HAVE_FEATURES_H@
65# include <features.h> /* for __GLIBC__ */ 68# include <features.h> /* for __GLIBC__ */
@@ -79,7 +82,7 @@
79# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ 82# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
80#endif 83#endif
81 84
82#undef _GL_ALREADY_INCLUDING_WCHAR_H 85#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H
83 86
84#ifndef _@GUARD_PREFIX@_WCHAR_H 87#ifndef _@GUARD_PREFIX@_WCHAR_H
85#define _@GUARD_PREFIX@_WCHAR_H 88#define _@GUARD_PREFIX@_WCHAR_H
@@ -95,7 +98,7 @@
95 that can be freed by passing them as the Ith argument to the 98 that can be freed by passing them as the Ith argument to the
96 function F. */ 99 function F. */
97#ifndef _GL_ATTRIBUTE_DEALLOC 100#ifndef _GL_ATTRIBUTE_DEALLOC
98# if __GNUC__ >= 11 101# if __GNUC__ >= 11 && !defined __clang__
99# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) 102# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
100# else 103# else
101# define _GL_ATTRIBUTE_DEALLOC(f, i) 104# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -137,11 +140,23 @@
137# endif 140# endif
138#endif 141#endif
139 142
143/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
144 (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
145/* Applies to: functions. */
146#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
147# if __GNUC__ >= 15 && !defined __clang__
148# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
149 __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
150# else
151# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
152# endif
153#endif
154
140/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. 155/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
141 */ 156 */
142#ifndef _GL_ATTRIBUTE_NOTHROW 157#ifndef _GL_ATTRIBUTE_NOTHROW
143# if defined __cplusplus 158# if defined __cplusplus
144# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 159# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
145# if __cplusplus >= 201103L 160# if __cplusplus >= 201103L
146# define _GL_ATTRIBUTE_NOTHROW noexcept (true) 161# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
147# else 162# else
@@ -198,11 +213,12 @@ typedef unsigned int rpl_wint_t;
198/* Override mbstate_t if it is too small. 213/* Override mbstate_t if it is too small.
199 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for 214 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
200 implementing mbrtowc for encodings like UTF-8. 215 implementing mbrtowc for encodings like UTF-8.
201 On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is 216 On AIX, MSVC, and OpenBSD 6.0, mbrtowc needs to be overridden, but
202 large enough and overriding it would cause problems in C++ mode. */ 217 mbstate_t exists and is large enough and overriding it would cause problems
218 in C++ mode. */
203#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ 219#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
204# if !GNULIB_defined_mbstate_t 220# if !GNULIB_defined_mbstate_t
205# if !(defined _AIX || defined _MSC_VER) 221# if !(defined _AIX || defined _MSC_VER || defined __OpenBSD__)
206typedef int rpl_mbstate_t; 222typedef int rpl_mbstate_t;
207# undef mbstate_t 223# undef mbstate_t
208# define mbstate_t rpl_mbstate_t 224# define mbstate_t rpl_mbstate_t
@@ -262,6 +278,55 @@ _GL_EXTERN_C void free (void *);
262#endif 278#endif
263 279
264 280
281/* Declarations for ISO C N3322. */
282#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
283_GL_EXTERN_C wchar_t *wmemcpy (wchar_t *__dest, const wchar_t *__src, size_t __n)
284# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
285 _GL_ATTRIBUTE_NOTHROW
286# endif
287 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
288 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
289_GL_EXTERN_C wchar_t *wmemmove (wchar_t *__dest, const wchar_t *__src, size_t __n)
290# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
291 _GL_ATTRIBUTE_NOTHROW
292# endif
293 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
294 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
295_GL_EXTERN_C wchar_t *wcsncpy (wchar_t *__dest, const wchar_t *__src, size_t __n)
296# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
297 _GL_ATTRIBUTE_NOTHROW
298# endif
299 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
300 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
301_GL_EXTERN_C wchar_t *wcsncat (wchar_t *__dest, const wchar_t *__src, size_t __n)
302# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
303 _GL_ATTRIBUTE_NOTHROW
304# endif
305 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
306_GL_EXTERN_C int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
307# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
308 _GL_ATTRIBUTE_NOTHROW
309# endif
310 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
311 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
312_GL_EXTERN_C int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
313# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
314 _GL_ATTRIBUTE_NOTHROW
315# endif
316 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
317 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
318# ifndef __cplusplus
319_GL_EXTERN_C wchar_t *wmemchr (const wchar_t *__s, wchar_t __wc, size_t __n)
320 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
321# endif
322_GL_EXTERN_C wchar_t *wmemset (wchar_t *__s, wchar_t __wc, size_t __n)
323# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
324 _GL_ATTRIBUTE_NOTHROW
325# endif
326 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
327#endif
328
329
265/* Convert a single-byte character to a wide character. */ 330/* Convert a single-byte character to a wide character. */
266#if @GNULIB_BTOWC@ 331#if @GNULIB_BTOWC@
267# if @REPLACE_BTOWC@ 332# if @REPLACE_BTOWC@
@@ -269,11 +334,11 @@ _GL_EXTERN_C void free (void *);
269# undef btowc 334# undef btowc
270# define btowc rpl_btowc 335# define btowc rpl_btowc
271# endif 336# endif
272_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); 337_GL_FUNCDECL_RPL (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
273_GL_CXXALIAS_RPL (btowc, wint_t, (int c)); 338_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
274# else 339# else
275# if !@HAVE_BTOWC@ 340# if !@HAVE_BTOWC@
276_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); 341_GL_FUNCDECL_SYS (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
277# endif 342# endif
278/* Need to cast, because on mingw, the return type is 'unsigned short'. */ 343/* Need to cast, because on mingw, the return type is 'unsigned short'. */
279_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c)); 344_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
@@ -297,12 +362,12 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
297# undef wctob 362# undef wctob
298# define wctob rpl_wctob 363# define wctob rpl_wctob
299# endif 364# endif
300_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); 365_GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
301_GL_CXXALIAS_RPL (wctob, int, (wint_t wc)); 366_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
302# else 367# else
303# if !defined wctob && !@HAVE_DECL_WCTOB@ 368# if !defined wctob && !@HAVE_DECL_WCTOB@
304/* wctob is provided by gnulib, or wctob exists but is not declared. */ 369/* wctob is provided by gnulib, or wctob exists but is not declared. */
305_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); 370_GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
306# endif 371# endif
307_GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); 372_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
308# endif 373# endif
@@ -325,11 +390,11 @@ _GL_WARN_ON_USE (wctob, "wctob is unportable - "
325# undef mbsinit 390# undef mbsinit
326# define mbsinit rpl_mbsinit 391# define mbsinit rpl_mbsinit
327# endif 392# endif
328_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps)); 393_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps), );
329_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps)); 394_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
330# else 395# else
331# if !@HAVE_MBSINIT@ 396# if !@HAVE_MBSINIT@
332_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps)); 397_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps), );
333# endif 398# endif
334_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps)); 399_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
335# endif 400# endif
@@ -531,16 +596,19 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
531# define _GL_MBSTATE_ZERO_SIZE sizeof (mbstate_t) 596# define _GL_MBSTATE_ZERO_SIZE sizeof (mbstate_t)
532# endif 597# endif
533_GL_BEGIN_C_LINKAGE 598_GL_BEGIN_C_LINKAGE
534# if defined IN_MBSZERO 599# if !GNULIB_defined_mbszero
600# if defined IN_MBSZERO
535_GL_EXTERN_INLINE 601_GL_EXTERN_INLINE
536# else 602# else
537_GL_INLINE 603_GL_INLINE
538# endif 604# endif
539_GL_ARG_NONNULL ((1)) void 605_GL_ARG_NONNULL ((1)) void
540mbszero (mbstate_t *ps) 606mbszero (mbstate_t *ps)
541{ 607{
542 memset (ps, 0, _GL_MBSTATE_ZERO_SIZE); 608 memset (ps, 0, _GL_MBSTATE_ZERO_SIZE);
543} 609}
610# define GNULIB_defined_mbszero 1
611# endif
544_GL_END_C_LINKAGE 612_GL_END_C_LINKAGE
545_GL_CXXALIAS_SYS (mbszero, void, (mbstate_t *ps)); 613_GL_CXXALIAS_SYS (mbszero, void, (mbstate_t *ps));
546_GL_CXXALIASWARN (mbszero); 614_GL_CXXALIASWARN (mbszero);
@@ -556,7 +624,7 @@ _GL_CXXALIASWARN (mbszero);
556# endif 624# endif
557_GL_FUNCDECL_RPL (mbrtowc, size_t, 625_GL_FUNCDECL_RPL (mbrtowc, size_t,
558 (wchar_t *restrict pwc, const char *restrict s, size_t n, 626 (wchar_t *restrict pwc, const char *restrict s, size_t n,
559 mbstate_t *restrict ps)); 627 mbstate_t *restrict ps), );
560_GL_CXXALIAS_RPL (mbrtowc, size_t, 628_GL_CXXALIAS_RPL (mbrtowc, size_t,
561 (wchar_t *restrict pwc, const char *restrict s, size_t n, 629 (wchar_t *restrict pwc, const char *restrict s, size_t n,
562 mbstate_t *restrict ps)); 630 mbstate_t *restrict ps));
@@ -564,7 +632,7 @@ _GL_CXXALIAS_RPL (mbrtowc, size_t,
564# if !@HAVE_MBRTOWC@ 632# if !@HAVE_MBRTOWC@
565_GL_FUNCDECL_SYS (mbrtowc, size_t, 633_GL_FUNCDECL_SYS (mbrtowc, size_t,
566 (wchar_t *restrict pwc, const char *restrict s, size_t n, 634 (wchar_t *restrict pwc, const char *restrict s, size_t n,
567 mbstate_t *restrict ps)); 635 mbstate_t *restrict ps), );
568# endif 636# endif
569_GL_CXXALIAS_SYS (mbrtowc, size_t, 637_GL_CXXALIAS_SYS (mbrtowc, size_t,
570 (wchar_t *restrict pwc, const char *restrict s, size_t n, 638 (wchar_t *restrict pwc, const char *restrict s, size_t n,
@@ -590,13 +658,13 @@ _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
590# define mbrlen rpl_mbrlen 658# define mbrlen rpl_mbrlen
591# endif 659# endif
592_GL_FUNCDECL_RPL (mbrlen, size_t, 660_GL_FUNCDECL_RPL (mbrlen, size_t,
593 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 661 (const char *restrict s, size_t n, mbstate_t *restrict ps), );
594_GL_CXXALIAS_RPL (mbrlen, size_t, 662_GL_CXXALIAS_RPL (mbrlen, size_t,
595 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 663 (const char *restrict s, size_t n, mbstate_t *restrict ps));
596# else 664# else
597# if !@HAVE_MBRLEN@ 665# if !@HAVE_MBRLEN@
598_GL_FUNCDECL_SYS (mbrlen, size_t, 666_GL_FUNCDECL_SYS (mbrlen, size_t,
599 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 667 (const char *restrict s, size_t n, mbstate_t *restrict ps), );
600# endif 668# endif
601_GL_CXXALIAS_SYS (mbrlen, size_t, 669_GL_CXXALIAS_SYS (mbrlen, size_t,
602 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 670 (const char *restrict s, size_t n, mbstate_t *restrict ps));
@@ -623,7 +691,7 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
623_GL_FUNCDECL_RPL (mbsrtowcs, size_t, 691_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
624 (wchar_t *restrict dest, 692 (wchar_t *restrict dest,
625 const char **restrict srcp, size_t len, 693 const char **restrict srcp, size_t len,
626 mbstate_t *restrict ps) 694 mbstate_t *restrict ps),
627 _GL_ARG_NONNULL ((2))); 695 _GL_ARG_NONNULL ((2)));
628_GL_CXXALIAS_RPL (mbsrtowcs, size_t, 696_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
629 (wchar_t *restrict dest, 697 (wchar_t *restrict dest,
@@ -634,7 +702,7 @@ _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
634_GL_FUNCDECL_SYS (mbsrtowcs, size_t, 702_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
635 (wchar_t *restrict dest, 703 (wchar_t *restrict dest,
636 const char **restrict srcp, size_t len, 704 const char **restrict srcp, size_t len,
637 mbstate_t *restrict ps) 705 mbstate_t *restrict ps),
638 _GL_ARG_NONNULL ((2))); 706 _GL_ARG_NONNULL ((2)));
639# endif 707# endif
640_GL_CXXALIAS_SYS (mbsrtowcs, size_t, 708_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
@@ -664,7 +732,7 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
664_GL_FUNCDECL_RPL (mbsnrtowcs, size_t, 732_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
665 (wchar_t *restrict dest, 733 (wchar_t *restrict dest,
666 const char **restrict srcp, size_t srclen, size_t len, 734 const char **restrict srcp, size_t srclen, size_t len,
667 mbstate_t *restrict ps) 735 mbstate_t *restrict ps),
668 _GL_ARG_NONNULL ((2))); 736 _GL_ARG_NONNULL ((2)));
669_GL_CXXALIAS_RPL (mbsnrtowcs, size_t, 737_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
670 (wchar_t *restrict dest, 738 (wchar_t *restrict dest,
@@ -675,7 +743,7 @@ _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
675_GL_FUNCDECL_SYS (mbsnrtowcs, size_t, 743_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
676 (wchar_t *restrict dest, 744 (wchar_t *restrict dest,
677 const char **restrict srcp, size_t srclen, size_t len, 745 const char **restrict srcp, size_t srclen, size_t len,
678 mbstate_t *restrict ps) 746 mbstate_t *restrict ps),
679 _GL_ARG_NONNULL ((2))); 747 _GL_ARG_NONNULL ((2)));
680# endif 748# endif
681_GL_CXXALIAS_SYS (mbsnrtowcs, size_t, 749_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
@@ -703,13 +771,13 @@ _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
703# define wcrtomb rpl_wcrtomb 771# define wcrtomb rpl_wcrtomb
704# endif 772# endif
705_GL_FUNCDECL_RPL (wcrtomb, size_t, 773_GL_FUNCDECL_RPL (wcrtomb, size_t,
706 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 774 (char *restrict s, wchar_t wc, mbstate_t *restrict ps), );
707_GL_CXXALIAS_RPL (wcrtomb, size_t, 775_GL_CXXALIAS_RPL (wcrtomb, size_t,
708 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 776 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
709# else 777# else
710# if !@HAVE_WCRTOMB@ 778# if !@HAVE_WCRTOMB@
711_GL_FUNCDECL_SYS (wcrtomb, size_t, 779_GL_FUNCDECL_SYS (wcrtomb, size_t,
712 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 780 (char *restrict s, wchar_t wc, mbstate_t *restrict ps), );
713# endif 781# endif
714_GL_CXXALIAS_SYS (wcrtomb, size_t, 782_GL_CXXALIAS_SYS (wcrtomb, size_t,
715 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 783 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
@@ -736,7 +804,7 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
736_GL_FUNCDECL_RPL (wcsrtombs, size_t, 804_GL_FUNCDECL_RPL (wcsrtombs, size_t,
737 (char *restrict dest, const wchar_t **restrict srcp, 805 (char *restrict dest, const wchar_t **restrict srcp,
738 size_t len, 806 size_t len,
739 mbstate_t *restrict ps) 807 mbstate_t *restrict ps),
740 _GL_ARG_NONNULL ((2))); 808 _GL_ARG_NONNULL ((2)));
741_GL_CXXALIAS_RPL (wcsrtombs, size_t, 809_GL_CXXALIAS_RPL (wcsrtombs, size_t,
742 (char *restrict dest, const wchar_t **restrict srcp, 810 (char *restrict dest, const wchar_t **restrict srcp,
@@ -747,7 +815,7 @@ _GL_CXXALIAS_RPL (wcsrtombs, size_t,
747_GL_FUNCDECL_SYS (wcsrtombs, size_t, 815_GL_FUNCDECL_SYS (wcsrtombs, size_t,
748 (char *restrict dest, const wchar_t **restrict srcp, 816 (char *restrict dest, const wchar_t **restrict srcp,
749 size_t len, 817 size_t len,
750 mbstate_t *restrict ps) 818 mbstate_t *restrict ps),
751 _GL_ARG_NONNULL ((2))); 819 _GL_ARG_NONNULL ((2)));
752# endif 820# endif
753_GL_CXXALIAS_SYS (wcsrtombs, size_t, 821_GL_CXXALIAS_SYS (wcsrtombs, size_t,
@@ -778,7 +846,7 @@ _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
778 (char *restrict dest, 846 (char *restrict dest,
779 const wchar_t **restrict srcp, size_t srclen, 847 const wchar_t **restrict srcp, size_t srclen,
780 size_t len, 848 size_t len,
781 mbstate_t *restrict ps) 849 mbstate_t *restrict ps),
782 _GL_ARG_NONNULL ((2))); 850 _GL_ARG_NONNULL ((2)));
783_GL_CXXALIAS_RPL (wcsnrtombs, size_t, 851_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
784 (char *restrict dest, 852 (char *restrict dest,
@@ -791,7 +859,7 @@ _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
791 (char *restrict dest, 859 (char *restrict dest,
792 const wchar_t **restrict srcp, size_t srclen, 860 const wchar_t **restrict srcp, size_t srclen,
793 size_t len, 861 size_t len,
794 mbstate_t *restrict ps) 862 mbstate_t *restrict ps),
795 _GL_ARG_NONNULL ((2))); 863 _GL_ARG_NONNULL ((2)));
796# endif 864# endif
797_GL_CXXALIAS_SYS (wcsnrtombs, size_t, 865_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
@@ -819,12 +887,12 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
819# undef wcwidth 887# undef wcwidth
820# define wcwidth rpl_wcwidth 888# define wcwidth rpl_wcwidth
821# endif 889# endif
822_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); 890_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
823_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t)); 891_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
824# else 892# else
825# if !@HAVE_DECL_WCWIDTH@ 893# if !@HAVE_DECL_WCWIDTH@
826/* wcwidth exists but is not declared. */ 894/* wcwidth exists but is not declared. */
827_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); 895_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
828# endif 896# endif
829_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); 897_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
830# endif 898# endif
@@ -843,8 +911,9 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
843/* Search N wide characters of S for C. */ 911/* Search N wide characters of S for C. */
844#if @GNULIB_WMEMCHR@ 912#if @GNULIB_WMEMCHR@
845# if !@HAVE_WMEMCHR@ 913# if !@HAVE_WMEMCHR@
846_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n) 914_GL_FUNCDECL_SYS (wmemchr, wchar_t *,
847 _GL_ATTRIBUTE_PURE); 915 (const wchar_t *s, wchar_t c, size_t n),
916 _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
848# endif 917# endif
849 /* On some systems, this function is defined as an overloaded function: 918 /* On some systems, this function is defined as an overloaded function:
850 extern "C++" { 919 extern "C++" {
@@ -855,11 +924,12 @@ _GL_CXXALIAS_SYS_CAST2 (wmemchr,
855 wchar_t *, (const wchar_t *, wchar_t, size_t), 924 wchar_t *, (const wchar_t *, wchar_t, size_t),
856 const wchar_t *, (const wchar_t *, wchar_t, size_t)); 925 const wchar_t *, (const wchar_t *, wchar_t, size_t));
857# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 926# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
858 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 927 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
928 && !defined __clang__
859_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 929_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
860_GL_CXXALIASWARN1 (wmemchr, const wchar_t *, 930_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
861 (const wchar_t *s, wchar_t c, size_t n)); 931 (const wchar_t *s, wchar_t c, size_t n));
862# elif __GLIBC__ >= 2 932# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
863_GL_CXXALIASWARN (wmemchr); 933_GL_CXXALIASWARN (wmemchr);
864# endif 934# endif
865#elif defined GNULIB_POSIXCHECK 935#elif defined GNULIB_POSIXCHECK
@@ -879,15 +949,19 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
879# define wmemcmp rpl_wmemcmp 949# define wmemcmp rpl_wmemcmp
880# endif 950# endif
881_GL_FUNCDECL_RPL (wmemcmp, int, 951_GL_FUNCDECL_RPL (wmemcmp, int,
882 (const wchar_t *s1, const wchar_t *s2, size_t n) 952 (const wchar_t *s1, const wchar_t *s2, size_t n),
883 _GL_ATTRIBUTE_PURE); 953 _GL_ATTRIBUTE_PURE
954 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
955 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
884_GL_CXXALIAS_RPL (wmemcmp, int, 956_GL_CXXALIAS_RPL (wmemcmp, int,
885 (const wchar_t *s1, const wchar_t *s2, size_t n)); 957 (const wchar_t *s1, const wchar_t *s2, size_t n));
886# else 958# else
887# if !@HAVE_WMEMCMP@ 959# if !@HAVE_WMEMCMP@
888_GL_FUNCDECL_SYS (wmemcmp, int, 960_GL_FUNCDECL_SYS (wmemcmp, int,
889 (const wchar_t *s1, const wchar_t *s2, size_t n) 961 (const wchar_t *s1, const wchar_t *s2, size_t n),
890 _GL_ATTRIBUTE_PURE); 962 _GL_ATTRIBUTE_PURE
963 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
964 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
891# endif 965# endif
892_GL_CXXALIAS_SYS (wmemcmp, int, 966_GL_CXXALIAS_SYS (wmemcmp, int,
893 (const wchar_t *s1, const wchar_t *s2, size_t n)); 967 (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -909,7 +983,9 @@ _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
909# if !@HAVE_WMEMCPY@ 983# if !@HAVE_WMEMCPY@
910_GL_FUNCDECL_SYS (wmemcpy, wchar_t *, 984_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
911 (wchar_t *restrict dest, 985 (wchar_t *restrict dest,
912 const wchar_t *restrict src, size_t n)); 986 const wchar_t *restrict src, size_t n),
987 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
988 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
913# endif 989# endif
914_GL_CXXALIAS_SYS (wmemcpy, wchar_t *, 990_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
915 (wchar_t *restrict dest, 991 (wchar_t *restrict dest,
@@ -931,7 +1007,9 @@ _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
931#if @GNULIB_WMEMMOVE@ 1007#if @GNULIB_WMEMMOVE@
932# if !@HAVE_WMEMMOVE@ 1008# if !@HAVE_WMEMMOVE@
933_GL_FUNCDECL_SYS (wmemmove, wchar_t *, 1009_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
934 (wchar_t *dest, const wchar_t *src, size_t n)); 1010 (wchar_t *dest, const wchar_t *src, size_t n),
1011 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1012 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
935# endif 1013# endif
936_GL_CXXALIAS_SYS (wmemmove, wchar_t *, 1014_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
937 (wchar_t *dest, const wchar_t *src, size_t n)); 1015 (wchar_t *dest, const wchar_t *src, size_t n));
@@ -957,7 +1035,7 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
957# endif 1035# endif
958_GL_FUNCDECL_RPL (wmempcpy, wchar_t *, 1036_GL_FUNCDECL_RPL (wmempcpy, wchar_t *,
959 (wchar_t *restrict dest, 1037 (wchar_t *restrict dest,
960 const wchar_t *restrict src, size_t n)); 1038 const wchar_t *restrict src, size_t n), );
961_GL_CXXALIAS_RPL (wmempcpy, wchar_t *, 1039_GL_CXXALIAS_RPL (wmempcpy, wchar_t *,
962 (wchar_t *restrict dest, 1040 (wchar_t *restrict dest,
963 const wchar_t *restrict src, size_t n)); 1041 const wchar_t *restrict src, size_t n));
@@ -965,7 +1043,7 @@ _GL_CXXALIAS_RPL (wmempcpy, wchar_t *,
965# if !@HAVE_WMEMPCPY@ 1043# if !@HAVE_WMEMPCPY@
966_GL_FUNCDECL_SYS (wmempcpy, wchar_t *, 1044_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
967 (wchar_t *restrict dest, 1045 (wchar_t *restrict dest,
968 const wchar_t *restrict src, size_t n)); 1046 const wchar_t *restrict src, size_t n), );
969# endif 1047# endif
970_GL_CXXALIAS_SYS (wmempcpy, wchar_t *, 1048_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
971 (wchar_t *restrict dest, 1049 (wchar_t *restrict dest,
@@ -986,7 +1064,8 @@ _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
986/* Set N wide characters of S to C. */ 1064/* Set N wide characters of S to C. */
987#if @GNULIB_WMEMSET@ 1065#if @GNULIB_WMEMSET@
988# if !@HAVE_WMEMSET@ 1066# if !@HAVE_WMEMSET@
989_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 1067_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n),
1068 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
990# endif 1069# endif
991_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 1070_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
992# if __GLIBC__ >= 2 1071# if __GLIBC__ >= 2
@@ -1004,7 +1083,7 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
1004/* Return the number of wide characters in S. */ 1083/* Return the number of wide characters in S. */
1005#if @GNULIB_WCSLEN@ 1084#if @GNULIB_WCSLEN@
1006# if !@HAVE_WCSLEN@ 1085# if !@HAVE_WCSLEN@
1007_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE); 1086_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s), _GL_ATTRIBUTE_PURE);
1008# endif 1087# endif
1009_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); 1088_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
1010# if __GLIBC__ >= 2 1089# if __GLIBC__ >= 2
@@ -1025,7 +1104,7 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
1025 namespace, not in the global namespace. So, force a declaration in 1104 namespace, not in the global namespace. So, force a declaration in
1026 the global namespace. */ 1105 the global namespace. */
1027# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus) 1106# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
1028_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen) 1107_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen),
1029 _GL_ATTRIBUTE_PURE); 1108 _GL_ATTRIBUTE_PURE);
1030# endif 1109# endif
1031_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)); 1110_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
@@ -1043,7 +1122,7 @@ _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
1043#if @GNULIB_WCSCPY@ 1122#if @GNULIB_WCSCPY@
1044# if !@HAVE_WCSCPY@ 1123# if !@HAVE_WCSCPY@
1045_GL_FUNCDECL_SYS (wcscpy, wchar_t *, 1124_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
1046 (wchar_t *restrict dest, const wchar_t *restrict src)); 1125 (wchar_t *restrict dest, const wchar_t *restrict src), );
1047# endif 1126# endif
1048_GL_CXXALIAS_SYS (wcscpy, wchar_t *, 1127_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
1049 (wchar_t *restrict dest, const wchar_t *restrict src)); 1128 (wchar_t *restrict dest, const wchar_t *restrict src));
@@ -1066,7 +1145,7 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
1066 the global namespace. */ 1145 the global namespace. */
1067# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus) 1146# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus)
1068_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, 1147_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
1069 (wchar_t *restrict dest, const wchar_t *restrict src)); 1148 (wchar_t *restrict dest, const wchar_t *restrict src), );
1070# endif 1149# endif
1071_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, 1150_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
1072 (wchar_t *restrict dest, const wchar_t *restrict src)); 1151 (wchar_t *restrict dest, const wchar_t *restrict src));
@@ -1085,7 +1164,9 @@ _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
1085# if !@HAVE_WCSNCPY@ 1164# if !@HAVE_WCSNCPY@
1086_GL_FUNCDECL_SYS (wcsncpy, wchar_t *, 1165_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
1087 (wchar_t *restrict dest, 1166 (wchar_t *restrict dest,
1088 const wchar_t *restrict src, size_t n)); 1167 const wchar_t *restrict src, size_t n),
1168 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1169 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1089# endif 1170# endif
1090_GL_CXXALIAS_SYS (wcsncpy, wchar_t *, 1171_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
1091 (wchar_t *restrict dest, 1172 (wchar_t *restrict dest,
@@ -1111,7 +1192,7 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
1111# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus) 1192# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus)
1112_GL_FUNCDECL_SYS (wcpncpy, wchar_t *, 1193_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
1113 (wchar_t *restrict dest, 1194 (wchar_t *restrict dest,
1114 const wchar_t *restrict src, size_t n)); 1195 const wchar_t *restrict src, size_t n), );
1115# endif 1196# endif
1116_GL_CXXALIAS_SYS (wcpncpy, wchar_t *, 1197_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
1117 (wchar_t *restrict dest, 1198 (wchar_t *restrict dest,
@@ -1130,7 +1211,7 @@ _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
1130#if @GNULIB_WCSCAT@ 1211#if @GNULIB_WCSCAT@
1131# if !@HAVE_WCSCAT@ 1212# if !@HAVE_WCSCAT@
1132_GL_FUNCDECL_SYS (wcscat, wchar_t *, 1213_GL_FUNCDECL_SYS (wcscat, wchar_t *,
1133 (wchar_t *restrict dest, const wchar_t *restrict src)); 1214 (wchar_t *restrict dest, const wchar_t *restrict src), );
1134# endif 1215# endif
1135_GL_CXXALIAS_SYS (wcscat, wchar_t *, 1216_GL_CXXALIAS_SYS (wcscat, wchar_t *,
1136 (wchar_t *restrict dest, const wchar_t *restrict src)); 1217 (wchar_t *restrict dest, const wchar_t *restrict src));
@@ -1148,14 +1229,31 @@ _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
1148 1229
1149/* Append no more than N wide characters of SRC onto DEST. */ 1230/* Append no more than N wide characters of SRC onto DEST. */
1150#if @GNULIB_WCSNCAT@ 1231#if @GNULIB_WCSNCAT@
1151# if !@HAVE_WCSNCAT@ 1232# if @REPLACE_WCSNCAT@
1152_GL_FUNCDECL_SYS (wcsncat, wchar_t *, 1233# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1234# undef wcsncat
1235# define wcsncat rpl_wcsncat
1236# endif
1237_GL_FUNCDECL_RPL (wcsncat, wchar_t *,
1238 (wchar_t *restrict dest, const wchar_t *restrict src,
1239 size_t n),
1240 _GL_ARG_NONNULL ((1))
1241 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1242_GL_CXXALIAS_RPL (wcsncat, wchar_t *,
1153 (wchar_t *restrict dest, const wchar_t *restrict src, 1243 (wchar_t *restrict dest, const wchar_t *restrict src,
1154 size_t n)); 1244 size_t n));
1155# endif 1245# else
1246# if !@HAVE_WCSNCAT@
1247_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
1248 (wchar_t *restrict dest, const wchar_t *restrict src,
1249 size_t n),
1250 _GL_ARG_NONNULL ((1))
1251 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1252# endif
1156_GL_CXXALIAS_SYS (wcsncat, wchar_t *, 1253_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
1157 (wchar_t *restrict dest, const wchar_t *restrict src, 1254 (wchar_t *restrict dest, const wchar_t *restrict src,
1158 size_t n)); 1255 size_t n));
1256# endif
1159# if __GLIBC__ >= 2 1257# if __GLIBC__ >= 2
1160_GL_CXXALIASWARN (wcsncat); 1258_GL_CXXALIASWARN (wcsncat);
1161# endif 1259# endif
@@ -1175,12 +1273,12 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1175# undef wcscmp 1273# undef wcscmp
1176# define wcscmp rpl_wcscmp 1274# define wcscmp rpl_wcscmp
1177# endif 1275# endif
1178_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) 1276_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
1179 _GL_ATTRIBUTE_PURE); 1277 _GL_ATTRIBUTE_PURE);
1180_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); 1278_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1181# else 1279# else
1182# if !@HAVE_WCSCMP@ 1280# if !@HAVE_WCSCMP@
1183_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) 1281_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
1184 _GL_ATTRIBUTE_PURE); 1282 _GL_ATTRIBUTE_PURE);
1185# endif 1283# endif
1186_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); 1284_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1205,15 +1303,19 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1205# define wcsncmp rpl_wcsncmp 1303# define wcsncmp rpl_wcsncmp
1206# endif 1304# endif
1207_GL_FUNCDECL_RPL (wcsncmp, int, 1305_GL_FUNCDECL_RPL (wcsncmp, int,
1208 (const wchar_t *s1, const wchar_t *s2, size_t n) 1306 (const wchar_t *s1, const wchar_t *s2, size_t n),
1209 _GL_ATTRIBUTE_PURE); 1307 _GL_ATTRIBUTE_PURE
1308 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1309 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1210_GL_CXXALIAS_RPL (wcsncmp, int, 1310_GL_CXXALIAS_RPL (wcsncmp, int,
1211 (const wchar_t *s1, const wchar_t *s2, size_t n)); 1311 (const wchar_t *s1, const wchar_t *s2, size_t n));
1212# else 1312# else
1213# if !@HAVE_WCSNCMP@ 1313# if !@HAVE_WCSNCMP@
1214_GL_FUNCDECL_SYS (wcsncmp, int, 1314_GL_FUNCDECL_SYS (wcsncmp, int,
1215 (const wchar_t *s1, const wchar_t *s2, size_t n) 1315 (const wchar_t *s1, const wchar_t *s2, size_t n),
1216 _GL_ATTRIBUTE_PURE); 1316 _GL_ATTRIBUTE_PURE
1317 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1318 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1217# endif 1319# endif
1218_GL_CXXALIAS_SYS (wcsncmp, int, 1320_GL_CXXALIAS_SYS (wcsncmp, int,
1219 (const wchar_t *s1, const wchar_t *s2, size_t n)); 1321 (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -1236,7 +1338,7 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1236 namespace, not in the global namespace. So, force a declaration in 1338 namespace, not in the global namespace. So, force a declaration in
1237 the global namespace. */ 1339 the global namespace. */
1238# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus) 1340# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
1239_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2) 1341_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2),
1240 _GL_ATTRIBUTE_PURE); 1342 _GL_ATTRIBUTE_PURE);
1241# endif 1343# endif
1242_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)); 1344_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1257,7 +1359,7 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1257 the global namespace. */ 1359 the global namespace. */
1258# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus) 1360# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
1259_GL_FUNCDECL_SYS (wcsncasecmp, int, 1361_GL_FUNCDECL_SYS (wcsncasecmp, int,
1260 (const wchar_t *s1, const wchar_t *s2, size_t n) 1362 (const wchar_t *s1, const wchar_t *s2, size_t n),
1261 _GL_ATTRIBUTE_PURE); 1363 _GL_ATTRIBUTE_PURE);
1262# endif 1364# endif
1263_GL_CXXALIAS_SYS (wcsncasecmp, int, 1365_GL_CXXALIAS_SYS (wcsncasecmp, int,
@@ -1276,7 +1378,7 @@ _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1276 category of the current locale. */ 1378 category of the current locale. */
1277#if @GNULIB_WCSCOLL@ 1379#if @GNULIB_WCSCOLL@
1278# if !@HAVE_WCSCOLL@ 1380# if !@HAVE_WCSCOLL@
1279_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); 1381_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2), );
1280# endif 1382# endif
1281_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); 1383_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1282# if __GLIBC__ >= 2 1384# if __GLIBC__ >= 2
@@ -1297,7 +1399,7 @@ _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1297#if @GNULIB_WCSXFRM@ 1399#if @GNULIB_WCSXFRM@
1298# if !@HAVE_WCSXFRM@ 1400# if !@HAVE_WCSXFRM@
1299_GL_FUNCDECL_SYS (wcsxfrm, size_t, 1401_GL_FUNCDECL_SYS (wcsxfrm, size_t,
1300 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); 1402 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n), );
1301# endif 1403# endif
1302_GL_CXXALIAS_SYS (wcsxfrm, size_t, 1404_GL_CXXALIAS_SYS (wcsxfrm, size_t,
1303 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); 1405 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
@@ -1325,15 +1427,16 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1325/* On Solaris 11.3, the header files declare the function in the std:: 1427/* On Solaris 11.3, the header files declare the function in the std::
1326 namespace, not in the global namespace. So, force a declaration in 1428 namespace, not in the global namespace. So, force a declaration in
1327 the global namespace. */ 1429 the global namespace. */
1328# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >= 11 1430# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) \
1431 || (__GNUC__ >= 11 && !defined __clang__)
1329# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1432# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1330_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1433_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1331 (const wchar_t *s) 1434 (const wchar_t *s),
1332 _GL_ATTRIBUTE_NOTHROW 1435 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1333 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1436 _GL_ATTRIBUTE_NOTHROW;
1334# else 1437# else
1335_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1438_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1336 (const wchar_t *s) 1439 (const wchar_t *s),
1337 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1440 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1338# endif 1441# endif
1339# endif 1442# endif
@@ -1341,16 +1444,16 @@ _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1341# endif 1444# endif
1342_GL_CXXALIASWARN (wcsdup); 1445_GL_CXXALIASWARN (wcsdup);
1343#else 1446#else
1344# if __GNUC__ >= 11 && !defined wcsdup 1447# if (__GNUC__ >= 11 && !defined __clang__) && !defined wcsdup
1345/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */ 1448/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
1346# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1449# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1347_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1450_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1348 (const wchar_t *s) 1451 (const wchar_t *s),
1349 _GL_ATTRIBUTE_NOTHROW 1452 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1350 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1453 _GL_ATTRIBUTE_NOTHROW;
1351# else 1454# else
1352_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1455_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1353 (const wchar_t *s) 1456 (const wchar_t *s),
1354 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1457 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1355# endif 1458# endif
1356# endif 1459# endif
@@ -1373,12 +1476,12 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1373# else 1476# else
1374# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1477# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1375_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1478_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1376 (const wchar_t *s) 1479 (const wchar_t *s),
1377 _GL_ATTRIBUTE_NOTHROW 1480 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1378 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1481 _GL_ATTRIBUTE_NOTHROW;
1379# else 1482# else
1380_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1483_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1381 (const wchar_t *s) 1484 (const wchar_t *s),
1382 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1485 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1383# endif 1486# endif
1384# if @HAVE_DECL_WCSDUP@ 1487# if @HAVE_DECL_WCSDUP@
@@ -1395,7 +1498,7 @@ _GL_CXXALIASWARN (wcsdup);
1395/* Find the first occurrence of WC in WCS. */ 1498/* Find the first occurrence of WC in WCS. */
1396#if @GNULIB_WCSCHR@ 1499#if @GNULIB_WCSCHR@
1397# if !@HAVE_WCSCHR@ 1500# if !@HAVE_WCSCHR@
1398_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc) 1501_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
1399 _GL_ATTRIBUTE_PURE); 1502 _GL_ATTRIBUTE_PURE);
1400# endif 1503# endif
1401 /* On some systems, this function is defined as an overloaded function: 1504 /* On some systems, this function is defined as an overloaded function:
@@ -1407,10 +1510,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcschr,
1407 wchar_t *, (const wchar_t *, wchar_t), 1510 wchar_t *, (const wchar_t *, wchar_t),
1408 const wchar_t *, (const wchar_t *, wchar_t)); 1511 const wchar_t *, (const wchar_t *, wchar_t));
1409# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1512# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1410 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1513 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1514 && !defined __clang__
1411_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc)); 1515_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1412_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); 1516_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1413# elif __GLIBC__ >= 2 1517# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1414_GL_CXXALIASWARN (wcschr); 1518_GL_CXXALIASWARN (wcschr);
1415# endif 1519# endif
1416#elif defined GNULIB_POSIXCHECK 1520#elif defined GNULIB_POSIXCHECK
@@ -1425,7 +1529,7 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1425/* Find the last occurrence of WC in WCS. */ 1529/* Find the last occurrence of WC in WCS. */
1426#if @GNULIB_WCSRCHR@ 1530#if @GNULIB_WCSRCHR@
1427# if !@HAVE_WCSRCHR@ 1531# if !@HAVE_WCSRCHR@
1428_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc) 1532_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
1429 _GL_ATTRIBUTE_PURE); 1533 _GL_ATTRIBUTE_PURE);
1430# endif 1534# endif
1431 /* On some systems, this function is defined as an overloaded function: 1535 /* On some systems, this function is defined as an overloaded function:
@@ -1437,10 +1541,11 @@ _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1437 wchar_t *, (const wchar_t *, wchar_t), 1541 wchar_t *, (const wchar_t *, wchar_t),
1438 const wchar_t *, (const wchar_t *, wchar_t)); 1542 const wchar_t *, (const wchar_t *, wchar_t));
1439# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1543# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1440 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1544 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1545 && !defined __clang__
1441_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc)); 1546_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1442_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); 1547_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1443# elif __GLIBC__ >= 2 1548# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1444_GL_CXXALIASWARN (wcsrchr); 1549_GL_CXXALIASWARN (wcsrchr);
1445# endif 1550# endif
1446#elif defined GNULIB_POSIXCHECK 1551#elif defined GNULIB_POSIXCHECK
@@ -1456,7 +1561,7 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1456 of wide characters not in REJECT. */ 1561 of wide characters not in REJECT. */
1457#if @GNULIB_WCSCSPN@ 1562#if @GNULIB_WCSCSPN@
1458# if !@HAVE_WCSCSPN@ 1563# if !@HAVE_WCSCSPN@
1459_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject) 1564_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject),
1460 _GL_ATTRIBUTE_PURE); 1565 _GL_ATTRIBUTE_PURE);
1461# endif 1566# endif
1462_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); 1567_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
@@ -1476,7 +1581,7 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1476 of wide characters in ACCEPT. */ 1581 of wide characters in ACCEPT. */
1477#if @GNULIB_WCSSPN@ 1582#if @GNULIB_WCSSPN@
1478# if !@HAVE_WCSSPN@ 1583# if !@HAVE_WCSSPN@
1479_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept) 1584_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept),
1480 _GL_ATTRIBUTE_PURE); 1585 _GL_ATTRIBUTE_PURE);
1481# endif 1586# endif
1482_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); 1587_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
@@ -1496,7 +1601,7 @@ _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1496#if @GNULIB_WCSPBRK@ 1601#if @GNULIB_WCSPBRK@
1497# if !@HAVE_WCSPBRK@ 1602# if !@HAVE_WCSPBRK@
1498_GL_FUNCDECL_SYS (wcspbrk, wchar_t *, 1603_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1499 (const wchar_t *wcs, const wchar_t *accept) 1604 (const wchar_t *wcs, const wchar_t *accept),
1500 _GL_ATTRIBUTE_PURE); 1605 _GL_ATTRIBUTE_PURE);
1501# endif 1606# endif
1502 /* On some systems, this function is defined as an overloaded function: 1607 /* On some systems, this function is defined as an overloaded function:
@@ -1508,12 +1613,13 @@ _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1508 wchar_t *, (const wchar_t *, const wchar_t *), 1613 wchar_t *, (const wchar_t *, const wchar_t *),
1509 const wchar_t *, (const wchar_t *, const wchar_t *)); 1614 const wchar_t *, (const wchar_t *, const wchar_t *));
1510# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1615# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1511 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1616 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1617 && !defined __clang__
1512_GL_CXXALIASWARN1 (wcspbrk, wchar_t *, 1618_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1513 (wchar_t *wcs, const wchar_t *accept)); 1619 (wchar_t *wcs, const wchar_t *accept));
1514_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, 1620_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1515 (const wchar_t *wcs, const wchar_t *accept)); 1621 (const wchar_t *wcs, const wchar_t *accept));
1516# elif __GLIBC__ >= 2 1622# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1517_GL_CXXALIASWARN (wcspbrk); 1623_GL_CXXALIASWARN (wcspbrk);
1518# endif 1624# endif
1519#elif defined GNULIB_POSIXCHECK 1625#elif defined GNULIB_POSIXCHECK
@@ -1534,7 +1640,7 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1534# endif 1640# endif
1535_GL_FUNCDECL_RPL (wcsstr, wchar_t *, 1641_GL_FUNCDECL_RPL (wcsstr, wchar_t *,
1536 (const wchar_t *restrict haystack, 1642 (const wchar_t *restrict haystack,
1537 const wchar_t *restrict needle) 1643 const wchar_t *restrict needle),
1538 _GL_ATTRIBUTE_PURE); 1644 _GL_ATTRIBUTE_PURE);
1539_GL_CXXALIAS_RPL (wcsstr, wchar_t *, 1645_GL_CXXALIAS_RPL (wcsstr, wchar_t *,
1540 (const wchar_t *restrict haystack, 1646 (const wchar_t *restrict haystack,
@@ -1543,7 +1649,7 @@ _GL_CXXALIAS_RPL (wcsstr, wchar_t *,
1543# if !@HAVE_WCSSTR@ 1649# if !@HAVE_WCSSTR@
1544_GL_FUNCDECL_SYS (wcsstr, wchar_t *, 1650_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1545 (const wchar_t *restrict haystack, 1651 (const wchar_t *restrict haystack,
1546 const wchar_t *restrict needle) 1652 const wchar_t *restrict needle),
1547 _GL_ATTRIBUTE_PURE); 1653 _GL_ATTRIBUTE_PURE);
1548# endif 1654# endif
1549 /* On some systems, this function is defined as an overloaded function: 1655 /* On some systems, this function is defined as an overloaded function:
@@ -1558,14 +1664,15 @@ _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1558 (const wchar_t *restrict, const wchar_t *restrict)); 1664 (const wchar_t *restrict, const wchar_t *restrict));
1559# endif 1665# endif
1560# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1666# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1561 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1667 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1668 && !defined __clang__
1562_GL_CXXALIASWARN1 (wcsstr, wchar_t *, 1669_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1563 (wchar_t *restrict haystack, 1670 (wchar_t *restrict haystack,
1564 const wchar_t *restrict needle)); 1671 const wchar_t *restrict needle));
1565_GL_CXXALIASWARN1 (wcsstr, const wchar_t *, 1672_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1566 (const wchar_t *restrict haystack, 1673 (const wchar_t *restrict haystack,
1567 const wchar_t *restrict needle)); 1674 const wchar_t *restrict needle));
1568# elif __GLIBC__ >= 2 1675# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1569_GL_CXXALIASWARN (wcsstr); 1676_GL_CXXALIASWARN (wcsstr);
1570# endif 1677# endif
1571#elif defined GNULIB_POSIXCHECK 1678#elif defined GNULIB_POSIXCHECK
@@ -1586,7 +1693,7 @@ _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1586# endif 1693# endif
1587_GL_FUNCDECL_RPL (wcstok, wchar_t *, 1694_GL_FUNCDECL_RPL (wcstok, wchar_t *,
1588 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1695 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1589 wchar_t **restrict ptr)); 1696 wchar_t **restrict ptr), );
1590_GL_CXXALIAS_RPL (wcstok, wchar_t *, 1697_GL_CXXALIAS_RPL (wcstok, wchar_t *,
1591 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1698 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1592 wchar_t **restrict ptr)); 1699 wchar_t **restrict ptr));
@@ -1594,7 +1701,7 @@ _GL_CXXALIAS_RPL (wcstok, wchar_t *,
1594# if !@HAVE_WCSTOK@ 1701# if !@HAVE_WCSTOK@
1595_GL_FUNCDECL_SYS (wcstok, wchar_t *, 1702_GL_FUNCDECL_SYS (wcstok, wchar_t *,
1596 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1703 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1597 wchar_t **restrict ptr)); 1704 wchar_t **restrict ptr), );
1598# endif 1705# endif
1599_GL_CXXALIAS_SYS (wcstok, wchar_t *, 1706_GL_CXXALIAS_SYS (wcstok, wchar_t *,
1600 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1707 (wchar_t *restrict wcs, const wchar_t *restrict delim,
@@ -1620,12 +1727,12 @@ _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1620# undef wcswidth 1727# undef wcswidth
1621# define wcswidth rpl_wcswidth 1728# define wcswidth rpl_wcswidth
1622# endif 1729# endif
1623_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n) 1730_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n),
1624 _GL_ATTRIBUTE_PURE); 1731 _GL_ATTRIBUTE_PURE);
1625_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n)); 1732_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1626# else 1733# else
1627# if !@HAVE_WCSWIDTH@ 1734# if !@HAVE_WCSWIDTH@
1628_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n) 1735_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n),
1629 _GL_ATTRIBUTE_PURE); 1736 _GL_ATTRIBUTE_PURE);
1630# endif 1737# endif
1631_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); 1738_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
@@ -1653,7 +1760,7 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1653_GL_FUNCDECL_RPL (wcsftime, size_t, 1760_GL_FUNCDECL_RPL (wcsftime, size_t,
1654 (wchar_t *restrict __buf, size_t __bufsize, 1761 (wchar_t *restrict __buf, size_t __bufsize,
1655 const wchar_t *restrict __fmt, 1762 const wchar_t *restrict __fmt,
1656 const struct tm *restrict __tp) 1763 const struct tm *restrict __tp),
1657 _GL_ARG_NONNULL ((1, 3, 4))); 1764 _GL_ARG_NONNULL ((1, 3, 4)));
1658_GL_CXXALIAS_RPL (wcsftime, size_t, 1765_GL_CXXALIAS_RPL (wcsftime, size_t,
1659 (wchar_t *restrict __buf, size_t __bufsize, 1766 (wchar_t *restrict __buf, size_t __bufsize,
@@ -1664,7 +1771,7 @@ _GL_CXXALIAS_RPL (wcsftime, size_t,
1664_GL_FUNCDECL_SYS (wcsftime, size_t, 1771_GL_FUNCDECL_SYS (wcsftime, size_t,
1665 (wchar_t *restrict __buf, size_t __bufsize, 1772 (wchar_t *restrict __buf, size_t __bufsize,
1666 const wchar_t *restrict __fmt, 1773 const wchar_t *restrict __fmt,
1667 const struct tm *restrict __tp) 1774 const struct tm *restrict __tp),
1668 _GL_ARG_NONNULL ((1, 3, 4))); 1775 _GL_ARG_NONNULL ((1, 3, 4)));
1669# endif 1776# endif
1670_GL_CXXALIAS_SYS (wcsftime, size_t, 1777_GL_CXXALIAS_SYS (wcsftime, size_t,
@@ -1698,7 +1805,7 @@ _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1698 Possible errno values include: 1805 Possible errno values include:
1699 - ERANGE if SIZE is too small. 1806 - ERANGE if SIZE is too small.
1700 - ENOMEM if the memory could no be allocated. */ 1807 - ENOMEM if the memory could no be allocated. */
1701_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size)); 1808_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size), );
1702#endif 1809#endif
1703 1810
1704 1811