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.h373
1 files changed, 212 insertions, 161 deletions
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index a33a10f7..a60a4dfc 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-2026 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
@@ -36,8 +36,7 @@
36 && ((defined _INTTYPES_INCLUDED \ 36 && ((defined _INTTYPES_INCLUDED \
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)
41/* Special invocation convention: 40/* Special invocation convention:
42 - Inside glibc and uClibc header files, but not MinGW. 41 - Inside glibc and uClibc header files, but not MinGW.
43 - On HP-UX 11.00 we have a sequence of nested includes 42 - On HP-UX 11.00 we have a sequence of nested includes
@@ -47,20 +46,18 @@
47 therefore we cannot provide the function overrides; instead include only 46 therefore we cannot provide the function overrides; instead include only
48 the system's <wchar.h>. 47 the system's <wchar.h>.
49 - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of 48 - 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'. 49 <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. */
54 50
55#@INCLUDE_NEXT@ @NEXT_WCHAR_H@ 51#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
52/* The glibc 2.5 /usr/include/wchar.h defines __need_wint_t but never undefines
53 it. We need to do that here. */
54#undef __need_wint_t
56 55
57#else 56#else
58/* Normal invocation convention. */ 57/* Normal invocation convention. */
59 58
60#ifndef _@GUARD_PREFIX@_WCHAR_H 59#ifndef _@GUARD_PREFIX@_WCHAR_H
61 60
62#define _GL_ALREADY_INCLUDING_WCHAR_H
63
64#if @HAVE_FEATURES_H@ 61#if @HAVE_FEATURES_H@
65# include <features.h> /* for __GLIBC__ */ 62# include <features.h> /* for __GLIBC__ */
66#endif 63#endif
@@ -79,8 +76,6 @@
79# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ 76# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
80#endif 77#endif
81 78
82#undef _GL_ALREADY_INCLUDING_WCHAR_H
83
84#ifndef _@GUARD_PREFIX@_WCHAR_H 79#ifndef _@GUARD_PREFIX@_WCHAR_H
85#define _@GUARD_PREFIX@_WCHAR_H 80#define _@GUARD_PREFIX@_WCHAR_H
86 81
@@ -95,7 +90,7 @@
95 that can be freed by passing them as the Ith argument to the 90 that can be freed by passing them as the Ith argument to the
96 function F. */ 91 function F. */
97#ifndef _GL_ATTRIBUTE_DEALLOC 92#ifndef _GL_ATTRIBUTE_DEALLOC
98# if __GNUC__ >= 11 93# if __GNUC__ >= 11 && !defined __clang__
99# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) 94# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
100# else 95# else
101# define _GL_ATTRIBUTE_DEALLOC(f, i) 96# define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -107,7 +102,7 @@
107/* Applies to: functions. Cannot be used on inline functions. */ 102/* Applies to: functions. Cannot be used on inline functions. */
108#ifndef _GL_ATTRIBUTE_DEALLOC_FREE 103#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
109# if defined __cplusplus && defined __GNUC__ && !defined __clang__ 104# if defined __cplusplus && defined __GNUC__ && !defined __clang__
110/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */ 105/* Work around GCC bug <https://gcc.gnu.org/PR108231> */
111# define _GL_ATTRIBUTE_DEALLOC_FREE \ 106# define _GL_ATTRIBUTE_DEALLOC_FREE \
112 _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1) 107 _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
113# else 108# else
@@ -137,11 +132,23 @@
137# endif 132# endif
138#endif 133#endif
139 134
135/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
136 (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
137/* Applies to: functions. */
138#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
139# if __GNUC__ >= 15 && !defined __clang__
140# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
141 __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
142# else
143# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
144# endif
145#endif
146
140/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. 147/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
141 */ 148 */
142#ifndef _GL_ATTRIBUTE_NOTHROW 149#ifndef _GL_ATTRIBUTE_NOTHROW
143# if defined __cplusplus 150# if defined __cplusplus
144# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 151# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
145# if __cplusplus >= 201103L 152# if __cplusplus >= 201103L
146# define _GL_ATTRIBUTE_NOTHROW noexcept (true) 153# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
147# else 154# else
@@ -196,17 +203,11 @@ typedef unsigned int rpl_wint_t;
196 203
197 204
198/* Override mbstate_t if it is too small. 205/* Override mbstate_t if it is too small.
199 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for 206 On AIX, MSVC, and OpenBSD 6.0, mbrtowc needs to be overridden, but
200 implementing mbrtowc for encodings like UTF-8. 207 mbstate_t exists and is large enough and overriding it would cause problems
201 On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is 208 in C++ mode. */
202 large enough and overriding it would cause problems in C++ mode. */
203#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ 209#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
204# if !GNULIB_defined_mbstate_t 210# if !GNULIB_defined_mbstate_t
205# if !(defined _AIX || defined _MSC_VER)
206typedef int rpl_mbstate_t;
207# undef mbstate_t
208# define mbstate_t rpl_mbstate_t
209# endif
210# define GNULIB_defined_mbstate_t 1 211# define GNULIB_defined_mbstate_t 1
211# endif 212# endif
212#endif 213#endif
@@ -262,6 +263,55 @@ _GL_EXTERN_C void free (void *);
262#endif 263#endif
263 264
264 265
266/* Declarations for ISO C N3322. */
267#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
268_GL_EXTERN_C wchar_t *wmemcpy (wchar_t *__dest, const wchar_t *__src, size_t __n)
269# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
270 _GL_ATTRIBUTE_NOTHROW
271# endif
272 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
273 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
274_GL_EXTERN_C wchar_t *wmemmove (wchar_t *__dest, const wchar_t *__src, size_t __n)
275# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
276 _GL_ATTRIBUTE_NOTHROW
277# endif
278 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
279 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
280_GL_EXTERN_C wchar_t *wcsncpy (wchar_t *__dest, const wchar_t *__src, size_t __n)
281# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
282 _GL_ATTRIBUTE_NOTHROW
283# endif
284 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
285 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
286_GL_EXTERN_C wchar_t *wcsncat (wchar_t *__dest, const wchar_t *__src, size_t __n)
287# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
288 _GL_ATTRIBUTE_NOTHROW
289# endif
290 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
291_GL_EXTERN_C int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
292# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
293 _GL_ATTRIBUTE_NOTHROW
294# endif
295 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
296 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
297_GL_EXTERN_C int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
298# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
299 _GL_ATTRIBUTE_NOTHROW
300# endif
301 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
302 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
303# ifndef __cplusplus
304_GL_EXTERN_C wchar_t *(wmemchr) (const wchar_t *__s, wchar_t __wc, size_t __n)
305 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
306# endif
307_GL_EXTERN_C wchar_t *wmemset (wchar_t *__s, wchar_t __wc, size_t __n)
308# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
309 _GL_ATTRIBUTE_NOTHROW
310# endif
311 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
312#endif
313
314
265/* Convert a single-byte character to a wide character. */ 315/* Convert a single-byte character to a wide character. */
266#if @GNULIB_BTOWC@ 316#if @GNULIB_BTOWC@
267# if @REPLACE_BTOWC@ 317# if @REPLACE_BTOWC@
@@ -269,11 +319,11 @@ _GL_EXTERN_C void free (void *);
269# undef btowc 319# undef btowc
270# define btowc rpl_btowc 320# define btowc rpl_btowc
271# endif 321# endif
272_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); 322_GL_FUNCDECL_RPL (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
273_GL_CXXALIAS_RPL (btowc, wint_t, (int c)); 323_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
274# else 324# else
275# if !@HAVE_BTOWC@ 325# if !@HAVE_BTOWC@
276_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); 326_GL_FUNCDECL_SYS (btowc, wint_t, (int c), _GL_ATTRIBUTE_PURE);
277# endif 327# endif
278/* Need to cast, because on mingw, the return type is 'unsigned short'. */ 328/* Need to cast, because on mingw, the return type is 'unsigned short'. */
279_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c)); 329_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
@@ -282,7 +332,6 @@ _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
282_GL_CXXALIASWARN (btowc); 332_GL_CXXALIASWARN (btowc);
283# endif 333# endif
284#elif defined GNULIB_POSIXCHECK 334#elif defined GNULIB_POSIXCHECK
285# undef btowc
286# if HAVE_RAW_DECL_BTOWC 335# if HAVE_RAW_DECL_BTOWC
287_GL_WARN_ON_USE (btowc, "btowc is unportable - " 336_GL_WARN_ON_USE (btowc, "btowc is unportable - "
288 "use gnulib module btowc for portability"); 337 "use gnulib module btowc for portability");
@@ -297,12 +346,12 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
297# undef wctob 346# undef wctob
298# define wctob rpl_wctob 347# define wctob rpl_wctob
299# endif 348# endif
300_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); 349_GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
301_GL_CXXALIAS_RPL (wctob, int, (wint_t wc)); 350_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
302# else 351# else
303# if !defined wctob && !@HAVE_DECL_WCTOB@ 352# if !defined wctob && !@HAVE_WCTOB@
304/* wctob is provided by gnulib, or wctob exists but is not declared. */ 353/* wctob is provided by gnulib. */
305_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); 354_GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
306# endif 355# endif
307_GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); 356_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
308# endif 357# endif
@@ -310,7 +359,6 @@ _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
310_GL_CXXALIASWARN (wctob); 359_GL_CXXALIASWARN (wctob);
311# endif 360# endif
312#elif defined GNULIB_POSIXCHECK 361#elif defined GNULIB_POSIXCHECK
313# undef wctob
314# if HAVE_RAW_DECL_WCTOB 362# if HAVE_RAW_DECL_WCTOB
315_GL_WARN_ON_USE (wctob, "wctob is unportable - " 363_GL_WARN_ON_USE (wctob, "wctob is unportable - "
316 "use gnulib module wctob for portability"); 364 "use gnulib module wctob for portability");
@@ -325,11 +373,11 @@ _GL_WARN_ON_USE (wctob, "wctob is unportable - "
325# undef mbsinit 373# undef mbsinit
326# define mbsinit rpl_mbsinit 374# define mbsinit rpl_mbsinit
327# endif 375# endif
328_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps)); 376_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps), );
329_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps)); 377_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
330# else 378# else
331# if !@HAVE_MBSINIT@ 379# if !@HAVE_MBSINIT@
332_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps)); 380_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps), );
333# endif 381# endif
334_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps)); 382_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
335# endif 383# endif
@@ -337,7 +385,6 @@ _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
337_GL_CXXALIASWARN (mbsinit); 385_GL_CXXALIASWARN (mbsinit);
338# endif 386# endif
339#elif defined GNULIB_POSIXCHECK 387#elif defined GNULIB_POSIXCHECK
340# undef mbsinit
341# if HAVE_RAW_DECL_MBSINIT 388# if HAVE_RAW_DECL_MBSINIT
342_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - " 389_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
343 "use gnulib module mbsinit for portability"); 390 "use gnulib module mbsinit for portability");
@@ -378,7 +425,7 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
378 without considering what mbsinit() does, we get test failures such as 425 without considering what mbsinit() does, we get test failures such as
379 assertion "mbsinit (&iter->state)" failed 426 assertion "mbsinit (&iter->state)" failed
380 */ 427 */
381# if GNULIB_defined_mbstate_t /* AIX, IRIX */ 428# if GNULIB_defined_mbstate_t /* AIX */
382/* mbstate_t has at least 4 bytes. They are used as coded in 429/* mbstate_t has at least 4 bytes. They are used as coded in
383 gnulib/lib/mbrtowc.c. */ 430 gnulib/lib/mbrtowc.c. */
384# define _GL_MBSTATE_INIT_SIZE 1 431# define _GL_MBSTATE_INIT_SIZE 1
@@ -531,16 +578,19 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
531# define _GL_MBSTATE_ZERO_SIZE sizeof (mbstate_t) 578# define _GL_MBSTATE_ZERO_SIZE sizeof (mbstate_t)
532# endif 579# endif
533_GL_BEGIN_C_LINKAGE 580_GL_BEGIN_C_LINKAGE
534# if defined IN_MBSZERO 581# if !GNULIB_defined_mbszero
582# if defined IN_MBSZERO
535_GL_EXTERN_INLINE 583_GL_EXTERN_INLINE
536# else 584# else
537_GL_INLINE 585_GL_INLINE
538# endif 586# endif
539_GL_ARG_NONNULL ((1)) void 587_GL_ARG_NONNULL ((1)) void
540mbszero (mbstate_t *ps) 588mbszero (mbstate_t *ps)
541{ 589{
542 memset (ps, 0, _GL_MBSTATE_ZERO_SIZE); 590 memset (ps, 0, _GL_MBSTATE_ZERO_SIZE);
543} 591}
592# define GNULIB_defined_mbszero 1
593# endif
544_GL_END_C_LINKAGE 594_GL_END_C_LINKAGE
545_GL_CXXALIAS_SYS (mbszero, void, (mbstate_t *ps)); 595_GL_CXXALIAS_SYS (mbszero, void, (mbstate_t *ps));
546_GL_CXXALIASWARN (mbszero); 596_GL_CXXALIASWARN (mbszero);
@@ -556,7 +606,7 @@ _GL_CXXALIASWARN (mbszero);
556# endif 606# endif
557_GL_FUNCDECL_RPL (mbrtowc, size_t, 607_GL_FUNCDECL_RPL (mbrtowc, size_t,
558 (wchar_t *restrict pwc, const char *restrict s, size_t n, 608 (wchar_t *restrict pwc, const char *restrict s, size_t n,
559 mbstate_t *restrict ps)); 609 mbstate_t *restrict ps), );
560_GL_CXXALIAS_RPL (mbrtowc, size_t, 610_GL_CXXALIAS_RPL (mbrtowc, size_t,
561 (wchar_t *restrict pwc, const char *restrict s, size_t n, 611 (wchar_t *restrict pwc, const char *restrict s, size_t n,
562 mbstate_t *restrict ps)); 612 mbstate_t *restrict ps));
@@ -564,7 +614,7 @@ _GL_CXXALIAS_RPL (mbrtowc, size_t,
564# if !@HAVE_MBRTOWC@ 614# if !@HAVE_MBRTOWC@
565_GL_FUNCDECL_SYS (mbrtowc, size_t, 615_GL_FUNCDECL_SYS (mbrtowc, size_t,
566 (wchar_t *restrict pwc, const char *restrict s, size_t n, 616 (wchar_t *restrict pwc, const char *restrict s, size_t n,
567 mbstate_t *restrict ps)); 617 mbstate_t *restrict ps), );
568# endif 618# endif
569_GL_CXXALIAS_SYS (mbrtowc, size_t, 619_GL_CXXALIAS_SYS (mbrtowc, size_t,
570 (wchar_t *restrict pwc, const char *restrict s, size_t n, 620 (wchar_t *restrict pwc, const char *restrict s, size_t n,
@@ -574,7 +624,6 @@ _GL_CXXALIAS_SYS (mbrtowc, size_t,
574_GL_CXXALIASWARN (mbrtowc); 624_GL_CXXALIASWARN (mbrtowc);
575# endif 625# endif
576#elif defined GNULIB_POSIXCHECK 626#elif defined GNULIB_POSIXCHECK
577# undef mbrtowc
578# if HAVE_RAW_DECL_MBRTOWC 627# if HAVE_RAW_DECL_MBRTOWC
579_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - " 628_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
580 "use gnulib module mbrtowc for portability"); 629 "use gnulib module mbrtowc for portability");
@@ -590,13 +639,13 @@ _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
590# define mbrlen rpl_mbrlen 639# define mbrlen rpl_mbrlen
591# endif 640# endif
592_GL_FUNCDECL_RPL (mbrlen, size_t, 641_GL_FUNCDECL_RPL (mbrlen, size_t,
593 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 642 (const char *restrict s, size_t n, mbstate_t *restrict ps), );
594_GL_CXXALIAS_RPL (mbrlen, size_t, 643_GL_CXXALIAS_RPL (mbrlen, size_t,
595 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 644 (const char *restrict s, size_t n, mbstate_t *restrict ps));
596# else 645# else
597# if !@HAVE_MBRLEN@ 646# if !@HAVE_MBRLEN@
598_GL_FUNCDECL_SYS (mbrlen, size_t, 647_GL_FUNCDECL_SYS (mbrlen, size_t,
599 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 648 (const char *restrict s, size_t n, mbstate_t *restrict ps), );
600# endif 649# endif
601_GL_CXXALIAS_SYS (mbrlen, size_t, 650_GL_CXXALIAS_SYS (mbrlen, size_t,
602 (const char *restrict s, size_t n, mbstate_t *restrict ps)); 651 (const char *restrict s, size_t n, mbstate_t *restrict ps));
@@ -605,7 +654,6 @@ _GL_CXXALIAS_SYS (mbrlen, size_t,
605_GL_CXXALIASWARN (mbrlen); 654_GL_CXXALIASWARN (mbrlen);
606# endif 655# endif
607#elif defined GNULIB_POSIXCHECK 656#elif defined GNULIB_POSIXCHECK
608# undef mbrlen
609# if HAVE_RAW_DECL_MBRLEN 657# if HAVE_RAW_DECL_MBRLEN
610_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - " 658_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
611 "use gnulib module mbrlen for portability"); 659 "use gnulib module mbrlen for portability");
@@ -623,7 +671,7 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
623_GL_FUNCDECL_RPL (mbsrtowcs, size_t, 671_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
624 (wchar_t *restrict dest, 672 (wchar_t *restrict dest,
625 const char **restrict srcp, size_t len, 673 const char **restrict srcp, size_t len,
626 mbstate_t *restrict ps) 674 mbstate_t *restrict ps),
627 _GL_ARG_NONNULL ((2))); 675 _GL_ARG_NONNULL ((2)));
628_GL_CXXALIAS_RPL (mbsrtowcs, size_t, 676_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
629 (wchar_t *restrict dest, 677 (wchar_t *restrict dest,
@@ -634,7 +682,7 @@ _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
634_GL_FUNCDECL_SYS (mbsrtowcs, size_t, 682_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
635 (wchar_t *restrict dest, 683 (wchar_t *restrict dest,
636 const char **restrict srcp, size_t len, 684 const char **restrict srcp, size_t len,
637 mbstate_t *restrict ps) 685 mbstate_t *restrict ps),
638 _GL_ARG_NONNULL ((2))); 686 _GL_ARG_NONNULL ((2)));
639# endif 687# endif
640_GL_CXXALIAS_SYS (mbsrtowcs, size_t, 688_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
@@ -646,7 +694,6 @@ _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
646_GL_CXXALIASWARN (mbsrtowcs); 694_GL_CXXALIASWARN (mbsrtowcs);
647# endif 695# endif
648#elif defined GNULIB_POSIXCHECK 696#elif defined GNULIB_POSIXCHECK
649# undef mbsrtowcs
650# if HAVE_RAW_DECL_MBSRTOWCS 697# if HAVE_RAW_DECL_MBSRTOWCS
651_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - " 698_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
652 "use gnulib module mbsrtowcs for portability"); 699 "use gnulib module mbsrtowcs for portability");
@@ -664,7 +711,7 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
664_GL_FUNCDECL_RPL (mbsnrtowcs, size_t, 711_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
665 (wchar_t *restrict dest, 712 (wchar_t *restrict dest,
666 const char **restrict srcp, size_t srclen, size_t len, 713 const char **restrict srcp, size_t srclen, size_t len,
667 mbstate_t *restrict ps) 714 mbstate_t *restrict ps),
668 _GL_ARG_NONNULL ((2))); 715 _GL_ARG_NONNULL ((2)));
669_GL_CXXALIAS_RPL (mbsnrtowcs, size_t, 716_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
670 (wchar_t *restrict dest, 717 (wchar_t *restrict dest,
@@ -675,7 +722,7 @@ _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
675_GL_FUNCDECL_SYS (mbsnrtowcs, size_t, 722_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
676 (wchar_t *restrict dest, 723 (wchar_t *restrict dest,
677 const char **restrict srcp, size_t srclen, size_t len, 724 const char **restrict srcp, size_t srclen, size_t len,
678 mbstate_t *restrict ps) 725 mbstate_t *restrict ps),
679 _GL_ARG_NONNULL ((2))); 726 _GL_ARG_NONNULL ((2)));
680# endif 727# endif
681_GL_CXXALIAS_SYS (mbsnrtowcs, size_t, 728_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
@@ -687,7 +734,6 @@ _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
687_GL_CXXALIASWARN (mbsnrtowcs); 734_GL_CXXALIASWARN (mbsnrtowcs);
688# endif 735# endif
689#elif defined GNULIB_POSIXCHECK 736#elif defined GNULIB_POSIXCHECK
690# undef mbsnrtowcs
691# if HAVE_RAW_DECL_MBSNRTOWCS 737# if HAVE_RAW_DECL_MBSNRTOWCS
692_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - " 738_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
693 "use gnulib module mbsnrtowcs for portability"); 739 "use gnulib module mbsnrtowcs for portability");
@@ -703,13 +749,13 @@ _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
703# define wcrtomb rpl_wcrtomb 749# define wcrtomb rpl_wcrtomb
704# endif 750# endif
705_GL_FUNCDECL_RPL (wcrtomb, size_t, 751_GL_FUNCDECL_RPL (wcrtomb, size_t,
706 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 752 (char *restrict s, wchar_t wc, mbstate_t *restrict ps), );
707_GL_CXXALIAS_RPL (wcrtomb, size_t, 753_GL_CXXALIAS_RPL (wcrtomb, size_t,
708 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 754 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
709# else 755# else
710# if !@HAVE_WCRTOMB@ 756# if !@HAVE_WCRTOMB@
711_GL_FUNCDECL_SYS (wcrtomb, size_t, 757_GL_FUNCDECL_SYS (wcrtomb, size_t,
712 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 758 (char *restrict s, wchar_t wc, mbstate_t *restrict ps), );
713# endif 759# endif
714_GL_CXXALIAS_SYS (wcrtomb, size_t, 760_GL_CXXALIAS_SYS (wcrtomb, size_t,
715 (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); 761 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
@@ -718,7 +764,6 @@ _GL_CXXALIAS_SYS (wcrtomb, size_t,
718_GL_CXXALIASWARN (wcrtomb); 764_GL_CXXALIASWARN (wcrtomb);
719# endif 765# endif
720#elif defined GNULIB_POSIXCHECK 766#elif defined GNULIB_POSIXCHECK
721# undef wcrtomb
722# if HAVE_RAW_DECL_WCRTOMB 767# if HAVE_RAW_DECL_WCRTOMB
723_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - " 768_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
724 "use gnulib module wcrtomb for portability"); 769 "use gnulib module wcrtomb for portability");
@@ -736,7 +781,7 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
736_GL_FUNCDECL_RPL (wcsrtombs, size_t, 781_GL_FUNCDECL_RPL (wcsrtombs, size_t,
737 (char *restrict dest, const wchar_t **restrict srcp, 782 (char *restrict dest, const wchar_t **restrict srcp,
738 size_t len, 783 size_t len,
739 mbstate_t *restrict ps) 784 mbstate_t *restrict ps),
740 _GL_ARG_NONNULL ((2))); 785 _GL_ARG_NONNULL ((2)));
741_GL_CXXALIAS_RPL (wcsrtombs, size_t, 786_GL_CXXALIAS_RPL (wcsrtombs, size_t,
742 (char *restrict dest, const wchar_t **restrict srcp, 787 (char *restrict dest, const wchar_t **restrict srcp,
@@ -747,7 +792,7 @@ _GL_CXXALIAS_RPL (wcsrtombs, size_t,
747_GL_FUNCDECL_SYS (wcsrtombs, size_t, 792_GL_FUNCDECL_SYS (wcsrtombs, size_t,
748 (char *restrict dest, const wchar_t **restrict srcp, 793 (char *restrict dest, const wchar_t **restrict srcp,
749 size_t len, 794 size_t len,
750 mbstate_t *restrict ps) 795 mbstate_t *restrict ps),
751 _GL_ARG_NONNULL ((2))); 796 _GL_ARG_NONNULL ((2)));
752# endif 797# endif
753_GL_CXXALIAS_SYS (wcsrtombs, size_t, 798_GL_CXXALIAS_SYS (wcsrtombs, size_t,
@@ -759,7 +804,6 @@ _GL_CXXALIAS_SYS (wcsrtombs, size_t,
759_GL_CXXALIASWARN (wcsrtombs); 804_GL_CXXALIASWARN (wcsrtombs);
760# endif 805# endif
761#elif defined GNULIB_POSIXCHECK 806#elif defined GNULIB_POSIXCHECK
762# undef wcsrtombs
763# if HAVE_RAW_DECL_WCSRTOMBS 807# if HAVE_RAW_DECL_WCSRTOMBS
764_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - " 808_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
765 "use gnulib module wcsrtombs for portability"); 809 "use gnulib module wcsrtombs for portability");
@@ -778,7 +822,7 @@ _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
778 (char *restrict dest, 822 (char *restrict dest,
779 const wchar_t **restrict srcp, size_t srclen, 823 const wchar_t **restrict srcp, size_t srclen,
780 size_t len, 824 size_t len,
781 mbstate_t *restrict ps) 825 mbstate_t *restrict ps),
782 _GL_ARG_NONNULL ((2))); 826 _GL_ARG_NONNULL ((2)));
783_GL_CXXALIAS_RPL (wcsnrtombs, size_t, 827_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
784 (char *restrict dest, 828 (char *restrict dest,
@@ -791,7 +835,7 @@ _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
791 (char *restrict dest, 835 (char *restrict dest,
792 const wchar_t **restrict srcp, size_t srclen, 836 const wchar_t **restrict srcp, size_t srclen,
793 size_t len, 837 size_t len,
794 mbstate_t *restrict ps) 838 mbstate_t *restrict ps),
795 _GL_ARG_NONNULL ((2))); 839 _GL_ARG_NONNULL ((2)));
796# endif 840# endif
797_GL_CXXALIAS_SYS (wcsnrtombs, size_t, 841_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
@@ -804,7 +848,6 @@ _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
804_GL_CXXALIASWARN (wcsnrtombs); 848_GL_CXXALIASWARN (wcsnrtombs);
805# endif 849# endif
806#elif defined GNULIB_POSIXCHECK 850#elif defined GNULIB_POSIXCHECK
807# undef wcsnrtombs
808# if HAVE_RAW_DECL_WCSNRTOMBS 851# if HAVE_RAW_DECL_WCSNRTOMBS
809_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - " 852_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
810 "use gnulib module wcsnrtombs for portability"); 853 "use gnulib module wcsnrtombs for portability");
@@ -819,12 +862,12 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
819# undef wcwidth 862# undef wcwidth
820# define wcwidth rpl_wcwidth 863# define wcwidth rpl_wcwidth
821# endif 864# endif
822_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); 865_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
823_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t)); 866_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
824# else 867# else
825# if !@HAVE_DECL_WCWIDTH@ 868# if !@HAVE_DECL_WCWIDTH@
826/* wcwidth exists but is not declared. */ 869/* wcwidth exists but is not declared. */
827_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); 870_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t), _GL_ATTRIBUTE_PURE);
828# endif 871# endif
829_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); 872_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
830# endif 873# endif
@@ -832,7 +875,6 @@ _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
832_GL_CXXALIASWARN (wcwidth); 875_GL_CXXALIASWARN (wcwidth);
833# endif 876# endif
834#elif defined GNULIB_POSIXCHECK 877#elif defined GNULIB_POSIXCHECK
835# undef wcwidth
836# if HAVE_RAW_DECL_WCWIDTH 878# if HAVE_RAW_DECL_WCWIDTH
837_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - " 879_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
838 "use gnulib module wcwidth for portability"); 880 "use gnulib module wcwidth for portability");
@@ -843,8 +885,9 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
843/* Search N wide characters of S for C. */ 885/* Search N wide characters of S for C. */
844#if @GNULIB_WMEMCHR@ 886#if @GNULIB_WMEMCHR@
845# if !@HAVE_WMEMCHR@ 887# if !@HAVE_WMEMCHR@
846_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n) 888_GL_FUNCDECL_SYS (wmemchr, wchar_t *,
847 _GL_ATTRIBUTE_PURE); 889 (const wchar_t *s, wchar_t c, size_t n),
890 _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
848# endif 891# endif
849 /* On some systems, this function is defined as an overloaded function: 892 /* On some systems, this function is defined as an overloaded function:
850 extern "C++" { 893 extern "C++" {
@@ -855,15 +898,15 @@ _GL_CXXALIAS_SYS_CAST2 (wmemchr,
855 wchar_t *, (const wchar_t *, wchar_t, size_t), 898 wchar_t *, (const wchar_t *, wchar_t, size_t),
856 const wchar_t *, (const wchar_t *, wchar_t, size_t)); 899 const wchar_t *, (const wchar_t *, wchar_t, size_t));
857# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 900# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
858 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 901 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
902 && !defined __clang__
859_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 903_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
860_GL_CXXALIASWARN1 (wmemchr, const wchar_t *, 904_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
861 (const wchar_t *s, wchar_t c, size_t n)); 905 (const wchar_t *s, wchar_t c, size_t n));
862# elif __GLIBC__ >= 2 906# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
863_GL_CXXALIASWARN (wmemchr); 907_GL_CXXALIASWARN (wmemchr);
864# endif 908# endif
865#elif defined GNULIB_POSIXCHECK 909#elif defined GNULIB_POSIXCHECK
866# undef wmemchr
867# if HAVE_RAW_DECL_WMEMCHR 910# if HAVE_RAW_DECL_WMEMCHR
868_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - " 911_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
869 "use gnulib module wmemchr for portability"); 912 "use gnulib module wmemchr for portability");
@@ -879,15 +922,19 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
879# define wmemcmp rpl_wmemcmp 922# define wmemcmp rpl_wmemcmp
880# endif 923# endif
881_GL_FUNCDECL_RPL (wmemcmp, int, 924_GL_FUNCDECL_RPL (wmemcmp, int,
882 (const wchar_t *s1, const wchar_t *s2, size_t n) 925 (const wchar_t *s1, const wchar_t *s2, size_t n),
883 _GL_ATTRIBUTE_PURE); 926 _GL_ATTRIBUTE_PURE
927 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
928 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
884_GL_CXXALIAS_RPL (wmemcmp, int, 929_GL_CXXALIAS_RPL (wmemcmp, int,
885 (const wchar_t *s1, const wchar_t *s2, size_t n)); 930 (const wchar_t *s1, const wchar_t *s2, size_t n));
886# else 931# else
887# if !@HAVE_WMEMCMP@ 932# if !@HAVE_WMEMCMP@
888_GL_FUNCDECL_SYS (wmemcmp, int, 933_GL_FUNCDECL_SYS (wmemcmp, int,
889 (const wchar_t *s1, const wchar_t *s2, size_t n) 934 (const wchar_t *s1, const wchar_t *s2, size_t n),
890 _GL_ATTRIBUTE_PURE); 935 _GL_ATTRIBUTE_PURE
936 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
937 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
891# endif 938# endif
892_GL_CXXALIAS_SYS (wmemcmp, int, 939_GL_CXXALIAS_SYS (wmemcmp, int,
893 (const wchar_t *s1, const wchar_t *s2, size_t n)); 940 (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -896,7 +943,6 @@ _GL_CXXALIAS_SYS (wmemcmp, int,
896_GL_CXXALIASWARN (wmemcmp); 943_GL_CXXALIASWARN (wmemcmp);
897# endif 944# endif
898#elif defined GNULIB_POSIXCHECK 945#elif defined GNULIB_POSIXCHECK
899# undef wmemcmp
900# if HAVE_RAW_DECL_WMEMCMP 946# if HAVE_RAW_DECL_WMEMCMP
901_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - " 947_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
902 "use gnulib module wmemcmp for portability"); 948 "use gnulib module wmemcmp for portability");
@@ -909,7 +955,9 @@ _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
909# if !@HAVE_WMEMCPY@ 955# if !@HAVE_WMEMCPY@
910_GL_FUNCDECL_SYS (wmemcpy, wchar_t *, 956_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
911 (wchar_t *restrict dest, 957 (wchar_t *restrict dest,
912 const wchar_t *restrict src, size_t n)); 958 const wchar_t *restrict src, size_t n),
959 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
960 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
913# endif 961# endif
914_GL_CXXALIAS_SYS (wmemcpy, wchar_t *, 962_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
915 (wchar_t *restrict dest, 963 (wchar_t *restrict dest,
@@ -918,7 +966,6 @@ _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
918_GL_CXXALIASWARN (wmemcpy); 966_GL_CXXALIASWARN (wmemcpy);
919# endif 967# endif
920#elif defined GNULIB_POSIXCHECK 968#elif defined GNULIB_POSIXCHECK
921# undef wmemcpy
922# if HAVE_RAW_DECL_WMEMCPY 969# if HAVE_RAW_DECL_WMEMCPY
923_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - " 970_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
924 "use gnulib module wmemcpy for portability"); 971 "use gnulib module wmemcpy for portability");
@@ -931,7 +978,9 @@ _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
931#if @GNULIB_WMEMMOVE@ 978#if @GNULIB_WMEMMOVE@
932# if !@HAVE_WMEMMOVE@ 979# if !@HAVE_WMEMMOVE@
933_GL_FUNCDECL_SYS (wmemmove, wchar_t *, 980_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
934 (wchar_t *dest, const wchar_t *src, size_t n)); 981 (wchar_t *dest, const wchar_t *src, size_t n),
982 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
983 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
935# endif 984# endif
936_GL_CXXALIAS_SYS (wmemmove, wchar_t *, 985_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
937 (wchar_t *dest, const wchar_t *src, size_t n)); 986 (wchar_t *dest, const wchar_t *src, size_t n));
@@ -939,7 +988,6 @@ _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
939_GL_CXXALIASWARN (wmemmove); 988_GL_CXXALIASWARN (wmemmove);
940# endif 989# endif
941#elif defined GNULIB_POSIXCHECK 990#elif defined GNULIB_POSIXCHECK
942# undef wmemmove
943# if HAVE_RAW_DECL_WMEMMOVE 991# if HAVE_RAW_DECL_WMEMMOVE
944_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - " 992_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
945 "use gnulib module wmemmove for portability"); 993 "use gnulib module wmemmove for portability");
@@ -957,7 +1005,7 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
957# endif 1005# endif
958_GL_FUNCDECL_RPL (wmempcpy, wchar_t *, 1006_GL_FUNCDECL_RPL (wmempcpy, wchar_t *,
959 (wchar_t *restrict dest, 1007 (wchar_t *restrict dest,
960 const wchar_t *restrict src, size_t n)); 1008 const wchar_t *restrict src, size_t n), );
961_GL_CXXALIAS_RPL (wmempcpy, wchar_t *, 1009_GL_CXXALIAS_RPL (wmempcpy, wchar_t *,
962 (wchar_t *restrict dest, 1010 (wchar_t *restrict dest,
963 const wchar_t *restrict src, size_t n)); 1011 const wchar_t *restrict src, size_t n));
@@ -965,7 +1013,7 @@ _GL_CXXALIAS_RPL (wmempcpy, wchar_t *,
965# if !@HAVE_WMEMPCPY@ 1013# if !@HAVE_WMEMPCPY@
966_GL_FUNCDECL_SYS (wmempcpy, wchar_t *, 1014_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
967 (wchar_t *restrict dest, 1015 (wchar_t *restrict dest,
968 const wchar_t *restrict src, size_t n)); 1016 const wchar_t *restrict src, size_t n), );
969# endif 1017# endif
970_GL_CXXALIAS_SYS (wmempcpy, wchar_t *, 1018_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
971 (wchar_t *restrict dest, 1019 (wchar_t *restrict dest,
@@ -975,7 +1023,6 @@ _GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
975_GL_CXXALIASWARN (wmempcpy); 1023_GL_CXXALIASWARN (wmempcpy);
976# endif 1024# endif
977#elif defined GNULIB_POSIXCHECK 1025#elif defined GNULIB_POSIXCHECK
978# undef wmempcpy
979# if HAVE_RAW_DECL_WMEMPCPY 1026# if HAVE_RAW_DECL_WMEMPCPY
980_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - " 1027_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
981 "use gnulib module wmempcpy for portability"); 1028 "use gnulib module wmempcpy for portability");
@@ -986,14 +1033,14 @@ _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
986/* Set N wide characters of S to C. */ 1033/* Set N wide characters of S to C. */
987#if @GNULIB_WMEMSET@ 1034#if @GNULIB_WMEMSET@
988# if !@HAVE_WMEMSET@ 1035# if !@HAVE_WMEMSET@
989_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 1036_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n),
1037 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
990# endif 1038# endif
991_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); 1039_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
992# if __GLIBC__ >= 2 1040# if __GLIBC__ >= 2
993_GL_CXXALIASWARN (wmemset); 1041_GL_CXXALIASWARN (wmemset);
994# endif 1042# endif
995#elif defined GNULIB_POSIXCHECK 1043#elif defined GNULIB_POSIXCHECK
996# undef wmemset
997# if HAVE_RAW_DECL_WMEMSET 1044# if HAVE_RAW_DECL_WMEMSET
998_GL_WARN_ON_USE (wmemset, "wmemset is unportable - " 1045_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
999 "use gnulib module wmemset for portability"); 1046 "use gnulib module wmemset for portability");
@@ -1004,14 +1051,13 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
1004/* Return the number of wide characters in S. */ 1051/* Return the number of wide characters in S. */
1005#if @GNULIB_WCSLEN@ 1052#if @GNULIB_WCSLEN@
1006# if !@HAVE_WCSLEN@ 1053# if !@HAVE_WCSLEN@
1007_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE); 1054_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s), _GL_ATTRIBUTE_PURE);
1008# endif 1055# endif
1009_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); 1056_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
1010# if __GLIBC__ >= 2 1057# if __GLIBC__ >= 2
1011_GL_CXXALIASWARN (wcslen); 1058_GL_CXXALIASWARN (wcslen);
1012# endif 1059# endif
1013#elif defined GNULIB_POSIXCHECK 1060#elif defined GNULIB_POSIXCHECK
1014# undef wcslen
1015# if HAVE_RAW_DECL_WCSLEN 1061# if HAVE_RAW_DECL_WCSLEN
1016_GL_WARN_ON_USE (wcslen, "wcslen is unportable - " 1062_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
1017 "use gnulib module wcslen for portability"); 1063 "use gnulib module wcslen for portability");
@@ -1025,13 +1071,12 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
1025 namespace, not in the global namespace. So, force a declaration in 1071 namespace, not in the global namespace. So, force a declaration in
1026 the global namespace. */ 1072 the global namespace. */
1027# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus) 1073# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
1028_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen) 1074_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen),
1029 _GL_ATTRIBUTE_PURE); 1075 _GL_ATTRIBUTE_PURE);
1030# endif 1076# endif
1031_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)); 1077_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
1032_GL_CXXALIASWARN (wcsnlen); 1078_GL_CXXALIASWARN (wcsnlen);
1033#elif defined GNULIB_POSIXCHECK 1079#elif defined GNULIB_POSIXCHECK
1034# undef wcsnlen
1035# if HAVE_RAW_DECL_WCSNLEN 1080# if HAVE_RAW_DECL_WCSNLEN
1036_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - " 1081_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
1037 "use gnulib module wcsnlen for portability"); 1082 "use gnulib module wcsnlen for portability");
@@ -1043,7 +1088,7 @@ _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
1043#if @GNULIB_WCSCPY@ 1088#if @GNULIB_WCSCPY@
1044# if !@HAVE_WCSCPY@ 1089# if !@HAVE_WCSCPY@
1045_GL_FUNCDECL_SYS (wcscpy, wchar_t *, 1090_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
1046 (wchar_t *restrict dest, const wchar_t *restrict src)); 1091 (wchar_t *restrict dest, const wchar_t *restrict src), );
1047# endif 1092# endif
1048_GL_CXXALIAS_SYS (wcscpy, wchar_t *, 1093_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
1049 (wchar_t *restrict dest, const wchar_t *restrict src)); 1094 (wchar_t *restrict dest, const wchar_t *restrict src));
@@ -1051,7 +1096,6 @@ _GL_CXXALIAS_SYS (wcscpy, wchar_t *,
1051_GL_CXXALIASWARN (wcscpy); 1096_GL_CXXALIASWARN (wcscpy);
1052# endif 1097# endif
1053#elif defined GNULIB_POSIXCHECK 1098#elif defined GNULIB_POSIXCHECK
1054# undef wcscpy
1055# if HAVE_RAW_DECL_WCSCPY 1099# if HAVE_RAW_DECL_WCSCPY
1056_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - " 1100_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
1057 "use gnulib module wcscpy for portability"); 1101 "use gnulib module wcscpy for portability");
@@ -1066,13 +1110,12 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
1066 the global namespace. */ 1110 the global namespace. */
1067# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus) 1111# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus)
1068_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, 1112_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
1069 (wchar_t *restrict dest, const wchar_t *restrict src)); 1113 (wchar_t *restrict dest, const wchar_t *restrict src), );
1070# endif 1114# endif
1071_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, 1115_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
1072 (wchar_t *restrict dest, const wchar_t *restrict src)); 1116 (wchar_t *restrict dest, const wchar_t *restrict src));
1073_GL_CXXALIASWARN (wcpcpy); 1117_GL_CXXALIASWARN (wcpcpy);
1074#elif defined GNULIB_POSIXCHECK 1118#elif defined GNULIB_POSIXCHECK
1075# undef wcpcpy
1076# if HAVE_RAW_DECL_WCPCPY 1119# if HAVE_RAW_DECL_WCPCPY
1077_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - " 1120_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
1078 "use gnulib module wcpcpy for portability"); 1121 "use gnulib module wcpcpy for portability");
@@ -1085,7 +1128,9 @@ _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
1085# if !@HAVE_WCSNCPY@ 1128# if !@HAVE_WCSNCPY@
1086_GL_FUNCDECL_SYS (wcsncpy, wchar_t *, 1129_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
1087 (wchar_t *restrict dest, 1130 (wchar_t *restrict dest,
1088 const wchar_t *restrict src, size_t n)); 1131 const wchar_t *restrict src, size_t n),
1132 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1133 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1089# endif 1134# endif
1090_GL_CXXALIAS_SYS (wcsncpy, wchar_t *, 1135_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
1091 (wchar_t *restrict dest, 1136 (wchar_t *restrict dest,
@@ -1094,7 +1139,6 @@ _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
1094_GL_CXXALIASWARN (wcsncpy); 1139_GL_CXXALIASWARN (wcsncpy);
1095# endif 1140# endif
1096#elif defined GNULIB_POSIXCHECK 1141#elif defined GNULIB_POSIXCHECK
1097# undef wcsncpy
1098# if HAVE_RAW_DECL_WCSNCPY 1142# if HAVE_RAW_DECL_WCSNCPY
1099_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - " 1143_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
1100 "use gnulib module wcsncpy for portability"); 1144 "use gnulib module wcsncpy for portability");
@@ -1111,14 +1155,13 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
1111# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus) 1155# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus)
1112_GL_FUNCDECL_SYS (wcpncpy, wchar_t *, 1156_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
1113 (wchar_t *restrict dest, 1157 (wchar_t *restrict dest,
1114 const wchar_t *restrict src, size_t n)); 1158 const wchar_t *restrict src, size_t n), );
1115# endif 1159# endif
1116_GL_CXXALIAS_SYS (wcpncpy, wchar_t *, 1160_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
1117 (wchar_t *restrict dest, 1161 (wchar_t *restrict dest,
1118 const wchar_t *restrict src, size_t n)); 1162 const wchar_t *restrict src, size_t n));
1119_GL_CXXALIASWARN (wcpncpy); 1163_GL_CXXALIASWARN (wcpncpy);
1120#elif defined GNULIB_POSIXCHECK 1164#elif defined GNULIB_POSIXCHECK
1121# undef wcpncpy
1122# if HAVE_RAW_DECL_WCPNCPY 1165# if HAVE_RAW_DECL_WCPNCPY
1123_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - " 1166_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
1124 "use gnulib module wcpncpy for portability"); 1167 "use gnulib module wcpncpy for portability");
@@ -1130,7 +1173,7 @@ _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
1130#if @GNULIB_WCSCAT@ 1173#if @GNULIB_WCSCAT@
1131# if !@HAVE_WCSCAT@ 1174# if !@HAVE_WCSCAT@
1132_GL_FUNCDECL_SYS (wcscat, wchar_t *, 1175_GL_FUNCDECL_SYS (wcscat, wchar_t *,
1133 (wchar_t *restrict dest, const wchar_t *restrict src)); 1176 (wchar_t *restrict dest, const wchar_t *restrict src), );
1134# endif 1177# endif
1135_GL_CXXALIAS_SYS (wcscat, wchar_t *, 1178_GL_CXXALIAS_SYS (wcscat, wchar_t *,
1136 (wchar_t *restrict dest, const wchar_t *restrict src)); 1179 (wchar_t *restrict dest, const wchar_t *restrict src));
@@ -1138,7 +1181,6 @@ _GL_CXXALIAS_SYS (wcscat, wchar_t *,
1138_GL_CXXALIASWARN (wcscat); 1181_GL_CXXALIASWARN (wcscat);
1139# endif 1182# endif
1140#elif defined GNULIB_POSIXCHECK 1183#elif defined GNULIB_POSIXCHECK
1141# undef wcscat
1142# if HAVE_RAW_DECL_WCSCAT 1184# if HAVE_RAW_DECL_WCSCAT
1143_GL_WARN_ON_USE (wcscat, "wcscat is unportable - " 1185_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
1144 "use gnulib module wcscat for portability"); 1186 "use gnulib module wcscat for portability");
@@ -1148,19 +1190,35 @@ _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
1148 1190
1149/* Append no more than N wide characters of SRC onto DEST. */ 1191/* Append no more than N wide characters of SRC onto DEST. */
1150#if @GNULIB_WCSNCAT@ 1192#if @GNULIB_WCSNCAT@
1151# if !@HAVE_WCSNCAT@ 1193# if @REPLACE_WCSNCAT@
1152_GL_FUNCDECL_SYS (wcsncat, wchar_t *, 1194# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1195# undef wcsncat
1196# define wcsncat rpl_wcsncat
1197# endif
1198_GL_FUNCDECL_RPL (wcsncat, wchar_t *,
1199 (wchar_t *restrict dest, const wchar_t *restrict src,
1200 size_t n),
1201 _GL_ARG_NONNULL ((1))
1202 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1203_GL_CXXALIAS_RPL (wcsncat, wchar_t *,
1153 (wchar_t *restrict dest, const wchar_t *restrict src, 1204 (wchar_t *restrict dest, const wchar_t *restrict src,
1154 size_t n)); 1205 size_t n));
1155# endif 1206# else
1207# if !@HAVE_WCSNCAT@
1208_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
1209 (wchar_t *restrict dest, const wchar_t *restrict src,
1210 size_t n),
1211 _GL_ARG_NONNULL ((1))
1212 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1213# endif
1156_GL_CXXALIAS_SYS (wcsncat, wchar_t *, 1214_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
1157 (wchar_t *restrict dest, const wchar_t *restrict src, 1215 (wchar_t *restrict dest, const wchar_t *restrict src,
1158 size_t n)); 1216 size_t n));
1217# endif
1159# if __GLIBC__ >= 2 1218# if __GLIBC__ >= 2
1160_GL_CXXALIASWARN (wcsncat); 1219_GL_CXXALIASWARN (wcsncat);
1161# endif 1220# endif
1162#elif defined GNULIB_POSIXCHECK 1221#elif defined GNULIB_POSIXCHECK
1163# undef wcsncat
1164# if HAVE_RAW_DECL_WCSNCAT 1222# if HAVE_RAW_DECL_WCSNCAT
1165_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - " 1223_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1166 "use gnulib module wcsncat for portability"); 1224 "use gnulib module wcsncat for portability");
@@ -1175,12 +1233,12 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1175# undef wcscmp 1233# undef wcscmp
1176# define wcscmp rpl_wcscmp 1234# define wcscmp rpl_wcscmp
1177# endif 1235# endif
1178_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) 1236_GL_FUNCDECL_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
1179 _GL_ATTRIBUTE_PURE); 1237 _GL_ATTRIBUTE_PURE);
1180_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); 1238_GL_CXXALIAS_RPL (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1181# else 1239# else
1182# if !@HAVE_WCSCMP@ 1240# if !@HAVE_WCSCMP@
1183_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) 1241_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2),
1184 _GL_ATTRIBUTE_PURE); 1242 _GL_ATTRIBUTE_PURE);
1185# endif 1243# endif
1186_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); 1244_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
@@ -1189,7 +1247,6 @@ _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1189_GL_CXXALIASWARN (wcscmp); 1247_GL_CXXALIASWARN (wcscmp);
1190# endif 1248# endif
1191#elif defined GNULIB_POSIXCHECK 1249#elif defined GNULIB_POSIXCHECK
1192# undef wcscmp
1193# if HAVE_RAW_DECL_WCSCMP 1250# if HAVE_RAW_DECL_WCSCMP
1194_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - " 1251_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1195 "use gnulib module wcscmp for portability"); 1252 "use gnulib module wcscmp for portability");
@@ -1205,15 +1262,19 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1205# define wcsncmp rpl_wcsncmp 1262# define wcsncmp rpl_wcsncmp
1206# endif 1263# endif
1207_GL_FUNCDECL_RPL (wcsncmp, int, 1264_GL_FUNCDECL_RPL (wcsncmp, int,
1208 (const wchar_t *s1, const wchar_t *s2, size_t n) 1265 (const wchar_t *s1, const wchar_t *s2, size_t n),
1209 _GL_ATTRIBUTE_PURE); 1266 _GL_ATTRIBUTE_PURE
1267 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1268 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1210_GL_CXXALIAS_RPL (wcsncmp, int, 1269_GL_CXXALIAS_RPL (wcsncmp, int,
1211 (const wchar_t *s1, const wchar_t *s2, size_t n)); 1270 (const wchar_t *s1, const wchar_t *s2, size_t n));
1212# else 1271# else
1213# if !@HAVE_WCSNCMP@ 1272# if !@HAVE_WCSNCMP@
1214_GL_FUNCDECL_SYS (wcsncmp, int, 1273_GL_FUNCDECL_SYS (wcsncmp, int,
1215 (const wchar_t *s1, const wchar_t *s2, size_t n) 1274 (const wchar_t *s1, const wchar_t *s2, size_t n),
1216 _GL_ATTRIBUTE_PURE); 1275 _GL_ATTRIBUTE_PURE
1276 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
1277 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
1217# endif 1278# endif
1218_GL_CXXALIAS_SYS (wcsncmp, int, 1279_GL_CXXALIAS_SYS (wcsncmp, int,
1219 (const wchar_t *s1, const wchar_t *s2, size_t n)); 1280 (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -1222,7 +1283,6 @@ _GL_CXXALIAS_SYS (wcsncmp, int,
1222_GL_CXXALIASWARN (wcsncmp); 1283_GL_CXXALIASWARN (wcsncmp);
1223# endif 1284# endif
1224#elif defined GNULIB_POSIXCHECK 1285#elif defined GNULIB_POSIXCHECK
1225# undef wcsncmp
1226# if HAVE_RAW_DECL_WCSNCMP 1286# if HAVE_RAW_DECL_WCSNCMP
1227_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - " 1287_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1228 "use gnulib module wcsncmp for portability"); 1288 "use gnulib module wcsncmp for portability");
@@ -1236,13 +1296,12 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1236 namespace, not in the global namespace. So, force a declaration in 1296 namespace, not in the global namespace. So, force a declaration in
1237 the global namespace. */ 1297 the global namespace. */
1238# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus) 1298# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
1239_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2) 1299_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2),
1240 _GL_ATTRIBUTE_PURE); 1300 _GL_ATTRIBUTE_PURE);
1241# endif 1301# endif
1242_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)); 1302_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1243_GL_CXXALIASWARN (wcscasecmp); 1303_GL_CXXALIASWARN (wcscasecmp);
1244#elif defined GNULIB_POSIXCHECK 1304#elif defined GNULIB_POSIXCHECK
1245# undef wcscasecmp
1246# if HAVE_RAW_DECL_WCSCASECMP 1305# if HAVE_RAW_DECL_WCSCASECMP
1247_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - " 1306_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1248 "use gnulib module wcscasecmp for portability"); 1307 "use gnulib module wcscasecmp for portability");
@@ -1257,14 +1316,13 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1257 the global namespace. */ 1316 the global namespace. */
1258# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus) 1317# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
1259_GL_FUNCDECL_SYS (wcsncasecmp, int, 1318_GL_FUNCDECL_SYS (wcsncasecmp, int,
1260 (const wchar_t *s1, const wchar_t *s2, size_t n) 1319 (const wchar_t *s1, const wchar_t *s2, size_t n),
1261 _GL_ATTRIBUTE_PURE); 1320 _GL_ATTRIBUTE_PURE);
1262# endif 1321# endif
1263_GL_CXXALIAS_SYS (wcsncasecmp, int, 1322_GL_CXXALIAS_SYS (wcsncasecmp, int,
1264 (const wchar_t *s1, const wchar_t *s2, size_t n)); 1323 (const wchar_t *s1, const wchar_t *s2, size_t n));
1265_GL_CXXALIASWARN (wcsncasecmp); 1324_GL_CXXALIASWARN (wcsncasecmp);
1266#elif defined GNULIB_POSIXCHECK 1325#elif defined GNULIB_POSIXCHECK
1267# undef wcsncasecmp
1268# if HAVE_RAW_DECL_WCSNCASECMP 1326# if HAVE_RAW_DECL_WCSNCASECMP
1269_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - " 1327_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1270 "use gnulib module wcsncasecmp for portability"); 1328 "use gnulib module wcsncasecmp for portability");
@@ -1276,14 +1334,13 @@ _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1276 category of the current locale. */ 1334 category of the current locale. */
1277#if @GNULIB_WCSCOLL@ 1335#if @GNULIB_WCSCOLL@
1278# if !@HAVE_WCSCOLL@ 1336# if !@HAVE_WCSCOLL@
1279_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); 1337_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2), );
1280# endif 1338# endif
1281_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); 1339_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1282# if __GLIBC__ >= 2 1340# if __GLIBC__ >= 2
1283_GL_CXXALIASWARN (wcscoll); 1341_GL_CXXALIASWARN (wcscoll);
1284# endif 1342# endif
1285#elif defined GNULIB_POSIXCHECK 1343#elif defined GNULIB_POSIXCHECK
1286# undef wcscoll
1287# if HAVE_RAW_DECL_WCSCOLL 1344# if HAVE_RAW_DECL_WCSCOLL
1288_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - " 1345_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1289 "use gnulib module wcscoll for portability"); 1346 "use gnulib module wcscoll for portability");
@@ -1297,7 +1354,7 @@ _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1297#if @GNULIB_WCSXFRM@ 1354#if @GNULIB_WCSXFRM@
1298# if !@HAVE_WCSXFRM@ 1355# if !@HAVE_WCSXFRM@
1299_GL_FUNCDECL_SYS (wcsxfrm, size_t, 1356_GL_FUNCDECL_SYS (wcsxfrm, size_t,
1300 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); 1357 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n), );
1301# endif 1358# endif
1302_GL_CXXALIAS_SYS (wcsxfrm, size_t, 1359_GL_CXXALIAS_SYS (wcsxfrm, size_t,
1303 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); 1360 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
@@ -1305,7 +1362,6 @@ _GL_CXXALIAS_SYS (wcsxfrm, size_t,
1305_GL_CXXALIASWARN (wcsxfrm); 1362_GL_CXXALIASWARN (wcsxfrm);
1306# endif 1363# endif
1307#elif defined GNULIB_POSIXCHECK 1364#elif defined GNULIB_POSIXCHECK
1308# undef wcsxfrm
1309# if HAVE_RAW_DECL_WCSXFRM 1365# if HAVE_RAW_DECL_WCSXFRM
1310_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - " 1366_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1311 "use gnulib module wcsxfrm for portability"); 1367 "use gnulib module wcsxfrm for portability");
@@ -1325,15 +1381,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:: 1381/* 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 1382 namespace, not in the global namespace. So, force a declaration in
1327 the global namespace. */ 1383 the global namespace. */
1328# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >= 11 1384# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) \
1385 || (__GNUC__ >= 11 && !defined __clang__)
1329# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1386# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1330_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1387_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1331 (const wchar_t *s) 1388 (const wchar_t *s),
1332 _GL_ATTRIBUTE_NOTHROW 1389 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1333 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1390 _GL_ATTRIBUTE_NOTHROW;
1334# else 1391# else
1335_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1392_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1336 (const wchar_t *s) 1393 (const wchar_t *s),
1337 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1394 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1338# endif 1395# endif
1339# endif 1396# endif
@@ -1341,21 +1398,20 @@ _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1341# endif 1398# endif
1342_GL_CXXALIASWARN (wcsdup); 1399_GL_CXXALIASWARN (wcsdup);
1343#else 1400#else
1344# if __GNUC__ >= 11 && !defined wcsdup 1401# if (__GNUC__ >= 11 && !defined __clang__) && !defined wcsdup
1345/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */ 1402/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
1346# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1403# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1347_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1404_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1348 (const wchar_t *s) 1405 (const wchar_t *s),
1349 _GL_ATTRIBUTE_NOTHROW 1406 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1350 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1407 _GL_ATTRIBUTE_NOTHROW;
1351# else 1408# else
1352_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1409_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1353 (const wchar_t *s) 1410 (const wchar_t *s),
1354 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1411 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1355# endif 1412# endif
1356# endif 1413# endif
1357# if defined GNULIB_POSIXCHECK 1414# if defined GNULIB_POSIXCHECK
1358# undef wcsdup
1359# if HAVE_RAW_DECL_WCSDUP 1415# if HAVE_RAW_DECL_WCSDUP
1360_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " 1416_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1361 "use gnulib module wcsdup for portability"); 1417 "use gnulib module wcsdup for portability");
@@ -1373,12 +1429,12 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1373# else 1429# else
1374# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 1430# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1375_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1431_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1376 (const wchar_t *s) 1432 (const wchar_t *s),
1377 _GL_ATTRIBUTE_NOTHROW 1433 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1378 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1434 _GL_ATTRIBUTE_NOTHROW;
1379# else 1435# else
1380_GL_FUNCDECL_SYS (wcsdup, wchar_t *, 1436_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
1381 (const wchar_t *s) 1437 (const wchar_t *s),
1382 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 1438 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1383# endif 1439# endif
1384# if @HAVE_DECL_WCSDUP@ 1440# if @HAVE_DECL_WCSDUP@
@@ -1395,7 +1451,7 @@ _GL_CXXALIASWARN (wcsdup);
1395/* Find the first occurrence of WC in WCS. */ 1451/* Find the first occurrence of WC in WCS. */
1396#if @GNULIB_WCSCHR@ 1452#if @GNULIB_WCSCHR@
1397# if !@HAVE_WCSCHR@ 1453# if !@HAVE_WCSCHR@
1398_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc) 1454_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
1399 _GL_ATTRIBUTE_PURE); 1455 _GL_ATTRIBUTE_PURE);
1400# endif 1456# endif
1401 /* On some systems, this function is defined as an overloaded function: 1457 /* On some systems, this function is defined as an overloaded function:
@@ -1407,14 +1463,14 @@ _GL_CXXALIAS_SYS_CAST2 (wcschr,
1407 wchar_t *, (const wchar_t *, wchar_t), 1463 wchar_t *, (const wchar_t *, wchar_t),
1408 const wchar_t *, (const wchar_t *, wchar_t)); 1464 const wchar_t *, (const wchar_t *, wchar_t));
1409# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1465# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1410 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1466 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1467 && !defined __clang__
1411_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc)); 1468_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)); 1469_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1413# elif __GLIBC__ >= 2 1470# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1414_GL_CXXALIASWARN (wcschr); 1471_GL_CXXALIASWARN (wcschr);
1415# endif 1472# endif
1416#elif defined GNULIB_POSIXCHECK 1473#elif defined GNULIB_POSIXCHECK
1417# undef wcschr
1418# if HAVE_RAW_DECL_WCSCHR 1474# if HAVE_RAW_DECL_WCSCHR
1419_GL_WARN_ON_USE (wcschr, "wcschr is unportable - " 1475_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1420 "use gnulib module wcschr for portability"); 1476 "use gnulib module wcschr for portability");
@@ -1425,7 +1481,7 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1425/* Find the last occurrence of WC in WCS. */ 1481/* Find the last occurrence of WC in WCS. */
1426#if @GNULIB_WCSRCHR@ 1482#if @GNULIB_WCSRCHR@
1427# if !@HAVE_WCSRCHR@ 1483# if !@HAVE_WCSRCHR@
1428_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc) 1484_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc),
1429 _GL_ATTRIBUTE_PURE); 1485 _GL_ATTRIBUTE_PURE);
1430# endif 1486# endif
1431 /* On some systems, this function is defined as an overloaded function: 1487 /* On some systems, this function is defined as an overloaded function:
@@ -1437,14 +1493,14 @@ _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1437 wchar_t *, (const wchar_t *, wchar_t), 1493 wchar_t *, (const wchar_t *, wchar_t),
1438 const wchar_t *, (const wchar_t *, wchar_t)); 1494 const wchar_t *, (const wchar_t *, wchar_t));
1439# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1495# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1440 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1496 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1497 && !defined __clang__
1441_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc)); 1498_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)); 1499_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1443# elif __GLIBC__ >= 2 1500# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1444_GL_CXXALIASWARN (wcsrchr); 1501_GL_CXXALIASWARN (wcsrchr);
1445# endif 1502# endif
1446#elif defined GNULIB_POSIXCHECK 1503#elif defined GNULIB_POSIXCHECK
1447# undef wcsrchr
1448# if HAVE_RAW_DECL_WCSRCHR 1504# if HAVE_RAW_DECL_WCSRCHR
1449_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - " 1505_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1450 "use gnulib module wcsrchr for portability"); 1506 "use gnulib module wcsrchr for portability");
@@ -1456,7 +1512,7 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1456 of wide characters not in REJECT. */ 1512 of wide characters not in REJECT. */
1457#if @GNULIB_WCSCSPN@ 1513#if @GNULIB_WCSCSPN@
1458# if !@HAVE_WCSCSPN@ 1514# if !@HAVE_WCSCSPN@
1459_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject) 1515_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject),
1460 _GL_ATTRIBUTE_PURE); 1516 _GL_ATTRIBUTE_PURE);
1461# endif 1517# endif
1462_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); 1518_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
@@ -1464,7 +1520,6 @@ _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1464_GL_CXXALIASWARN (wcscspn); 1520_GL_CXXALIASWARN (wcscspn);
1465# endif 1521# endif
1466#elif defined GNULIB_POSIXCHECK 1522#elif defined GNULIB_POSIXCHECK
1467# undef wcscspn
1468# if HAVE_RAW_DECL_WCSCSPN 1523# if HAVE_RAW_DECL_WCSCSPN
1469_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - " 1524_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1470 "use gnulib module wcscspn for portability"); 1525 "use gnulib module wcscspn for portability");
@@ -1476,7 +1531,7 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1476 of wide characters in ACCEPT. */ 1531 of wide characters in ACCEPT. */
1477#if @GNULIB_WCSSPN@ 1532#if @GNULIB_WCSSPN@
1478# if !@HAVE_WCSSPN@ 1533# if !@HAVE_WCSSPN@
1479_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept) 1534_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept),
1480 _GL_ATTRIBUTE_PURE); 1535 _GL_ATTRIBUTE_PURE);
1481# endif 1536# endif
1482_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); 1537_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
@@ -1484,7 +1539,6 @@ _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1484_GL_CXXALIASWARN (wcsspn); 1539_GL_CXXALIASWARN (wcsspn);
1485# endif 1540# endif
1486#elif defined GNULIB_POSIXCHECK 1541#elif defined GNULIB_POSIXCHECK
1487# undef wcsspn
1488# if HAVE_RAW_DECL_WCSSPN 1542# if HAVE_RAW_DECL_WCSSPN
1489_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - " 1543_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1490 "use gnulib module wcsspn for portability"); 1544 "use gnulib module wcsspn for portability");
@@ -1496,7 +1550,7 @@ _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1496#if @GNULIB_WCSPBRK@ 1550#if @GNULIB_WCSPBRK@
1497# if !@HAVE_WCSPBRK@ 1551# if !@HAVE_WCSPBRK@
1498_GL_FUNCDECL_SYS (wcspbrk, wchar_t *, 1552_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1499 (const wchar_t *wcs, const wchar_t *accept) 1553 (const wchar_t *wcs, const wchar_t *accept),
1500 _GL_ATTRIBUTE_PURE); 1554 _GL_ATTRIBUTE_PURE);
1501# endif 1555# endif
1502 /* On some systems, this function is defined as an overloaded function: 1556 /* On some systems, this function is defined as an overloaded function:
@@ -1508,16 +1562,16 @@ _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1508 wchar_t *, (const wchar_t *, const wchar_t *), 1562 wchar_t *, (const wchar_t *, const wchar_t *),
1509 const wchar_t *, (const wchar_t *, const wchar_t *)); 1563 const wchar_t *, (const wchar_t *, const wchar_t *));
1510# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1564# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1511 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1565 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1566 && !defined __clang__
1512_GL_CXXALIASWARN1 (wcspbrk, wchar_t *, 1567_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1513 (wchar_t *wcs, const wchar_t *accept)); 1568 (wchar_t *wcs, const wchar_t *accept));
1514_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, 1569_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1515 (const wchar_t *wcs, const wchar_t *accept)); 1570 (const wchar_t *wcs, const wchar_t *accept));
1516# elif __GLIBC__ >= 2 1571# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1517_GL_CXXALIASWARN (wcspbrk); 1572_GL_CXXALIASWARN (wcspbrk);
1518# endif 1573# endif
1519#elif defined GNULIB_POSIXCHECK 1574#elif defined GNULIB_POSIXCHECK
1520# undef wcspbrk
1521# if HAVE_RAW_DECL_WCSPBRK 1575# if HAVE_RAW_DECL_WCSPBRK
1522_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - " 1576_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1523 "use gnulib module wcspbrk for portability"); 1577 "use gnulib module wcspbrk for portability");
@@ -1534,7 +1588,7 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1534# endif 1588# endif
1535_GL_FUNCDECL_RPL (wcsstr, wchar_t *, 1589_GL_FUNCDECL_RPL (wcsstr, wchar_t *,
1536 (const wchar_t *restrict haystack, 1590 (const wchar_t *restrict haystack,
1537 const wchar_t *restrict needle) 1591 const wchar_t *restrict needle),
1538 _GL_ATTRIBUTE_PURE); 1592 _GL_ATTRIBUTE_PURE);
1539_GL_CXXALIAS_RPL (wcsstr, wchar_t *, 1593_GL_CXXALIAS_RPL (wcsstr, wchar_t *,
1540 (const wchar_t *restrict haystack, 1594 (const wchar_t *restrict haystack,
@@ -1543,7 +1597,7 @@ _GL_CXXALIAS_RPL (wcsstr, wchar_t *,
1543# if !@HAVE_WCSSTR@ 1597# if !@HAVE_WCSSTR@
1544_GL_FUNCDECL_SYS (wcsstr, wchar_t *, 1598_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1545 (const wchar_t *restrict haystack, 1599 (const wchar_t *restrict haystack,
1546 const wchar_t *restrict needle) 1600 const wchar_t *restrict needle),
1547 _GL_ATTRIBUTE_PURE); 1601 _GL_ATTRIBUTE_PURE);
1548# endif 1602# endif
1549 /* On some systems, this function is defined as an overloaded function: 1603 /* On some systems, this function is defined as an overloaded function:
@@ -1558,18 +1612,18 @@ _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1558 (const wchar_t *restrict, const wchar_t *restrict)); 1612 (const wchar_t *restrict, const wchar_t *restrict));
1559# endif 1613# endif
1560# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ 1614# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1561 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 1615 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
1616 && !defined __clang__
1562_GL_CXXALIASWARN1 (wcsstr, wchar_t *, 1617_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1563 (wchar_t *restrict haystack, 1618 (wchar_t *restrict haystack,
1564 const wchar_t *restrict needle)); 1619 const wchar_t *restrict needle));
1565_GL_CXXALIASWARN1 (wcsstr, const wchar_t *, 1620_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1566 (const wchar_t *restrict haystack, 1621 (const wchar_t *restrict haystack,
1567 const wchar_t *restrict needle)); 1622 const wchar_t *restrict needle));
1568# elif __GLIBC__ >= 2 1623# elif __GLIBC__ >= 2 && !defined __CORRECT_ISO_CPP_WCHAR_H_PROTO
1569_GL_CXXALIASWARN (wcsstr); 1624_GL_CXXALIASWARN (wcsstr);
1570# endif 1625# endif
1571#elif defined GNULIB_POSIXCHECK 1626#elif defined GNULIB_POSIXCHECK
1572# undef wcsstr
1573# if HAVE_RAW_DECL_WCSSTR 1627# if HAVE_RAW_DECL_WCSSTR
1574_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - " 1628_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1575 "use gnulib module wcsstr for portability"); 1629 "use gnulib module wcsstr for portability");
@@ -1586,7 +1640,7 @@ _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1586# endif 1640# endif
1587_GL_FUNCDECL_RPL (wcstok, wchar_t *, 1641_GL_FUNCDECL_RPL (wcstok, wchar_t *,
1588 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1642 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1589 wchar_t **restrict ptr)); 1643 wchar_t **restrict ptr), );
1590_GL_CXXALIAS_RPL (wcstok, wchar_t *, 1644_GL_CXXALIAS_RPL (wcstok, wchar_t *,
1591 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1645 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1592 wchar_t **restrict ptr)); 1646 wchar_t **restrict ptr));
@@ -1594,7 +1648,7 @@ _GL_CXXALIAS_RPL (wcstok, wchar_t *,
1594# if !@HAVE_WCSTOK@ 1648# if !@HAVE_WCSTOK@
1595_GL_FUNCDECL_SYS (wcstok, wchar_t *, 1649_GL_FUNCDECL_SYS (wcstok, wchar_t *,
1596 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1650 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1597 wchar_t **restrict ptr)); 1651 wchar_t **restrict ptr), );
1598# endif 1652# endif
1599_GL_CXXALIAS_SYS (wcstok, wchar_t *, 1653_GL_CXXALIAS_SYS (wcstok, wchar_t *,
1600 (wchar_t *restrict wcs, const wchar_t *restrict delim, 1654 (wchar_t *restrict wcs, const wchar_t *restrict delim,
@@ -1604,7 +1658,6 @@ _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1604_GL_CXXALIASWARN (wcstok); 1658_GL_CXXALIASWARN (wcstok);
1605# endif 1659# endif
1606#elif defined GNULIB_POSIXCHECK 1660#elif defined GNULIB_POSIXCHECK
1607# undef wcstok
1608# if HAVE_RAW_DECL_WCSTOK 1661# if HAVE_RAW_DECL_WCSTOK
1609_GL_WARN_ON_USE (wcstok, "wcstok is unportable - " 1662_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1610 "use gnulib module wcstok for portability"); 1663 "use gnulib module wcstok for portability");
@@ -1620,12 +1673,12 @@ _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1620# undef wcswidth 1673# undef wcswidth
1621# define wcswidth rpl_wcswidth 1674# define wcswidth rpl_wcswidth
1622# endif 1675# endif
1623_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n) 1676_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n),
1624 _GL_ATTRIBUTE_PURE); 1677 _GL_ATTRIBUTE_PURE);
1625_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n)); 1678_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1626# else 1679# else
1627# if !@HAVE_WCSWIDTH@ 1680# if !@HAVE_WCSWIDTH@
1628_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n) 1681_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n),
1629 _GL_ATTRIBUTE_PURE); 1682 _GL_ATTRIBUTE_PURE);
1630# endif 1683# endif
1631_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); 1684_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
@@ -1634,7 +1687,6 @@ _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1634_GL_CXXALIASWARN (wcswidth); 1687_GL_CXXALIASWARN (wcswidth);
1635# endif 1688# endif
1636#elif defined GNULIB_POSIXCHECK 1689#elif defined GNULIB_POSIXCHECK
1637# undef wcswidth
1638# if HAVE_RAW_DECL_WCSWIDTH 1690# if HAVE_RAW_DECL_WCSWIDTH
1639_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - " 1691_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1640 "use gnulib module wcswidth for portability"); 1692 "use gnulib module wcswidth for portability");
@@ -1653,7 +1705,7 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1653_GL_FUNCDECL_RPL (wcsftime, size_t, 1705_GL_FUNCDECL_RPL (wcsftime, size_t,
1654 (wchar_t *restrict __buf, size_t __bufsize, 1706 (wchar_t *restrict __buf, size_t __bufsize,
1655 const wchar_t *restrict __fmt, 1707 const wchar_t *restrict __fmt,
1656 const struct tm *restrict __tp) 1708 const struct tm *restrict __tp),
1657 _GL_ARG_NONNULL ((1, 3, 4))); 1709 _GL_ARG_NONNULL ((1, 3, 4)));
1658_GL_CXXALIAS_RPL (wcsftime, size_t, 1710_GL_CXXALIAS_RPL (wcsftime, size_t,
1659 (wchar_t *restrict __buf, size_t __bufsize, 1711 (wchar_t *restrict __buf, size_t __bufsize,
@@ -1664,7 +1716,7 @@ _GL_CXXALIAS_RPL (wcsftime, size_t,
1664_GL_FUNCDECL_SYS (wcsftime, size_t, 1716_GL_FUNCDECL_SYS (wcsftime, size_t,
1665 (wchar_t *restrict __buf, size_t __bufsize, 1717 (wchar_t *restrict __buf, size_t __bufsize,
1666 const wchar_t *restrict __fmt, 1718 const wchar_t *restrict __fmt,
1667 const struct tm *restrict __tp) 1719 const struct tm *restrict __tp),
1668 _GL_ARG_NONNULL ((1, 3, 4))); 1720 _GL_ARG_NONNULL ((1, 3, 4)));
1669# endif 1721# endif
1670_GL_CXXALIAS_SYS (wcsftime, size_t, 1722_GL_CXXALIAS_SYS (wcsftime, size_t,
@@ -1676,7 +1728,6 @@ _GL_CXXALIAS_SYS (wcsftime, size_t,
1676_GL_CXXALIASWARN (wcsftime); 1728_GL_CXXALIASWARN (wcsftime);
1677# endif 1729# endif
1678#elif defined GNULIB_POSIXCHECK 1730#elif defined GNULIB_POSIXCHECK
1679# undef wcsftime
1680# if HAVE_RAW_DECL_WCSFTIME 1731# if HAVE_RAW_DECL_WCSFTIME
1681_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - " 1732_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1682 "use gnulib module wcsftime for portability"); 1733 "use gnulib module wcsftime for portability");
@@ -1698,7 +1749,7 @@ _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1698 Possible errno values include: 1749 Possible errno values include:
1699 - ERANGE if SIZE is too small. 1750 - ERANGE if SIZE is too small.
1700 - ENOMEM if the memory could no be allocated. */ 1751 - ENOMEM if the memory could no be allocated. */
1701_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size)); 1752_GL_FUNCDECL_SYS (wgetcwd, wchar_t *, (wchar_t *buf, size_t size), );
1702#endif 1753#endif
1703 1754
1704 1755