1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
4 Copyright (C) 2007-2012 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>. */
19 /* Written by Eric Blake. */
22 * ISO C 99 <wchar.h> for platforms that have issues.
23 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
25 * For now, this just ensures proper prerequisite inclusion order and
26 * the declaration of wcwidth().
30 #pragma GCC system_header
34 #if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
35 /* Special invocation convention:
36 - Inside glibc and uClibc header files.
37 - On HP-UX 11.00 we have a sequence of nested includes
38 <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
39 once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
40 and once directly. In both situations 'wint_t' is not yet defined,
41 therefore we cannot provide the function overrides; instead include only
42 the system's <wchar.h>.
43 - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
44 the latter includes <wchar.h>. But here, we have no way to detect whether
45 <wctype.h> is completely included or is still being included. */
47 #include_next <wchar.h>
50 /* Normal invocation convention. */
54 #define _GL_ALREADY_INCLUDING_WCHAR_H
57 # include <features.h> /* for __GLIBC__ */
60 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
62 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
63 included before <wchar.h>.
64 In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
66 But avoid namespace pollution on glibc systems. */
67 #if !(defined __GLIBC__ && !defined __UCLIBC__)
75 /* Include the original <wchar.h> if it exists.
76 Some builds of uClibc lack it. */
77 /* The include_next requires a split double-inclusion guard. */
79 # include_next <wchar.h>
82 #undef _GL_ALREADY_INCLUDING_WCHAR_H
87 /* The __attribute__ feature is available in gcc versions 2.5 and later.
88 The attribute __pure__ was added in gcc 2.96. */
89 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
90 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
92 # define _GL_ATTRIBUTE_PURE /* empty */
95 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
99 /* The three most frequent use cases of these macros are:
101 * For providing a substitute for a function that is missing on some
102 platforms, but is declared and works fine on the platforms on which
107 _GL_FUNCDECL_SYS (foo, ...);
109 _GL_CXXALIAS_SYS (foo, ...);
110 _GL_CXXALIASWARN (foo);
111 #elif defined GNULIB_POSIXCHECK
115 * For providing a replacement for a function that exists on all platforms,
116 but is broken/insufficient and needs to be replaced on some platforms:
120 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
124 _GL_FUNCDECL_RPL (foo, ...);
125 _GL_CXXALIAS_RPL (foo, ...);
127 _GL_CXXALIAS_SYS (foo, ...);
129 _GL_CXXALIASWARN (foo);
130 #elif defined GNULIB_POSIXCHECK
134 * For providing a replacement for a function that exists on some platforms
135 but is broken/insufficient and needs to be replaced on some of them and
136 is additionally either missing or undeclared on some other platforms:
140 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
144 _GL_FUNCDECL_RPL (foo, ...);
145 _GL_CXXALIAS_RPL (foo, ...);
147 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
148 _GL_FUNCDECL_SYS (foo, ...);
150 _GL_CXXALIAS_SYS (foo, ...);
152 _GL_CXXALIASWARN (foo);
153 #elif defined GNULIB_POSIXCHECK
158 /* _GL_EXTERN_C declaration;
159 performs the declaration with C linkage. */
160 #if defined __cplusplus
161 # define _GL_EXTERN_C extern "C"
163 # define _GL_EXTERN_C extern
166 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
167 declares a replacement function, named rpl_func, with the given prototype,
168 consisting of return type, parameters, and attributes.
170 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
171 _GL_ARG_NONNULL ((1)));
173 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
174 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
175 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
176 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
178 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
179 declares the system function, named func, with the given prototype,
180 consisting of return type, parameters, and attributes.
182 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
183 _GL_ARG_NONNULL ((1)));
185 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
186 _GL_EXTERN_C rettype func parameters_and_attributes
188 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
189 declares a C++ alias called GNULIB_NAMESPACE::func
190 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
192 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
194 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
195 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
196 #if defined __cplusplus && defined GNULIB_NAMESPACE
197 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
198 namespace GNULIB_NAMESPACE \
200 rettype (*const func) parameters = ::rpl_func; \
202 _GL_EXTERN_C int _gl_cxxalias_dummy
204 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
205 _GL_EXTERN_C int _gl_cxxalias_dummy
208 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
209 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
210 except that the C function rpl_func may have a slightly different
211 declaration. A cast is used to silence the "invalid conversion" error
212 that would otherwise occur. */
213 #if defined __cplusplus && defined GNULIB_NAMESPACE
214 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
215 namespace GNULIB_NAMESPACE \
217 rettype (*const func) parameters = \
218 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
220 _GL_EXTERN_C int _gl_cxxalias_dummy
222 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
223 _GL_EXTERN_C int _gl_cxxalias_dummy
226 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
227 declares a C++ alias called GNULIB_NAMESPACE::func
228 that redirects to the system provided function func, if GNULIB_NAMESPACE
231 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
233 #if defined __cplusplus && defined GNULIB_NAMESPACE
234 /* If we were to write
235 rettype (*const func) parameters = ::func;
236 like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
237 better (remove an indirection through a 'static' pointer variable),
238 but then the _GL_CXXALIASWARN macro below would cause a warning not only
239 for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
240 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
241 namespace GNULIB_NAMESPACE \
243 static rettype (*func) parameters = ::func; \
245 _GL_EXTERN_C int _gl_cxxalias_dummy
247 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
248 _GL_EXTERN_C int _gl_cxxalias_dummy
251 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
252 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
253 except that the C function func may have a slightly different declaration.
254 A cast is used to silence the "invalid conversion" error that would
256 #if defined __cplusplus && defined GNULIB_NAMESPACE
257 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
258 namespace GNULIB_NAMESPACE \
260 static rettype (*func) parameters = \
261 reinterpret_cast<rettype(*)parameters>(::func); \
263 _GL_EXTERN_C int _gl_cxxalias_dummy
265 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
266 _GL_EXTERN_C int _gl_cxxalias_dummy
269 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
270 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
271 except that the C function is picked among a set of overloaded functions,
272 namely the one with rettype2 and parameters2. Two consecutive casts
273 are used to silence the "cannot find a match" and "invalid conversion"
274 errors that would otherwise occur. */
275 #if defined __cplusplus && defined GNULIB_NAMESPACE
276 /* The outer cast must be a reinterpret_cast.
277 The inner cast: When the function is defined as a set of overloaded
278 functions, it works as a static_cast<>, choosing the designated variant.
279 When the function is defined as a single variant, it works as a
280 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
281 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
282 namespace GNULIB_NAMESPACE \
284 static rettype (*func) parameters = \
285 reinterpret_cast<rettype(*)parameters>( \
286 (rettype2(*)parameters2)(::func)); \
288 _GL_EXTERN_C int _gl_cxxalias_dummy
290 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
291 _GL_EXTERN_C int _gl_cxxalias_dummy
294 /* _GL_CXXALIASWARN (func);
295 causes a warning to be emitted when ::func is used but not when
296 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
298 #if defined __cplusplus && defined GNULIB_NAMESPACE
299 # define _GL_CXXALIASWARN(func) \
300 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
301 # define _GL_CXXALIASWARN_1(func,namespace) \
302 _GL_CXXALIASWARN_2 (func, namespace)
303 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
304 we enable the warning only when not optimizing. */
306 # define _GL_CXXALIASWARN_2(func,namespace) \
307 _GL_WARN_ON_USE (func, \
308 "The symbol ::" #func " refers to the system function. " \
309 "Use " #namespace "::" #func " instead.")
310 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
311 # define _GL_CXXALIASWARN_2(func,namespace) \
312 extern __typeof__ (func) func
314 # define _GL_CXXALIASWARN_2(func,namespace) \
315 _GL_EXTERN_C int _gl_cxxalias_dummy
318 # define _GL_CXXALIASWARN(func) \
319 _GL_EXTERN_C int _gl_cxxalias_dummy
322 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
323 causes a warning to be emitted when the given overloaded variant of ::func
324 is used but not when GNULIB_NAMESPACE::func is used. */
325 #if defined __cplusplus && defined GNULIB_NAMESPACE
326 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
327 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
329 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
330 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
331 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
332 we enable the warning only when not optimizing. */
334 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
335 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
336 "The symbol ::" #func " refers to the system function. " \
337 "Use " #namespace "::" #func " instead.")
338 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
339 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
340 extern __typeof__ (func) func
342 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
343 _GL_EXTERN_C int _gl_cxxalias_dummy
346 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
347 _GL_EXTERN_C int _gl_cxxalias_dummy
350 #endif /* _GL_CXXDEFS_H */
352 /* The definition of _GL_ARG_NONNULL is copied here. */
353 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
354 that the values passed as arguments n, ..., m must be non-NULL pointers.
355 n = 1 stands for the first argument, n = 2 for the second argument etc. */
356 #ifndef _GL_ARG_NONNULL
357 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
358 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
360 # define _GL_ARG_NONNULL(params)
364 /* The definition of _GL_WARN_ON_USE is copied here. */
365 #ifndef _GL_WARN_ON_USE
367 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
368 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
369 # define _GL_WARN_ON_USE(function, message) \
370 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
371 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
372 /* Verify the existence of the function. */
373 # define _GL_WARN_ON_USE(function, message) \
374 extern __typeof__ (function) function
375 # else /* Unsupported. */
376 # define _GL_WARN_ON_USE(function, message) \
377 _GL_WARN_EXTERN_C int _gl_warn_on_use
381 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
382 is like _GL_WARN_ON_USE (function, "string"), except that the function is
383 declared with the given prototype, consisting of return type, parameters,
385 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
386 not work in this case. */
387 #ifndef _GL_WARN_ON_USE_CXX
388 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
389 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
390 extern rettype function parameters_and_attributes \
391 __attribute__ ((__warning__ (msg)))
392 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
393 /* Verify the existence of the function. */
394 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
395 extern rettype function parameters_and_attributes
396 # else /* Unsupported. */
397 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
398 _GL_WARN_EXTERN_C int _gl_warn_on_use
402 /* _GL_WARN_EXTERN_C declaration;
403 performs the declaration with C linkage. */
404 #ifndef _GL_WARN_EXTERN_C
405 # if defined __cplusplus
406 # define _GL_WARN_EXTERN_C extern "C"
408 # define _GL_WARN_EXTERN_C extern
413 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
414 #if !1 && !defined wint_t
420 /* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
421 This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
422 "unchanged by default argument promotions". Override it. */
423 # if defined _MSC_VER
424 # if !GNULIB_defined_wint_t
425 # include <crtdefs.h>
426 typedef unsigned int rpl_wint_t;
428 # define wint_t rpl_wint_t
429 # define GNULIB_defined_wint_t 1
433 # define WEOF ((wint_t) -1)
438 /* Override mbstate_t if it is too small.
439 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
440 implementing mbrtowc for encodings like UTF-8. */
442 # if !GNULIB_defined_mbstate_t
443 typedef int rpl_mbstate_t;
445 # define mbstate_t rpl_mbstate_t
446 # define GNULIB_defined_mbstate_t 1
451 /* Convert a single-byte character to a wide character. */
454 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
456 # define btowc rpl_btowc
458 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
459 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
462 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
464 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
466 _GL_CXXALIASWARN (btowc);
467 #elif defined GNULIB_POSIXCHECK
469 # if HAVE_RAW_DECL_BTOWC
470 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
471 "use gnulib module btowc for portability");
476 /* Convert a wide character to a single-byte character. */
479 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
481 # define wctob rpl_wctob
483 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
484 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
486 # if !defined wctob && !1
487 /* wctob is provided by gnulib, or wctob exists but is not declared. */
488 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
490 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
492 _GL_CXXALIASWARN (wctob);
493 #elif defined GNULIB_POSIXCHECK
495 # if HAVE_RAW_DECL_WCTOB
496 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
497 "use gnulib module wctob for portability");
502 /* Test whether *PS is in the initial state. */
505 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
507 # define mbsinit rpl_mbsinit
509 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
510 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
513 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
515 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
517 _GL_CXXALIASWARN (mbsinit);
518 #elif defined GNULIB_POSIXCHECK
520 # if HAVE_RAW_DECL_MBSINIT
521 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
522 "use gnulib module mbsinit for portability");
527 /* Convert a multibyte character to a wide character. */
530 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
532 # define mbrtowc rpl_mbrtowc
534 _GL_FUNCDECL_RPL (mbrtowc, size_t,
535 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
536 _GL_CXXALIAS_RPL (mbrtowc, size_t,
537 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
540 _GL_FUNCDECL_SYS (mbrtowc, size_t,
541 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
543 _GL_CXXALIAS_SYS (mbrtowc, size_t,
544 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
546 _GL_CXXALIASWARN (mbrtowc);
547 #elif defined GNULIB_POSIXCHECK
549 # if HAVE_RAW_DECL_MBRTOWC
550 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
551 "use gnulib module mbrtowc for portability");
556 /* Recognize a multibyte character. */
559 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
561 # define mbrlen rpl_mbrlen
563 _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
564 _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
567 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
569 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
571 _GL_CXXALIASWARN (mbrlen);
572 #elif defined GNULIB_POSIXCHECK
574 # if HAVE_RAW_DECL_MBRLEN
575 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
576 "use gnulib module mbrlen for portability");
581 /* Convert a string to a wide string. */
584 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
586 # define mbsrtowcs rpl_mbsrtowcs
588 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
589 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
590 _GL_ARG_NONNULL ((2)));
591 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
592 (wchar_t *dest, const char **srcp, size_t len,
596 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
597 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
598 _GL_ARG_NONNULL ((2)));
600 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
601 (wchar_t *dest, const char **srcp, size_t len,
604 _GL_CXXALIASWARN (mbsrtowcs);
605 #elif defined GNULIB_POSIXCHECK
607 # if HAVE_RAW_DECL_MBSRTOWCS
608 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
609 "use gnulib module mbsrtowcs for portability");
614 /* Convert a string to a wide string. */
617 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
619 # define mbsnrtowcs rpl_mbsnrtowcs
621 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
622 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
624 _GL_ARG_NONNULL ((2)));
625 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
626 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
630 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
631 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
633 _GL_ARG_NONNULL ((2)));
635 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
636 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
639 _GL_CXXALIASWARN (mbsnrtowcs);
640 #elif defined GNULIB_POSIXCHECK
642 # if HAVE_RAW_DECL_MBSNRTOWCS
643 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
644 "use gnulib module mbsnrtowcs for portability");
649 /* Convert a wide character to a multibyte character. */
652 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
654 # define wcrtomb rpl_wcrtomb
656 _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
657 _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
660 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
662 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
664 _GL_CXXALIASWARN (wcrtomb);
665 #elif defined GNULIB_POSIXCHECK
667 # if HAVE_RAW_DECL_WCRTOMB
668 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
669 "use gnulib module wcrtomb for portability");
674 /* Convert a wide string to a string. */
677 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
679 # define wcsrtombs rpl_wcsrtombs
681 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
682 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
683 _GL_ARG_NONNULL ((2)));
684 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
685 (char *dest, const wchar_t **srcp, size_t len,
689 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
690 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
691 _GL_ARG_NONNULL ((2)));
693 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
694 (char *dest, const wchar_t **srcp, size_t len,
697 _GL_CXXALIASWARN (wcsrtombs);
698 #elif defined GNULIB_POSIXCHECK
700 # if HAVE_RAW_DECL_WCSRTOMBS
701 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
702 "use gnulib module wcsrtombs for portability");
707 /* Convert a wide string to a string. */
710 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
712 # define wcsnrtombs rpl_wcsnrtombs
714 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
715 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
717 _GL_ARG_NONNULL ((2)));
718 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
719 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
723 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
724 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
726 _GL_ARG_NONNULL ((2)));
728 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
729 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
732 _GL_CXXALIASWARN (wcsnrtombs);
733 #elif defined GNULIB_POSIXCHECK
735 # if HAVE_RAW_DECL_WCSNRTOMBS
736 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
737 "use gnulib module wcsnrtombs for portability");
742 /* Return the number of screen columns needed for WC. */
745 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
747 # define wcwidth rpl_wcwidth
749 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
750 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
753 /* wcwidth exists but is not declared. */
754 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
756 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
758 _GL_CXXALIASWARN (wcwidth);
759 #elif defined GNULIB_POSIXCHECK
761 # if HAVE_RAW_DECL_WCWIDTH
762 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
763 "use gnulib module wcwidth for portability");
768 /* Search N wide characters of S for C. */
771 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
774 /* On some systems, this function is defined as an overloaded function:
776 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
777 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
779 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
780 wchar_t *, (const wchar_t *, wchar_t, size_t),
781 const wchar_t *, (const wchar_t *, wchar_t, size_t));
782 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
783 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
784 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
785 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
786 (const wchar_t *s, wchar_t c, size_t n));
788 _GL_CXXALIASWARN (wmemchr);
790 #elif defined GNULIB_POSIXCHECK
792 # if HAVE_RAW_DECL_WMEMCHR
793 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
794 "use gnulib module wmemchr for portability");
799 /* Compare N wide characters of S1 and S2. */
802 _GL_FUNCDECL_SYS (wmemcmp, int,
803 (const wchar_t *s1, const wchar_t *s2, size_t n)
806 _GL_CXXALIAS_SYS (wmemcmp, int,
807 (const wchar_t *s1, const wchar_t *s2, size_t n));
808 _GL_CXXALIASWARN (wmemcmp);
809 #elif defined GNULIB_POSIXCHECK
811 # if HAVE_RAW_DECL_WMEMCMP
812 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
813 "use gnulib module wmemcmp for portability");
818 /* Copy N wide characters of SRC to DEST. */
821 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
822 (wchar_t *dest, const wchar_t *src, size_t n));
824 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
825 (wchar_t *dest, const wchar_t *src, size_t n));
826 _GL_CXXALIASWARN (wmemcpy);
827 #elif defined GNULIB_POSIXCHECK
829 # if HAVE_RAW_DECL_WMEMCPY
830 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
831 "use gnulib module wmemcpy for portability");
836 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
837 overlapping memory areas. */
840 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
841 (wchar_t *dest, const wchar_t *src, size_t n));
843 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
844 (wchar_t *dest, const wchar_t *src, size_t n));
845 _GL_CXXALIASWARN (wmemmove);
846 #elif defined GNULIB_POSIXCHECK
848 # if HAVE_RAW_DECL_WMEMMOVE
849 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
850 "use gnulib module wmemmove for portability");
855 /* Set N wide characters of S to C. */
858 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
860 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
861 _GL_CXXALIASWARN (wmemset);
862 #elif defined GNULIB_POSIXCHECK
864 # if HAVE_RAW_DECL_WMEMSET
865 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
866 "use gnulib module wmemset for portability");
871 /* Return the number of wide characters in S. */
874 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
876 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
877 _GL_CXXALIASWARN (wcslen);
878 #elif defined GNULIB_POSIXCHECK
880 # if HAVE_RAW_DECL_WCSLEN
881 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
882 "use gnulib module wcslen for portability");
887 /* Return the number of wide characters in S, but at most MAXLEN. */
890 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
893 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
894 _GL_CXXALIASWARN (wcsnlen);
895 #elif defined GNULIB_POSIXCHECK
897 # if HAVE_RAW_DECL_WCSNLEN
898 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
899 "use gnulib module wcsnlen for portability");
904 /* Copy SRC to DEST. */
907 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
909 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
910 _GL_CXXALIASWARN (wcscpy);
911 #elif defined GNULIB_POSIXCHECK
913 # if HAVE_RAW_DECL_WCSCPY
914 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
915 "use gnulib module wcscpy for portability");
920 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
923 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
925 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
926 _GL_CXXALIASWARN (wcpcpy);
927 #elif defined GNULIB_POSIXCHECK
929 # if HAVE_RAW_DECL_WCPCPY
930 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
931 "use gnulib module wcpcpy for portability");
936 /* Copy no more than N wide characters of SRC to DEST. */
939 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
940 (wchar_t *dest, const wchar_t *src, size_t n));
942 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
943 (wchar_t *dest, const wchar_t *src, size_t n));
944 _GL_CXXALIASWARN (wcsncpy);
945 #elif defined GNULIB_POSIXCHECK
947 # if HAVE_RAW_DECL_WCSNCPY
948 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
949 "use gnulib module wcsncpy for portability");
954 /* Copy no more than N characters of SRC to DEST, returning the address of
955 the last character written into DEST. */
958 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
959 (wchar_t *dest, const wchar_t *src, size_t n));
961 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
962 (wchar_t *dest, const wchar_t *src, size_t n));
963 _GL_CXXALIASWARN (wcpncpy);
964 #elif defined GNULIB_POSIXCHECK
966 # if HAVE_RAW_DECL_WCPNCPY
967 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
968 "use gnulib module wcpncpy for portability");
973 /* Append SRC onto DEST. */
976 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
978 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
979 _GL_CXXALIASWARN (wcscat);
980 #elif defined GNULIB_POSIXCHECK
982 # if HAVE_RAW_DECL_WCSCAT
983 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
984 "use gnulib module wcscat for portability");
989 /* Append no more than N wide characters of SRC onto DEST. */
992 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
993 (wchar_t *dest, const wchar_t *src, size_t n));
995 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
996 (wchar_t *dest, const wchar_t *src, size_t n));
997 _GL_CXXALIASWARN (wcsncat);
998 #elif defined GNULIB_POSIXCHECK
1000 # if HAVE_RAW_DECL_WCSNCAT
1001 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1002 "use gnulib module wcsncat for portability");
1007 /* Compare S1 and S2. */
1010 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
1011 _GL_ATTRIBUTE_PURE);
1013 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1014 _GL_CXXALIASWARN (wcscmp);
1015 #elif defined GNULIB_POSIXCHECK
1017 # if HAVE_RAW_DECL_WCSCMP
1018 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1019 "use gnulib module wcscmp for portability");
1024 /* Compare no more than N wide characters of S1 and S2. */
1027 _GL_FUNCDECL_SYS (wcsncmp, int,
1028 (const wchar_t *s1, const wchar_t *s2, size_t n)
1029 _GL_ATTRIBUTE_PURE);
1031 _GL_CXXALIAS_SYS (wcsncmp, int,
1032 (const wchar_t *s1, const wchar_t *s2, size_t n));
1033 _GL_CXXALIASWARN (wcsncmp);
1034 #elif defined GNULIB_POSIXCHECK
1036 # if HAVE_RAW_DECL_WCSNCMP
1037 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1038 "use gnulib module wcsncmp for portability");
1043 /* Compare S1 and S2, ignoring case. */
1046 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
1047 _GL_ATTRIBUTE_PURE);
1049 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1050 _GL_CXXALIASWARN (wcscasecmp);
1051 #elif defined GNULIB_POSIXCHECK
1053 # if HAVE_RAW_DECL_WCSCASECMP
1054 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1055 "use gnulib module wcscasecmp for portability");
1060 /* Compare no more than N chars of S1 and S2, ignoring case. */
1063 _GL_FUNCDECL_SYS (wcsncasecmp, int,
1064 (const wchar_t *s1, const wchar_t *s2, size_t n)
1065 _GL_ATTRIBUTE_PURE);
1067 _GL_CXXALIAS_SYS (wcsncasecmp, int,
1068 (const wchar_t *s1, const wchar_t *s2, size_t n));
1069 _GL_CXXALIASWARN (wcsncasecmp);
1070 #elif defined GNULIB_POSIXCHECK
1072 # if HAVE_RAW_DECL_WCSNCASECMP
1073 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1074 "use gnulib module wcsncasecmp for portability");
1079 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
1080 category of the current locale. */
1083 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1085 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1086 _GL_CXXALIASWARN (wcscoll);
1087 #elif defined GNULIB_POSIXCHECK
1089 # if HAVE_RAW_DECL_WCSCOLL
1090 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1091 "use gnulib module wcscoll for portability");
1096 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
1097 to two transformed strings the result is the as applying 'wcscoll' to the
1098 original strings. */
1101 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1103 _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1104 _GL_CXXALIASWARN (wcsxfrm);
1105 #elif defined GNULIB_POSIXCHECK
1107 # if HAVE_RAW_DECL_WCSXFRM
1108 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1109 "use gnulib module wcsxfrm for portability");
1114 /* Duplicate S, returning an identical malloc'd string. */
1117 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1119 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1120 _GL_CXXALIASWARN (wcsdup);
1121 #elif defined GNULIB_POSIXCHECK
1123 # if HAVE_RAW_DECL_WCSDUP
1124 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1125 "use gnulib module wcsdup for portability");
1130 /* Find the first occurrence of WC in WCS. */
1133 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1134 _GL_ATTRIBUTE_PURE);
1136 /* On some systems, this function is defined as an overloaded function:
1138 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1139 wchar_t * std::wcschr (wchar_t *, wchar_t);
1141 _GL_CXXALIAS_SYS_CAST2 (wcschr,
1142 wchar_t *, (const wchar_t *, wchar_t),
1143 const wchar_t *, (const wchar_t *, wchar_t));
1144 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1145 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1146 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1147 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1149 _GL_CXXALIASWARN (wcschr);
1151 #elif defined GNULIB_POSIXCHECK
1153 # if HAVE_RAW_DECL_WCSCHR
1154 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1155 "use gnulib module wcschr for portability");
1160 /* Find the last occurrence of WC in WCS. */
1163 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1164 _GL_ATTRIBUTE_PURE);
1166 /* On some systems, this function is defined as an overloaded function:
1168 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1169 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1171 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1172 wchar_t *, (const wchar_t *, wchar_t),
1173 const wchar_t *, (const wchar_t *, wchar_t));
1174 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1175 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1176 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1177 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1179 _GL_CXXALIASWARN (wcsrchr);
1181 #elif defined GNULIB_POSIXCHECK
1183 # if HAVE_RAW_DECL_WCSRCHR
1184 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1185 "use gnulib module wcsrchr for portability");
1190 /* Return the length of the initial segmet of WCS which consists entirely
1191 of wide characters not in REJECT. */
1194 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1195 _GL_ATTRIBUTE_PURE);
1197 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1198 _GL_CXXALIASWARN (wcscspn);
1199 #elif defined GNULIB_POSIXCHECK
1201 # if HAVE_RAW_DECL_WCSCSPN
1202 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1203 "use gnulib module wcscspn for portability");
1208 /* Return the length of the initial segmet of WCS which consists entirely
1209 of wide characters in ACCEPT. */
1212 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1213 _GL_ATTRIBUTE_PURE);
1215 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1216 _GL_CXXALIASWARN (wcsspn);
1217 #elif defined GNULIB_POSIXCHECK
1219 # if HAVE_RAW_DECL_WCSSPN
1220 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1221 "use gnulib module wcsspn for portability");
1226 /* Find the first occurrence in WCS of any character in ACCEPT. */
1229 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1230 (const wchar_t *wcs, const wchar_t *accept)
1231 _GL_ATTRIBUTE_PURE);
1233 /* On some systems, this function is defined as an overloaded function:
1235 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1236 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1238 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1239 wchar_t *, (const wchar_t *, const wchar_t *),
1240 const wchar_t *, (const wchar_t *, const wchar_t *));
1241 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1242 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1243 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1244 (wchar_t *wcs, const wchar_t *accept));
1245 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1246 (const wchar_t *wcs, const wchar_t *accept));
1248 _GL_CXXALIASWARN (wcspbrk);
1250 #elif defined GNULIB_POSIXCHECK
1252 # if HAVE_RAW_DECL_WCSPBRK
1253 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1254 "use gnulib module wcspbrk for portability");
1259 /* Find the first occurrence of NEEDLE in HAYSTACK. */
1262 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1263 (const wchar_t *haystack, const wchar_t *needle)
1264 _GL_ATTRIBUTE_PURE);
1266 /* On some systems, this function is defined as an overloaded function:
1268 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1269 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1271 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1272 wchar_t *, (const wchar_t *, const wchar_t *),
1273 const wchar_t *, (const wchar_t *, const wchar_t *));
1274 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1275 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1276 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1277 (wchar_t *haystack, const wchar_t *needle));
1278 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1279 (const wchar_t *haystack, const wchar_t *needle));
1281 _GL_CXXALIASWARN (wcsstr);
1283 #elif defined GNULIB_POSIXCHECK
1285 # if HAVE_RAW_DECL_WCSSTR
1286 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1287 "use gnulib module wcsstr for portability");
1292 /* Divide WCS into tokens separated by characters in DELIM. */
1295 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1296 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1298 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1299 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1300 _GL_CXXALIASWARN (wcstok);
1301 #elif defined GNULIB_POSIXCHECK
1303 # if HAVE_RAW_DECL_WCSTOK
1304 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1305 "use gnulib module wcstok for portability");
1310 /* Determine number of column positions required for first N wide
1311 characters (or fewer if S ends before this) in S. */
1314 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1316 # define wcswidth rpl_wcswidth
1318 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1319 _GL_ATTRIBUTE_PURE);
1320 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1323 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1324 _GL_ATTRIBUTE_PURE);
1326 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1328 _GL_CXXALIASWARN (wcswidth);
1329 #elif defined GNULIB_POSIXCHECK
1331 # if HAVE_RAW_DECL_WCSWIDTH
1332 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1333 "use gnulib module wcswidth for portability");
1338 #endif /* _GL_WCHAR_H */
1339 #endif /* _GL_WCHAR_H */