VirtualBox

source: kBuild/trunk/src/grep/lib/wchar.in.h@ 3646

Last change on this file since 3646 was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:eol-style set to native
File size: 40.8 KB
Line 
1/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
2
3 Copyright (C) 2007-2021 Free Software Foundation, Inc.
4
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
9
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17
18/* Written by Eric Blake. */
19
20/*
21 * ISO C 99 <wchar.h> for platforms that have issues.
22 * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html>
23 *
24 * For now, this just ensures proper prerequisite inclusion order and
25 * the declaration of wcwidth().
26 */
27
28#if __GNUC__ >= 3
29@PRAGMA_SYSTEM_HEADER@
30#endif
31@PRAGMA_COLUMNS@
32
33#if (((defined __need_mbstate_t || defined __need_wint_t) \
34 && !defined __MINGW32__) \
35 || (defined __hpux \
36 && ((defined _INTTYPES_INCLUDED \
37 && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
38 || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
39 || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
40 || defined _GL_ALREADY_INCLUDING_WCHAR_H)
41/* Special invocation convention:
42 - Inside glibc and uClibc header files, but not MinGW.
43 - On HP-UX 11.00 we have a sequence of nested includes
44 <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
45 once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
46 and once directly. In both situations 'wint_t' is not yet defined,
47 therefore we cannot provide the function overrides; instead include only
48 the system's <wchar.h>.
49 - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
50 <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
51 - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
52 the latter includes <wchar.h>. But here, we have no way to detect whether
53 <wctype.h> is completely included or is still being included. */
54
55#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
56
57#else
58/* Normal invocation convention. */
59
60#ifndef _@GUARD_PREFIX@_WCHAR_H
61
62#define _GL_ALREADY_INCLUDING_WCHAR_H
63
64#if @HAVE_FEATURES_H@
65# include <features.h> /* for __GLIBC__ */
66#endif
67
68/* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
69 by <stddef.h>.
70 But avoid namespace pollution on glibc systems. */
71#if !(defined __GLIBC__ && !defined __UCLIBC__)
72# include <stddef.h>
73#endif
74
75/* Get free(). */
76#include <stdlib.h>
77
78/* Include the original <wchar.h> if it exists.
79 Some builds of uClibc lack it. */
80/* The include_next requires a split double-inclusion guard. */
81#if @HAVE_WCHAR_H@
82# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
83#endif
84
85#undef _GL_ALREADY_INCLUDING_WCHAR_H
86
87#ifndef _@GUARD_PREFIX@_WCHAR_H
88#define _@GUARD_PREFIX@_WCHAR_H
89
90/* The __attribute__ feature is available in gcc versions 2.5 and later.
91 The attribute __pure__ was added in gcc 2.96. */
92#ifndef _GL_ATTRIBUTE_PURE
93# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
94# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
95# else
96# define _GL_ATTRIBUTE_PURE /* empty */
97# endif
98#endif
99
100/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
101
102/* The definition of _GL_ARG_NONNULL is copied here. */
103
104/* The definition of _GL_WARN_ON_USE is copied here. */
105
106
107/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
108#if !@HAVE_WINT_T@ && !defined wint_t
109# define wint_t int
110# ifndef WEOF
111# define WEOF -1
112# endif
113#else
114/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
115 <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
116 wint_t must be "unchanged by default argument promotions". Override it. */
117# if @GNULIBHEADERS_OVERRIDE_WINT_T@
118# if !GNULIB_defined_wint_t
119# if @HAVE_CRTDEFS_H@
120# include <crtdefs.h>
121# else
122# include <stddef.h>
123# endif
124typedef unsigned int rpl_wint_t;
125# undef wint_t
126# define wint_t rpl_wint_t
127# define GNULIB_defined_wint_t 1
128# endif
129# endif
130# ifndef WEOF
131# define WEOF ((wint_t) -1)
132# endif
133#endif
134
135
136/* Override mbstate_t if it is too small.
137 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
138 implementing mbrtowc for encodings like UTF-8.
139 On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
140 large enough and overriding it would cause problems in C++ mode. */
141#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
142# if !GNULIB_defined_mbstate_t
143# if !(defined _AIX || defined _MSC_VER)
144typedef int rpl_mbstate_t;
145# undef mbstate_t
146# define mbstate_t rpl_mbstate_t
147# endif
148# define GNULIB_defined_mbstate_t 1
149# endif
150#endif
151
152
153/* Convert a single-byte character to a wide character. */
154#if @GNULIB_BTOWC@
155# if @REPLACE_BTOWC@
156# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
157# undef btowc
158# define btowc rpl_btowc
159# endif
160_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
161_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
162# else
163# if !@HAVE_BTOWC@
164_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
165# endif
166/* Need to cast, because on mingw, the return type is 'unsigned short'. */
167_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
168# endif
169# if __GLIBC__ >= 2
170_GL_CXXALIASWARN (btowc);
171# endif
172#elif defined GNULIB_POSIXCHECK
173# undef btowc
174# if HAVE_RAW_DECL_BTOWC
175_GL_WARN_ON_USE (btowc, "btowc is unportable - "
176 "use gnulib module btowc for portability");
177# endif
178#endif
179
180
181/* Convert a wide character to a single-byte character. */
182#if @GNULIB_WCTOB@
183# if @REPLACE_WCTOB@
184# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
185# undef wctob
186# define wctob rpl_wctob
187# endif
188_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
189_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
190# else
191# if !defined wctob && !@HAVE_DECL_WCTOB@
192/* wctob is provided by gnulib, or wctob exists but is not declared. */
193_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
194# endif
195_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
196# endif
197# if __GLIBC__ >= 2
198_GL_CXXALIASWARN (wctob);
199# endif
200#elif defined GNULIB_POSIXCHECK
201# undef wctob
202# if HAVE_RAW_DECL_WCTOB
203_GL_WARN_ON_USE (wctob, "wctob is unportable - "
204 "use gnulib module wctob for portability");
205# endif
206#endif
207
208
209/* Test whether *PS is in the initial state. */
210#if @GNULIB_MBSINIT@
211# if @REPLACE_MBSINIT@
212# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
213# undef mbsinit
214# define mbsinit rpl_mbsinit
215# endif
216_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
217_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
218# else
219# if !@HAVE_MBSINIT@
220_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
221# endif
222_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
223# endif
224# if __GLIBC__ >= 2
225_GL_CXXALIASWARN (mbsinit);
226# endif
227#elif defined GNULIB_POSIXCHECK
228# undef mbsinit
229# if HAVE_RAW_DECL_MBSINIT
230_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
231 "use gnulib module mbsinit for portability");
232# endif
233#endif
234
235
236/* Convert a multibyte character to a wide character. */
237#if @GNULIB_MBRTOWC@
238# if @REPLACE_MBRTOWC@
239# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
240# undef mbrtowc
241# define mbrtowc rpl_mbrtowc
242# endif
243_GL_FUNCDECL_RPL (mbrtowc, size_t,
244 (wchar_t *restrict pwc, const char *restrict s, size_t n,
245 mbstate_t *restrict ps));
246_GL_CXXALIAS_RPL (mbrtowc, size_t,
247 (wchar_t *restrict pwc, const char *restrict s, size_t n,
248 mbstate_t *restrict ps));
249# else
250# if !@HAVE_MBRTOWC@
251_GL_FUNCDECL_SYS (mbrtowc, size_t,
252 (wchar_t *restrict pwc, const char *restrict s, size_t n,
253 mbstate_t *restrict ps));
254# endif
255_GL_CXXALIAS_SYS (mbrtowc, size_t,
256 (wchar_t *restrict pwc, const char *restrict s, size_t n,
257 mbstate_t *restrict ps));
258# endif
259# if __GLIBC__ >= 2
260_GL_CXXALIASWARN (mbrtowc);
261# endif
262#elif defined GNULIB_POSIXCHECK
263# undef mbrtowc
264# if HAVE_RAW_DECL_MBRTOWC
265_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
266 "use gnulib module mbrtowc for portability");
267# endif
268#endif
269
270
271/* Recognize a multibyte character. */
272#if @GNULIB_MBRLEN@
273# if @REPLACE_MBRLEN@
274# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
275# undef mbrlen
276# define mbrlen rpl_mbrlen
277# endif
278_GL_FUNCDECL_RPL (mbrlen, size_t,
279 (const char *restrict s, size_t n, mbstate_t *restrict ps));
280_GL_CXXALIAS_RPL (mbrlen, size_t,
281 (const char *restrict s, size_t n, mbstate_t *restrict ps));
282# else
283# if !@HAVE_MBRLEN@
284_GL_FUNCDECL_SYS (mbrlen, size_t,
285 (const char *restrict s, size_t n, mbstate_t *restrict ps));
286# endif
287_GL_CXXALIAS_SYS (mbrlen, size_t,
288 (const char *restrict s, size_t n, mbstate_t *restrict ps));
289# endif
290# if __GLIBC__ >= 2
291_GL_CXXALIASWARN (mbrlen);
292# endif
293#elif defined GNULIB_POSIXCHECK
294# undef mbrlen
295# if HAVE_RAW_DECL_MBRLEN
296_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
297 "use gnulib module mbrlen for portability");
298# endif
299#endif
300
301
302/* Convert a string to a wide string. */
303#if @GNULIB_MBSRTOWCS@
304# if @REPLACE_MBSRTOWCS@
305# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
306# undef mbsrtowcs
307# define mbsrtowcs rpl_mbsrtowcs
308# endif
309_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
310 (wchar_t *restrict dest,
311 const char **restrict srcp, size_t len,
312 mbstate_t *restrict ps)
313 _GL_ARG_NONNULL ((2)));
314_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
315 (wchar_t *restrict dest,
316 const char **restrict srcp, size_t len,
317 mbstate_t *restrict ps));
318# else
319# if !@HAVE_MBSRTOWCS@
320_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
321 (wchar_t *restrict dest,
322 const char **restrict srcp, size_t len,
323 mbstate_t *restrict ps)
324 _GL_ARG_NONNULL ((2)));
325# endif
326_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
327 (wchar_t *restrict dest,
328 const char **restrict srcp, size_t len,
329 mbstate_t *restrict ps));
330# endif
331# if __GLIBC__ >= 2
332_GL_CXXALIASWARN (mbsrtowcs);
333# endif
334#elif defined GNULIB_POSIXCHECK
335# undef mbsrtowcs
336# if HAVE_RAW_DECL_MBSRTOWCS
337_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
338 "use gnulib module mbsrtowcs for portability");
339# endif
340#endif
341
342
343/* Convert a string to a wide string. */
344#if @GNULIB_MBSNRTOWCS@
345# if @REPLACE_MBSNRTOWCS@
346# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
347# undef mbsnrtowcs
348# define mbsnrtowcs rpl_mbsnrtowcs
349# endif
350_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
351 (wchar_t *restrict dest,
352 const char **restrict srcp, size_t srclen, size_t len,
353 mbstate_t *restrict ps)
354 _GL_ARG_NONNULL ((2)));
355_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
356 (wchar_t *restrict dest,
357 const char **restrict srcp, size_t srclen, size_t len,
358 mbstate_t *restrict ps));
359# else
360# if !@HAVE_MBSNRTOWCS@
361_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
362 (wchar_t *restrict dest,
363 const char **restrict srcp, size_t srclen, size_t len,
364 mbstate_t *restrict ps)
365 _GL_ARG_NONNULL ((2)));
366# endif
367_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
368 (wchar_t *restrict dest,
369 const char **restrict srcp, size_t srclen, size_t len,
370 mbstate_t *restrict ps));
371# endif
372_GL_CXXALIASWARN (mbsnrtowcs);
373#elif defined GNULIB_POSIXCHECK
374# undef mbsnrtowcs
375# if HAVE_RAW_DECL_MBSNRTOWCS
376_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
377 "use gnulib module mbsnrtowcs for portability");
378# endif
379#endif
380
381
382/* Convert a wide character to a multibyte character. */
383#if @GNULIB_WCRTOMB@
384# if @REPLACE_WCRTOMB@
385# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
386# undef wcrtomb
387# define wcrtomb rpl_wcrtomb
388# endif
389_GL_FUNCDECL_RPL (wcrtomb, size_t,
390 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
391_GL_CXXALIAS_RPL (wcrtomb, size_t,
392 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
393# else
394# if !@HAVE_WCRTOMB@
395_GL_FUNCDECL_SYS (wcrtomb, size_t,
396 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
397# endif
398_GL_CXXALIAS_SYS (wcrtomb, size_t,
399 (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
400# endif
401# if __GLIBC__ >= 2
402_GL_CXXALIASWARN (wcrtomb);
403# endif
404#elif defined GNULIB_POSIXCHECK
405# undef wcrtomb
406# if HAVE_RAW_DECL_WCRTOMB
407_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
408 "use gnulib module wcrtomb for portability");
409# endif
410#endif
411
412
413/* Convert a wide string to a string. */
414#if @GNULIB_WCSRTOMBS@
415# if @REPLACE_WCSRTOMBS@
416# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
417# undef wcsrtombs
418# define wcsrtombs rpl_wcsrtombs
419# endif
420_GL_FUNCDECL_RPL (wcsrtombs, size_t,
421 (char *restrict dest, const wchar_t **restrict srcp,
422 size_t len,
423 mbstate_t *restrict ps)
424 _GL_ARG_NONNULL ((2)));
425_GL_CXXALIAS_RPL (wcsrtombs, size_t,
426 (char *restrict dest, const wchar_t **restrict srcp,
427 size_t len,
428 mbstate_t *restrict ps));
429# else
430# if !@HAVE_WCSRTOMBS@
431_GL_FUNCDECL_SYS (wcsrtombs, size_t,
432 (char *restrict dest, const wchar_t **restrict srcp,
433 size_t len,
434 mbstate_t *restrict ps)
435 _GL_ARG_NONNULL ((2)));
436# endif
437_GL_CXXALIAS_SYS (wcsrtombs, size_t,
438 (char *restrict dest, const wchar_t **restrict srcp,
439 size_t len,
440 mbstate_t *restrict ps));
441# endif
442# if __GLIBC__ >= 2
443_GL_CXXALIASWARN (wcsrtombs);
444# endif
445#elif defined GNULIB_POSIXCHECK
446# undef wcsrtombs
447# if HAVE_RAW_DECL_WCSRTOMBS
448_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
449 "use gnulib module wcsrtombs for portability");
450# endif
451#endif
452
453
454/* Convert a wide string to a string. */
455#if @GNULIB_WCSNRTOMBS@
456# if @REPLACE_WCSNRTOMBS@
457# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
458# undef wcsnrtombs
459# define wcsnrtombs rpl_wcsnrtombs
460# endif
461_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
462 (char *restrict dest,
463 const wchar_t **restrict srcp, size_t srclen,
464 size_t len,
465 mbstate_t *restrict ps)
466 _GL_ARG_NONNULL ((2)));
467_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
468 (char *restrict dest,
469 const wchar_t **restrict srcp, size_t srclen,
470 size_t len,
471 mbstate_t *restrict ps));
472# else
473# if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
474_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
475 (char *restrict dest,
476 const wchar_t **restrict srcp, size_t srclen,
477 size_t len,
478 mbstate_t *restrict ps)
479 _GL_ARG_NONNULL ((2)));
480# endif
481_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
482 (char *restrict dest,
483 const wchar_t **restrict srcp, size_t srclen,
484 size_t len,
485 mbstate_t *restrict ps));
486# endif
487# if __GLIBC__ >= 2
488_GL_CXXALIASWARN (wcsnrtombs);
489# endif
490#elif defined GNULIB_POSIXCHECK
491# undef wcsnrtombs
492# if HAVE_RAW_DECL_WCSNRTOMBS
493_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
494 "use gnulib module wcsnrtombs for portability");
495# endif
496#endif
497
498
499/* Return the number of screen columns needed for WC. */
500#if @GNULIB_WCWIDTH@
501# if @REPLACE_WCWIDTH@
502# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
503# undef wcwidth
504# define wcwidth rpl_wcwidth
505# endif
506_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
507_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
508# else
509# if !@HAVE_DECL_WCWIDTH@
510/* wcwidth exists but is not declared. */
511_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
512# endif
513_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
514# endif
515# if __GLIBC__ >= 2
516_GL_CXXALIASWARN (wcwidth);
517# endif
518#elif defined GNULIB_POSIXCHECK
519# undef wcwidth
520# if HAVE_RAW_DECL_WCWIDTH
521_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
522 "use gnulib module wcwidth for portability");
523# endif
524#endif
525
526
527/* Search N wide characters of S for C. */
528#if @GNULIB_WMEMCHR@
529# if !@HAVE_WMEMCHR@
530_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
531 _GL_ATTRIBUTE_PURE);
532# endif
533 /* On some systems, this function is defined as an overloaded function:
534 extern "C++" {
535 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
536 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
537 } */
538_GL_CXXALIAS_SYS_CAST2 (wmemchr,
539 wchar_t *, (const wchar_t *, wchar_t, size_t),
540 const wchar_t *, (const wchar_t *, wchar_t, size_t));
541# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
542 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
543_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
544_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
545 (const wchar_t *s, wchar_t c, size_t n));
546# elif __GLIBC__ >= 2
547_GL_CXXALIASWARN (wmemchr);
548# endif
549#elif defined GNULIB_POSIXCHECK
550# undef wmemchr
551# if HAVE_RAW_DECL_WMEMCHR
552_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
553 "use gnulib module wmemchr for portability");
554# endif
555#endif
556
557
558/* Compare N wide characters of S1 and S2. */
559#if @GNULIB_WMEMCMP@
560# if !@HAVE_WMEMCMP@
561_GL_FUNCDECL_SYS (wmemcmp, int,
562 (const wchar_t *s1, const wchar_t *s2, size_t n)
563 _GL_ATTRIBUTE_PURE);
564# endif
565_GL_CXXALIAS_SYS (wmemcmp, int,
566 (const wchar_t *s1, const wchar_t *s2, size_t n));
567# if __GLIBC__ >= 2
568_GL_CXXALIASWARN (wmemcmp);
569# endif
570#elif defined GNULIB_POSIXCHECK
571# undef wmemcmp
572# if HAVE_RAW_DECL_WMEMCMP
573_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
574 "use gnulib module wmemcmp for portability");
575# endif
576#endif
577
578
579/* Copy N wide characters of SRC to DEST. */
580#if @GNULIB_WMEMCPY@
581# if !@HAVE_WMEMCPY@
582_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
583 (wchar_t *restrict dest,
584 const wchar_t *restrict src, size_t n));
585# endif
586_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
587 (wchar_t *restrict dest,
588 const wchar_t *restrict src, size_t n));
589# if __GLIBC__ >= 2
590_GL_CXXALIASWARN (wmemcpy);
591# endif
592#elif defined GNULIB_POSIXCHECK
593# undef wmemcpy
594# if HAVE_RAW_DECL_WMEMCPY
595_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
596 "use gnulib module wmemcpy for portability");
597# endif
598#endif
599
600
601/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
602 overlapping memory areas. */
603#if @GNULIB_WMEMMOVE@
604# if !@HAVE_WMEMMOVE@
605_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
606 (wchar_t *dest, const wchar_t *src, size_t n));
607# endif
608_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
609 (wchar_t *dest, const wchar_t *src, size_t n));
610# if __GLIBC__ >= 2
611_GL_CXXALIASWARN (wmemmove);
612# endif
613#elif defined GNULIB_POSIXCHECK
614# undef wmemmove
615# if HAVE_RAW_DECL_WMEMMOVE
616_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
617 "use gnulib module wmemmove for portability");
618# endif
619#endif
620
621
622/* Copy N wide characters of SRC to DEST.
623 Return pointer to wide characters after the last written wide character. */
624#if @GNULIB_WMEMPCPY@
625# if !@HAVE_WMEMPCPY@
626_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
627 (wchar_t *restrict dest,
628 const wchar_t *restrict src, size_t n));
629# endif
630_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
631 (wchar_t *restrict dest,
632 const wchar_t *restrict src, size_t n));
633# if __GLIBC__ >= 2
634_GL_CXXALIASWARN (wmempcpy);
635# endif
636#elif defined GNULIB_POSIXCHECK
637# undef wmempcpy
638# if HAVE_RAW_DECL_WMEMPCPY
639_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
640 "use gnulib module wmempcpy for portability");
641# endif
642#endif
643
644
645/* Set N wide characters of S to C. */
646#if @GNULIB_WMEMSET@
647# if !@HAVE_WMEMSET@
648_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
649# endif
650_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
651# if __GLIBC__ >= 2
652_GL_CXXALIASWARN (wmemset);
653# endif
654#elif defined GNULIB_POSIXCHECK
655# undef wmemset
656# if HAVE_RAW_DECL_WMEMSET
657_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
658 "use gnulib module wmemset for portability");
659# endif
660#endif
661
662
663/* Return the number of wide characters in S. */
664#if @GNULIB_WCSLEN@
665# if !@HAVE_WCSLEN@
666_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
667# endif
668_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
669# if __GLIBC__ >= 2
670_GL_CXXALIASWARN (wcslen);
671# endif
672#elif defined GNULIB_POSIXCHECK
673# undef wcslen
674# if HAVE_RAW_DECL_WCSLEN
675_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
676 "use gnulib module wcslen for portability");
677# endif
678#endif
679
680
681/* Return the number of wide characters in S, but at most MAXLEN. */
682#if @GNULIB_WCSNLEN@
683# if !@HAVE_WCSNLEN@
684_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
685 _GL_ATTRIBUTE_PURE);
686# endif
687_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
688_GL_CXXALIASWARN (wcsnlen);
689#elif defined GNULIB_POSIXCHECK
690# undef wcsnlen
691# if HAVE_RAW_DECL_WCSNLEN
692_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
693 "use gnulib module wcsnlen for portability");
694# endif
695#endif
696
697
698/* Copy SRC to DEST. */
699#if @GNULIB_WCSCPY@
700# if !@HAVE_WCSCPY@
701_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
702 (wchar_t *restrict dest, const wchar_t *restrict src));
703# endif
704_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
705 (wchar_t *restrict dest, const wchar_t *restrict src));
706# if __GLIBC__ >= 2
707_GL_CXXALIASWARN (wcscpy);
708# endif
709#elif defined GNULIB_POSIXCHECK
710# undef wcscpy
711# if HAVE_RAW_DECL_WCSCPY
712_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
713 "use gnulib module wcscpy for portability");
714# endif
715#endif
716
717
718/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
719#if @GNULIB_WCPCPY@
720# if !@HAVE_WCPCPY@
721_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
722 (wchar_t *restrict dest, const wchar_t *restrict src));
723# endif
724_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
725 (wchar_t *restrict dest, const wchar_t *restrict src));
726_GL_CXXALIASWARN (wcpcpy);
727#elif defined GNULIB_POSIXCHECK
728# undef wcpcpy
729# if HAVE_RAW_DECL_WCPCPY
730_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
731 "use gnulib module wcpcpy for portability");
732# endif
733#endif
734
735
736/* Copy no more than N wide characters of SRC to DEST. */
737#if @GNULIB_WCSNCPY@
738# if !@HAVE_WCSNCPY@
739_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
740 (wchar_t *restrict dest,
741 const wchar_t *restrict src, size_t n));
742# endif
743_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
744 (wchar_t *restrict dest,
745 const wchar_t *restrict src, size_t n));
746# if __GLIBC__ >= 2
747_GL_CXXALIASWARN (wcsncpy);
748# endif
749#elif defined GNULIB_POSIXCHECK
750# undef wcsncpy
751# if HAVE_RAW_DECL_WCSNCPY
752_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
753 "use gnulib module wcsncpy for portability");
754# endif
755#endif
756
757
758/* Copy no more than N characters of SRC to DEST, returning the address of
759 the last character written into DEST. */
760#if @GNULIB_WCPNCPY@
761# if !@HAVE_WCPNCPY@
762_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
763 (wchar_t *restrict dest,
764 const wchar_t *restrict src, size_t n));
765# endif
766_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
767 (wchar_t *restrict dest,
768 const wchar_t *restrict src, size_t n));
769_GL_CXXALIASWARN (wcpncpy);
770#elif defined GNULIB_POSIXCHECK
771# undef wcpncpy
772# if HAVE_RAW_DECL_WCPNCPY
773_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
774 "use gnulib module wcpncpy for portability");
775# endif
776#endif
777
778
779/* Append SRC onto DEST. */
780#if @GNULIB_WCSCAT@
781# if !@HAVE_WCSCAT@
782_GL_FUNCDECL_SYS (wcscat, wchar_t *,
783 (wchar_t *restrict dest, const wchar_t *restrict src));
784# endif
785_GL_CXXALIAS_SYS (wcscat, wchar_t *,
786 (wchar_t *restrict dest, const wchar_t *restrict src));
787# if __GLIBC__ >= 2
788_GL_CXXALIASWARN (wcscat);
789# endif
790#elif defined GNULIB_POSIXCHECK
791# undef wcscat
792# if HAVE_RAW_DECL_WCSCAT
793_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
794 "use gnulib module wcscat for portability");
795# endif
796#endif
797
798
799/* Append no more than N wide characters of SRC onto DEST. */
800#if @GNULIB_WCSNCAT@
801# if !@HAVE_WCSNCAT@
802_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
803 (wchar_t *restrict dest, const wchar_t *restrict src,
804 size_t n));
805# endif
806_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
807 (wchar_t *restrict dest, const wchar_t *restrict src,
808 size_t n));
809# if __GLIBC__ >= 2
810_GL_CXXALIASWARN (wcsncat);
811# endif
812#elif defined GNULIB_POSIXCHECK
813# undef wcsncat
814# if HAVE_RAW_DECL_WCSNCAT
815_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
816 "use gnulib module wcsncat for portability");
817# endif
818#endif
819
820
821/* Compare S1 and S2. */
822#if @GNULIB_WCSCMP@
823# if !@HAVE_WCSCMP@
824_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
825 _GL_ATTRIBUTE_PURE);
826# endif
827_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
828# if __GLIBC__ >= 2
829_GL_CXXALIASWARN (wcscmp);
830# endif
831#elif defined GNULIB_POSIXCHECK
832# undef wcscmp
833# if HAVE_RAW_DECL_WCSCMP
834_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
835 "use gnulib module wcscmp for portability");
836# endif
837#endif
838
839
840/* Compare no more than N wide characters of S1 and S2. */
841#if @GNULIB_WCSNCMP@
842# if !@HAVE_WCSNCMP@
843_GL_FUNCDECL_SYS (wcsncmp, int,
844 (const wchar_t *s1, const wchar_t *s2, size_t n)
845 _GL_ATTRIBUTE_PURE);
846# endif
847_GL_CXXALIAS_SYS (wcsncmp, int,
848 (const wchar_t *s1, const wchar_t *s2, size_t n));
849# if __GLIBC__ >= 2
850_GL_CXXALIASWARN (wcsncmp);
851# endif
852#elif defined GNULIB_POSIXCHECK
853# undef wcsncmp
854# if HAVE_RAW_DECL_WCSNCMP
855_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
856 "use gnulib module wcsncmp for portability");
857# endif
858#endif
859
860
861/* Compare S1 and S2, ignoring case. */
862#if @GNULIB_WCSCASECMP@
863# if !@HAVE_WCSCASECMP@
864_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
865 _GL_ATTRIBUTE_PURE);
866# endif
867_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
868_GL_CXXALIASWARN (wcscasecmp);
869#elif defined GNULIB_POSIXCHECK
870# undef wcscasecmp
871# if HAVE_RAW_DECL_WCSCASECMP
872_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
873 "use gnulib module wcscasecmp for portability");
874# endif
875#endif
876
877
878/* Compare no more than N chars of S1 and S2, ignoring case. */
879#if @GNULIB_WCSNCASECMP@
880# if !@HAVE_WCSNCASECMP@
881_GL_FUNCDECL_SYS (wcsncasecmp, int,
882 (const wchar_t *s1, const wchar_t *s2, size_t n)
883 _GL_ATTRIBUTE_PURE);
884# endif
885_GL_CXXALIAS_SYS (wcsncasecmp, int,
886 (const wchar_t *s1, const wchar_t *s2, size_t n));
887_GL_CXXALIASWARN (wcsncasecmp);
888#elif defined GNULIB_POSIXCHECK
889# undef wcsncasecmp
890# if HAVE_RAW_DECL_WCSNCASECMP
891_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
892 "use gnulib module wcsncasecmp for portability");
893# endif
894#endif
895
896
897/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
898 category of the current locale. */
899#if @GNULIB_WCSCOLL@
900# if !@HAVE_WCSCOLL@
901_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
902# endif
903_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
904# if __GLIBC__ >= 2
905_GL_CXXALIASWARN (wcscoll);
906# endif
907#elif defined GNULIB_POSIXCHECK
908# undef wcscoll
909# if HAVE_RAW_DECL_WCSCOLL
910_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
911 "use gnulib module wcscoll for portability");
912# endif
913#endif
914
915
916/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
917 to two transformed strings the result is the as applying 'wcscoll' to the
918 original strings. */
919#if @GNULIB_WCSXFRM@
920# if !@HAVE_WCSXFRM@
921_GL_FUNCDECL_SYS (wcsxfrm, size_t,
922 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
923# endif
924_GL_CXXALIAS_SYS (wcsxfrm, size_t,
925 (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
926# if __GLIBC__ >= 2
927_GL_CXXALIASWARN (wcsxfrm);
928# endif
929#elif defined GNULIB_POSIXCHECK
930# undef wcsxfrm
931# if HAVE_RAW_DECL_WCSXFRM
932_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
933 "use gnulib module wcsxfrm for portability");
934# endif
935#endif
936
937
938/* Duplicate S, returning an identical malloc'd string. */
939#if @GNULIB_WCSDUP@
940# if defined _WIN32 && !defined __CYGWIN__
941# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
942# undef wcsdup
943# define wcsdup _wcsdup
944# endif
945_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
946# else
947# if !@HAVE_WCSDUP@ || __GNUC__ >= 11
948_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
949 (const wchar_t *s)
950 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
951# endif
952_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
953# endif
954_GL_CXXALIASWARN (wcsdup);
955#else
956# if __GNUC__ >= 11 && !defined wcsdup
957/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
958_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
959 (const wchar_t *s)
960 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
961# endif
962# if defined GNULIB_POSIXCHECK
963# undef wcsdup
964# if HAVE_RAW_DECL_WCSDUP
965_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
966 "use gnulib module wcsdup for portability");
967# endif
968# elif @GNULIB_MDA_WCSDUP@
969/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
970 required. In C++ with GNULIB_NAMESPACE, avoid differences between
971 platforms by defining GNULIB_NAMESPACE::wcsdup always. */
972# if defined _WIN32 && !defined __CYGWIN__
973# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
974# undef wcsdup
975# define wcsdup _wcsdup
976# endif
977_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
978# else
979_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
980 (const wchar_t *s)
981 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
982# if @HAVE_DECL_WCSDUP@
983_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
984# endif
985# endif
986# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
987_GL_CXXALIASWARN (wcsdup);
988# endif
989# endif
990#endif
991
992
993/* Find the first occurrence of WC in WCS. */
994#if @GNULIB_WCSCHR@
995# if !@HAVE_WCSCHR@
996_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
997 _GL_ATTRIBUTE_PURE);
998# endif
999 /* On some systems, this function is defined as an overloaded function:
1000 extern "C++" {
1001 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1002 wchar_t * std::wcschr (wchar_t *, wchar_t);
1003 } */
1004_GL_CXXALIAS_SYS_CAST2 (wcschr,
1005 wchar_t *, (const wchar_t *, wchar_t),
1006 const wchar_t *, (const wchar_t *, wchar_t));
1007# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1008 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1009_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1010_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1011# elif __GLIBC__ >= 2
1012_GL_CXXALIASWARN (wcschr);
1013# endif
1014#elif defined GNULIB_POSIXCHECK
1015# undef wcschr
1016# if HAVE_RAW_DECL_WCSCHR
1017_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1018 "use gnulib module wcschr for portability");
1019# endif
1020#endif
1021
1022
1023/* Find the last occurrence of WC in WCS. */
1024#if @GNULIB_WCSRCHR@
1025# if !@HAVE_WCSRCHR@
1026_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1027 _GL_ATTRIBUTE_PURE);
1028# endif
1029 /* On some systems, this function is defined as an overloaded function:
1030 extern "C++" {
1031 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1032 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1033 } */
1034_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1035 wchar_t *, (const wchar_t *, wchar_t),
1036 const wchar_t *, (const wchar_t *, wchar_t));
1037# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1038 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1039_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1040_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1041# elif __GLIBC__ >= 2
1042_GL_CXXALIASWARN (wcsrchr);
1043# endif
1044#elif defined GNULIB_POSIXCHECK
1045# undef wcsrchr
1046# if HAVE_RAW_DECL_WCSRCHR
1047_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1048 "use gnulib module wcsrchr for portability");
1049# endif
1050#endif
1051
1052
1053/* Return the length of the initial segmet of WCS which consists entirely
1054 of wide characters not in REJECT. */
1055#if @GNULIB_WCSCSPN@
1056# if !@HAVE_WCSCSPN@
1057_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1058 _GL_ATTRIBUTE_PURE);
1059# endif
1060_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1061# if __GLIBC__ >= 2
1062_GL_CXXALIASWARN (wcscspn);
1063# endif
1064#elif defined GNULIB_POSIXCHECK
1065# undef wcscspn
1066# if HAVE_RAW_DECL_WCSCSPN
1067_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1068 "use gnulib module wcscspn for portability");
1069# endif
1070#endif
1071
1072
1073/* Return the length of the initial segmet of WCS which consists entirely
1074 of wide characters in ACCEPT. */
1075#if @GNULIB_WCSSPN@
1076# if !@HAVE_WCSSPN@
1077_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1078 _GL_ATTRIBUTE_PURE);
1079# endif
1080_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1081# if __GLIBC__ >= 2
1082_GL_CXXALIASWARN (wcsspn);
1083# endif
1084#elif defined GNULIB_POSIXCHECK
1085# undef wcsspn
1086# if HAVE_RAW_DECL_WCSSPN
1087_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1088 "use gnulib module wcsspn for portability");
1089# endif
1090#endif
1091
1092
1093/* Find the first occurrence in WCS of any character in ACCEPT. */
1094#if @GNULIB_WCSPBRK@
1095# if !@HAVE_WCSPBRK@
1096_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1097 (const wchar_t *wcs, const wchar_t *accept)
1098 _GL_ATTRIBUTE_PURE);
1099# endif
1100 /* On some systems, this function is defined as an overloaded function:
1101 extern "C++" {
1102 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1103 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1104 } */
1105_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1106 wchar_t *, (const wchar_t *, const wchar_t *),
1107 const wchar_t *, (const wchar_t *, const wchar_t *));
1108# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1109 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1110_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1111 (wchar_t *wcs, const wchar_t *accept));
1112_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1113 (const wchar_t *wcs, const wchar_t *accept));
1114# elif __GLIBC__ >= 2
1115_GL_CXXALIASWARN (wcspbrk);
1116# endif
1117#elif defined GNULIB_POSIXCHECK
1118# undef wcspbrk
1119# if HAVE_RAW_DECL_WCSPBRK
1120_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1121 "use gnulib module wcspbrk for portability");
1122# endif
1123#endif
1124
1125
1126/* Find the first occurrence of NEEDLE in HAYSTACK. */
1127#if @GNULIB_WCSSTR@
1128# if !@HAVE_WCSSTR@
1129_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1130 (const wchar_t *restrict haystack,
1131 const wchar_t *restrict needle)
1132 _GL_ATTRIBUTE_PURE);
1133# endif
1134 /* On some systems, this function is defined as an overloaded function:
1135 extern "C++" {
1136 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1137 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1138 } */
1139_GL_CXXALIAS_SYS_CAST2 (wcsstr,
1140 wchar_t *,
1141 (const wchar_t *restrict, const wchar_t *restrict),
1142 const wchar_t *,
1143 (const wchar_t *restrict, const wchar_t *restrict));
1144# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1145 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1146_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1147 (wchar_t *restrict haystack,
1148 const wchar_t *restrict needle));
1149_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1150 (const wchar_t *restrict haystack,
1151 const wchar_t *restrict needle));
1152# elif __GLIBC__ >= 2
1153_GL_CXXALIASWARN (wcsstr);
1154# endif
1155#elif defined GNULIB_POSIXCHECK
1156# undef wcsstr
1157# if HAVE_RAW_DECL_WCSSTR
1158_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1159 "use gnulib module wcsstr for portability");
1160# endif
1161#endif
1162
1163
1164/* Divide WCS into tokens separated by characters in DELIM. */
1165#if @GNULIB_WCSTOK@
1166# if @REPLACE_WCSTOK@
1167# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1168# undef wcstok
1169# define wcstok rpl_wcstok
1170# endif
1171_GL_FUNCDECL_RPL (wcstok, wchar_t *,
1172 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1173 wchar_t **restrict ptr));
1174_GL_CXXALIAS_RPL (wcstok, wchar_t *,
1175 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1176 wchar_t **restrict ptr));
1177# else
1178# if !@HAVE_WCSTOK@
1179_GL_FUNCDECL_SYS (wcstok, wchar_t *,
1180 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1181 wchar_t **restrict ptr));
1182# endif
1183_GL_CXXALIAS_SYS (wcstok, wchar_t *,
1184 (wchar_t *restrict wcs, const wchar_t *restrict delim,
1185 wchar_t **restrict ptr));
1186# endif
1187# if __GLIBC__ >= 2
1188_GL_CXXALIASWARN (wcstok);
1189# endif
1190#elif defined GNULIB_POSIXCHECK
1191# undef wcstok
1192# if HAVE_RAW_DECL_WCSTOK
1193_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1194 "use gnulib module wcstok for portability");
1195# endif
1196#endif
1197
1198
1199/* Determine number of column positions required for first N wide
1200 characters (or fewer if S ends before this) in S. */
1201#if @GNULIB_WCSWIDTH@
1202# if @REPLACE_WCSWIDTH@
1203# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1204# undef wcswidth
1205# define wcswidth rpl_wcswidth
1206# endif
1207_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1208 _GL_ATTRIBUTE_PURE);
1209_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1210# else
1211# if !@HAVE_WCSWIDTH@
1212_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1213 _GL_ATTRIBUTE_PURE);
1214# endif
1215_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1216# endif
1217# if __GLIBC__ >= 2
1218_GL_CXXALIASWARN (wcswidth);
1219# endif
1220#elif defined GNULIB_POSIXCHECK
1221# undef wcswidth
1222# if HAVE_RAW_DECL_WCSWIDTH
1223_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1224 "use gnulib module wcswidth for portability");
1225# endif
1226#endif
1227
1228
1229/* Convert *TP to a date and time wide string. See
1230 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */
1231#if @GNULIB_WCSFTIME@
1232# if @REPLACE_WCSFTIME@
1233# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1234# undef wcsftime
1235# define wcsftime rpl_wcsftime
1236# endif
1237_GL_FUNCDECL_RPL (wcsftime, size_t,
1238 (wchar_t *restrict __buf, size_t __bufsize,
1239 const wchar_t *restrict __fmt,
1240 const struct tm *restrict __tp)
1241 _GL_ARG_NONNULL ((1, 3, 4)));
1242_GL_CXXALIAS_RPL (wcsftime, size_t,
1243 (wchar_t *restrict __buf, size_t __bufsize,
1244 const wchar_t *restrict __fmt,
1245 const struct tm *restrict __tp));
1246# else
1247# if !@HAVE_WCSFTIME@
1248_GL_FUNCDECL_SYS (wcsftime, size_t,
1249 (wchar_t *restrict __buf, size_t __bufsize,
1250 const wchar_t *restrict __fmt,
1251 const struct tm *restrict __tp)
1252 _GL_ARG_NONNULL ((1, 3, 4)));
1253# endif
1254_GL_CXXALIAS_SYS (wcsftime, size_t,
1255 (wchar_t *restrict __buf, size_t __bufsize,
1256 const wchar_t *restrict __fmt,
1257 const struct tm *restrict __tp));
1258# endif
1259# if __GLIBC__ >= 2
1260_GL_CXXALIASWARN (wcsftime);
1261# endif
1262#elif defined GNULIB_POSIXCHECK
1263# undef wcsftime
1264# if HAVE_RAW_DECL_WCSFTIME
1265_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1266 "use gnulib module wcsftime for portability");
1267# endif
1268#endif
1269
1270
1271#endif /* _@GUARD_PREFIX@_WCHAR_H */
1272#endif /* _@GUARD_PREFIX@_WCHAR_H */
1273#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette