1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
4 Copyright (C) 2007-2015 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) \
35 && !defined __MINGW32__) \
37 && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \
38 || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
39 || defined _GL_ALREADY_INCLUDING_WCHAR_H)
40 /* Special invocation convention:
41 - Inside glibc and uClibc header files, but not MinGW.
42 - On HP-UX 11.00 we have a sequence of nested includes
43 <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
44 once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
45 and once directly. In both situations 'wint_t' is not yet defined,
46 therefore we cannot provide the function overrides; instead include only
47 the system's <wchar.h>.
48 - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
49 the latter includes <wchar.h>. But here, we have no way to detect whether
50 <wctype.h> is completely included or is still being included. */
52 #include_next <wchar.h>
55 /* Normal invocation convention. */
59 #define _GL_ALREADY_INCLUDING_WCHAR_H
62 # include <features.h> /* for __GLIBC__ */
65 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
67 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
68 included before <wchar.h>.
69 In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
71 But avoid namespace pollution on glibc systems. */
72 #if !(defined __GLIBC__ && !defined __UCLIBC__)
80 /* Include the original <wchar.h> if it exists.
81 Some builds of uClibc lack it. */
82 /* The include_next requires a split double-inclusion guard. */
84 # include_next <wchar.h>
87 #undef _GL_ALREADY_INCLUDING_WCHAR_H
92 /* The __attribute__ feature is available in gcc versions 2.5 and later.
93 The attribute __pure__ was added in gcc 2.96. */
94 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
95 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
97 # define _GL_ATTRIBUTE_PURE /* empty */
100 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
101 #ifndef _GL_CXXDEFS_H
102 #define _GL_CXXDEFS_H
104 /* The three most frequent use cases of these macros are:
106 * For providing a substitute for a function that is missing on some
107 platforms, but is declared and works fine on the platforms on which
112 _GL_FUNCDECL_SYS (foo, ...);
114 _GL_CXXALIAS_SYS (foo, ...);
115 _GL_CXXALIASWARN (foo);
116 #elif defined GNULIB_POSIXCHECK
120 * For providing a replacement for a function that exists on all platforms,
121 but is broken/insufficient and needs to be replaced on some platforms:
125 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
129 _GL_FUNCDECL_RPL (foo, ...);
130 _GL_CXXALIAS_RPL (foo, ...);
132 _GL_CXXALIAS_SYS (foo, ...);
134 _GL_CXXALIASWARN (foo);
135 #elif defined GNULIB_POSIXCHECK
139 * For providing a replacement for a function that exists on some platforms
140 but is broken/insufficient and needs to be replaced on some of them and
141 is additionally either missing or undeclared on some other platforms:
145 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
149 _GL_FUNCDECL_RPL (foo, ...);
150 _GL_CXXALIAS_RPL (foo, ...);
152 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
153 _GL_FUNCDECL_SYS (foo, ...);
155 _GL_CXXALIAS_SYS (foo, ...);
157 _GL_CXXALIASWARN (foo);
158 #elif defined GNULIB_POSIXCHECK
163 /* _GL_EXTERN_C declaration;
164 performs the declaration with C linkage. */
165 #if defined __cplusplus
166 # define _GL_EXTERN_C extern "C"
168 # define _GL_EXTERN_C extern
171 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
172 declares a replacement function, named rpl_func, with the given prototype,
173 consisting of return type, parameters, and attributes.
175 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
176 _GL_ARG_NONNULL ((1)));
178 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
179 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
180 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
181 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
183 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
184 declares the system function, named func, with the given prototype,
185 consisting of return type, parameters, and attributes.
187 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
188 _GL_ARG_NONNULL ((1)));
190 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
191 _GL_EXTERN_C rettype func parameters_and_attributes
193 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
194 declares a C++ alias called GNULIB_NAMESPACE::func
195 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
197 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
199 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
200 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
201 #if defined __cplusplus && defined GNULIB_NAMESPACE
202 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
203 namespace GNULIB_NAMESPACE \
205 rettype (*const func) parameters = ::rpl_func; \
207 _GL_EXTERN_C int _gl_cxxalias_dummy
209 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
210 _GL_EXTERN_C int _gl_cxxalias_dummy
213 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
214 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
215 except that the C function rpl_func may have a slightly different
216 declaration. A cast is used to silence the "invalid conversion" error
217 that would otherwise occur. */
218 #if defined __cplusplus && defined GNULIB_NAMESPACE
219 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
220 namespace GNULIB_NAMESPACE \
222 rettype (*const func) parameters = \
223 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
225 _GL_EXTERN_C int _gl_cxxalias_dummy
227 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
228 _GL_EXTERN_C int _gl_cxxalias_dummy
231 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
232 declares a C++ alias called GNULIB_NAMESPACE::func
233 that redirects to the system provided function func, if GNULIB_NAMESPACE
236 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
238 #if defined __cplusplus && defined GNULIB_NAMESPACE
239 /* If we were to write
240 rettype (*const func) parameters = ::func;
241 like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
242 better (remove an indirection through a 'static' pointer variable),
243 but then the _GL_CXXALIASWARN macro below would cause a warning not only
244 for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
245 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
246 namespace GNULIB_NAMESPACE \
248 static rettype (*func) parameters = ::func; \
250 _GL_EXTERN_C int _gl_cxxalias_dummy
252 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
253 _GL_EXTERN_C int _gl_cxxalias_dummy
256 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
257 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
258 except that the C function func may have a slightly different declaration.
259 A cast is used to silence the "invalid conversion" error that would
261 #if defined __cplusplus && defined GNULIB_NAMESPACE
262 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
263 namespace GNULIB_NAMESPACE \
265 static rettype (*func) parameters = \
266 reinterpret_cast<rettype(*)parameters>(::func); \
268 _GL_EXTERN_C int _gl_cxxalias_dummy
270 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
271 _GL_EXTERN_C int _gl_cxxalias_dummy
274 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
275 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
276 except that the C function is picked among a set of overloaded functions,
277 namely the one with rettype2 and parameters2. Two consecutive casts
278 are used to silence the "cannot find a match" and "invalid conversion"
279 errors that would otherwise occur. */
280 #if defined __cplusplus && defined GNULIB_NAMESPACE
281 /* The outer cast must be a reinterpret_cast.
282 The inner cast: When the function is defined as a set of overloaded
283 functions, it works as a static_cast<>, choosing the designated variant.
284 When the function is defined as a single variant, it works as a
285 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
286 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
287 namespace GNULIB_NAMESPACE \
289 static rettype (*func) parameters = \
290 reinterpret_cast<rettype(*)parameters>( \
291 (rettype2(*)parameters2)(::func)); \
293 _GL_EXTERN_C int _gl_cxxalias_dummy
295 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
296 _GL_EXTERN_C int _gl_cxxalias_dummy
299 /* _GL_CXXALIASWARN (func);
300 causes a warning to be emitted when ::func is used but not when
301 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
303 #if defined __cplusplus && defined GNULIB_NAMESPACE
304 # define _GL_CXXALIASWARN(func) \
305 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
306 # define _GL_CXXALIASWARN_1(func,namespace) \
307 _GL_CXXALIASWARN_2 (func, namespace)
308 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
309 we enable the warning only when not optimizing. */
311 # define _GL_CXXALIASWARN_2(func,namespace) \
312 _GL_WARN_ON_USE (func, \
313 "The symbol ::" #func " refers to the system function. " \
314 "Use " #namespace "::" #func " instead.")
315 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
316 # define _GL_CXXALIASWARN_2(func,namespace) \
317 extern __typeof__ (func) func
319 # define _GL_CXXALIASWARN_2(func,namespace) \
320 _GL_EXTERN_C int _gl_cxxalias_dummy
323 # define _GL_CXXALIASWARN(func) \
324 _GL_EXTERN_C int _gl_cxxalias_dummy
327 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
328 causes a warning to be emitted when the given overloaded variant of ::func
329 is used but not when GNULIB_NAMESPACE::func is used. */
330 #if defined __cplusplus && defined GNULIB_NAMESPACE
331 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
332 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
334 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
335 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
336 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
337 we enable the warning only when not optimizing. */
339 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
340 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
341 "The symbol ::" #func " refers to the system function. " \
342 "Use " #namespace "::" #func " instead.")
343 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
344 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
345 extern __typeof__ (func) func
347 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
348 _GL_EXTERN_C int _gl_cxxalias_dummy
351 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
352 _GL_EXTERN_C int _gl_cxxalias_dummy
355 #endif /* _GL_CXXDEFS_H */
357 /* The definition of _GL_ARG_NONNULL is copied here. */
358 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
359 that the values passed as arguments n, ..., m must be non-NULL pointers.
360 n = 1 stands for the first argument, n = 2 for the second argument etc. */
361 #ifndef _GL_ARG_NONNULL
362 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
363 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
365 # define _GL_ARG_NONNULL(params)
369 /* The definition of _GL_WARN_ON_USE is copied here. */
370 #ifndef _GL_WARN_ON_USE
372 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
373 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
374 # define _GL_WARN_ON_USE(function, message) \
375 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
376 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
377 /* Verify the existence of the function. */
378 # define _GL_WARN_ON_USE(function, message) \
379 extern __typeof__ (function) function
380 # else /* Unsupported. */
381 # define _GL_WARN_ON_USE(function, message) \
382 _GL_WARN_EXTERN_C int _gl_warn_on_use
386 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
387 is like _GL_WARN_ON_USE (function, "string"), except that the function is
388 declared with the given prototype, consisting of return type, parameters,
390 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
391 not work in this case. */
392 #ifndef _GL_WARN_ON_USE_CXX
393 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
394 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
395 extern rettype function parameters_and_attributes \
396 __attribute__ ((__warning__ (msg)))
397 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
398 /* Verify the existence of the function. */
399 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
400 extern rettype function parameters_and_attributes
401 # else /* Unsupported. */
402 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
403 _GL_WARN_EXTERN_C int _gl_warn_on_use
407 /* _GL_WARN_EXTERN_C declaration;
408 performs the declaration with C linkage. */
409 #ifndef _GL_WARN_EXTERN_C
410 # if defined __cplusplus
411 # define _GL_WARN_EXTERN_C extern "C"
413 # define _GL_WARN_EXTERN_C extern
418 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
419 #if !1 && !defined wint_t
425 /* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
426 This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
427 "unchanged by default argument promotions". Override it. */
428 # if defined _MSC_VER
429 # if !GNULIB_defined_wint_t
430 # include <crtdefs.h>
431 typedef unsigned int rpl_wint_t;
433 # define wint_t rpl_wint_t
434 # define GNULIB_defined_wint_t 1
438 # define WEOF ((wint_t) -1)
443 /* Override mbstate_t if it is too small.
444 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
445 implementing mbrtowc for encodings like UTF-8. */
447 # if !GNULIB_defined_mbstate_t
448 typedef int rpl_mbstate_t;
450 # define mbstate_t rpl_mbstate_t
451 # define GNULIB_defined_mbstate_t 1
456 /* Convert a single-byte character to a wide character. */
459 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
461 # define btowc rpl_btowc
463 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
464 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
467 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
469 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
471 _GL_CXXALIASWARN (btowc);
472 #elif defined GNULIB_POSIXCHECK
474 # if HAVE_RAW_DECL_BTOWC
475 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
476 "use gnulib module btowc for portability");
481 /* Convert a wide character to a single-byte character. */
484 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
486 # define wctob rpl_wctob
488 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
489 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
491 # if !defined wctob && !1
492 /* wctob is provided by gnulib, or wctob exists but is not declared. */
493 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
495 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
497 _GL_CXXALIASWARN (wctob);
498 #elif defined GNULIB_POSIXCHECK
500 # if HAVE_RAW_DECL_WCTOB
501 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
502 "use gnulib module wctob for portability");
507 /* Test whether *PS is in the initial state. */
510 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
512 # define mbsinit rpl_mbsinit
514 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
515 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
518 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
520 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
522 _GL_CXXALIASWARN (mbsinit);
523 #elif defined GNULIB_POSIXCHECK
525 # if HAVE_RAW_DECL_MBSINIT
526 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
527 "use gnulib module mbsinit for portability");
532 /* Convert a multibyte character to a wide character. */
535 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
537 # define mbrtowc rpl_mbrtowc
539 _GL_FUNCDECL_RPL (mbrtowc, size_t,
540 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
541 _GL_CXXALIAS_RPL (mbrtowc, size_t,
542 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
545 _GL_FUNCDECL_SYS (mbrtowc, size_t,
546 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
548 _GL_CXXALIAS_SYS (mbrtowc, size_t,
549 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
551 _GL_CXXALIASWARN (mbrtowc);
552 #elif defined GNULIB_POSIXCHECK
554 # if HAVE_RAW_DECL_MBRTOWC
555 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
556 "use gnulib module mbrtowc for portability");
561 /* Recognize a multibyte character. */
564 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
566 # define mbrlen rpl_mbrlen
568 _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
569 _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
572 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
574 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
576 _GL_CXXALIASWARN (mbrlen);
577 #elif defined GNULIB_POSIXCHECK
579 # if HAVE_RAW_DECL_MBRLEN
580 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
581 "use gnulib module mbrlen for portability");
586 /* Convert a string to a wide string. */
589 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
591 # define mbsrtowcs rpl_mbsrtowcs
593 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
594 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
595 _GL_ARG_NONNULL ((2)));
596 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
597 (wchar_t *dest, const char **srcp, size_t len,
601 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
602 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
603 _GL_ARG_NONNULL ((2)));
605 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
606 (wchar_t *dest, const char **srcp, size_t len,
609 _GL_CXXALIASWARN (mbsrtowcs);
610 #elif defined GNULIB_POSIXCHECK
612 # if HAVE_RAW_DECL_MBSRTOWCS
613 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
614 "use gnulib module mbsrtowcs for portability");
619 /* Convert a string to a wide string. */
622 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
624 # define mbsnrtowcs rpl_mbsnrtowcs
626 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
627 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
629 _GL_ARG_NONNULL ((2)));
630 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
631 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
635 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
636 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
638 _GL_ARG_NONNULL ((2)));
640 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
641 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
644 _GL_CXXALIASWARN (mbsnrtowcs);
645 #elif defined GNULIB_POSIXCHECK
647 # if HAVE_RAW_DECL_MBSNRTOWCS
648 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
649 "use gnulib module mbsnrtowcs for portability");
654 /* Convert a wide character to a multibyte character. */
657 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
659 # define wcrtomb rpl_wcrtomb
661 _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
662 _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
665 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
667 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
669 _GL_CXXALIASWARN (wcrtomb);
670 #elif defined GNULIB_POSIXCHECK
672 # if HAVE_RAW_DECL_WCRTOMB
673 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
674 "use gnulib module wcrtomb for portability");
679 /* Convert a wide string to a string. */
682 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
684 # define wcsrtombs rpl_wcsrtombs
686 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
687 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
688 _GL_ARG_NONNULL ((2)));
689 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
690 (char *dest, const wchar_t **srcp, size_t len,
694 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
695 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
696 _GL_ARG_NONNULL ((2)));
698 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
699 (char *dest, const wchar_t **srcp, size_t len,
702 _GL_CXXALIASWARN (wcsrtombs);
703 #elif defined GNULIB_POSIXCHECK
705 # if HAVE_RAW_DECL_WCSRTOMBS
706 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
707 "use gnulib module wcsrtombs for portability");
712 /* Convert a wide string to a string. */
715 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
717 # define wcsnrtombs rpl_wcsnrtombs
719 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
720 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
722 _GL_ARG_NONNULL ((2)));
723 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
724 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
728 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
729 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
731 _GL_ARG_NONNULL ((2)));
733 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
734 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
737 _GL_CXXALIASWARN (wcsnrtombs);
738 #elif defined GNULIB_POSIXCHECK
740 # if HAVE_RAW_DECL_WCSNRTOMBS
741 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
742 "use gnulib module wcsnrtombs for portability");
747 /* Return the number of screen columns needed for WC. */
750 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
752 # define wcwidth rpl_wcwidth
754 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
755 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
758 /* wcwidth exists but is not declared. */
759 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
761 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
763 _GL_CXXALIASWARN (wcwidth);
764 #elif defined GNULIB_POSIXCHECK
766 # if HAVE_RAW_DECL_WCWIDTH
767 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
768 "use gnulib module wcwidth for portability");
773 /* Search N wide characters of S for C. */
776 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
779 /* On some systems, this function is defined as an overloaded function:
781 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
782 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
784 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
785 wchar_t *, (const wchar_t *, wchar_t, size_t),
786 const wchar_t *, (const wchar_t *, wchar_t, size_t));
787 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
788 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
789 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
790 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
791 (const wchar_t *s, wchar_t c, size_t n));
793 _GL_CXXALIASWARN (wmemchr);
795 #elif defined GNULIB_POSIXCHECK
797 # if HAVE_RAW_DECL_WMEMCHR
798 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
799 "use gnulib module wmemchr for portability");
804 /* Compare N wide characters of S1 and S2. */
807 _GL_FUNCDECL_SYS (wmemcmp, int,
808 (const wchar_t *s1, const wchar_t *s2, size_t n)
811 _GL_CXXALIAS_SYS (wmemcmp, int,
812 (const wchar_t *s1, const wchar_t *s2, size_t n));
813 _GL_CXXALIASWARN (wmemcmp);
814 #elif defined GNULIB_POSIXCHECK
816 # if HAVE_RAW_DECL_WMEMCMP
817 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
818 "use gnulib module wmemcmp for portability");
823 /* Copy N wide characters of SRC to DEST. */
826 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
827 (wchar_t *dest, const wchar_t *src, size_t n));
829 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
830 (wchar_t *dest, const wchar_t *src, size_t n));
831 _GL_CXXALIASWARN (wmemcpy);
832 #elif defined GNULIB_POSIXCHECK
834 # if HAVE_RAW_DECL_WMEMCPY
835 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
836 "use gnulib module wmemcpy for portability");
841 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
842 overlapping memory areas. */
845 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
846 (wchar_t *dest, const wchar_t *src, size_t n));
848 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
849 (wchar_t *dest, const wchar_t *src, size_t n));
850 _GL_CXXALIASWARN (wmemmove);
851 #elif defined GNULIB_POSIXCHECK
853 # if HAVE_RAW_DECL_WMEMMOVE
854 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
855 "use gnulib module wmemmove for portability");
860 /* Set N wide characters of S to C. */
863 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
865 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
866 _GL_CXXALIASWARN (wmemset);
867 #elif defined GNULIB_POSIXCHECK
869 # if HAVE_RAW_DECL_WMEMSET
870 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
871 "use gnulib module wmemset for portability");
876 /* Return the number of wide characters in S. */
879 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
881 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
882 _GL_CXXALIASWARN (wcslen);
883 #elif defined GNULIB_POSIXCHECK
885 # if HAVE_RAW_DECL_WCSLEN
886 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
887 "use gnulib module wcslen for portability");
892 /* Return the number of wide characters in S, but at most MAXLEN. */
895 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
898 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
899 _GL_CXXALIASWARN (wcsnlen);
900 #elif defined GNULIB_POSIXCHECK
902 # if HAVE_RAW_DECL_WCSNLEN
903 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
904 "use gnulib module wcsnlen for portability");
909 /* Copy SRC to DEST. */
912 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
914 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
915 _GL_CXXALIASWARN (wcscpy);
916 #elif defined GNULIB_POSIXCHECK
918 # if HAVE_RAW_DECL_WCSCPY
919 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
920 "use gnulib module wcscpy for portability");
925 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
928 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
930 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
931 _GL_CXXALIASWARN (wcpcpy);
932 #elif defined GNULIB_POSIXCHECK
934 # if HAVE_RAW_DECL_WCPCPY
935 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
936 "use gnulib module wcpcpy for portability");
941 /* Copy no more than N wide characters of SRC to DEST. */
944 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
945 (wchar_t *dest, const wchar_t *src, size_t n));
947 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
948 (wchar_t *dest, const wchar_t *src, size_t n));
949 _GL_CXXALIASWARN (wcsncpy);
950 #elif defined GNULIB_POSIXCHECK
952 # if HAVE_RAW_DECL_WCSNCPY
953 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
954 "use gnulib module wcsncpy for portability");
959 /* Copy no more than N characters of SRC to DEST, returning the address of
960 the last character written into DEST. */
963 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
964 (wchar_t *dest, const wchar_t *src, size_t n));
966 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
967 (wchar_t *dest, const wchar_t *src, size_t n));
968 _GL_CXXALIASWARN (wcpncpy);
969 #elif defined GNULIB_POSIXCHECK
971 # if HAVE_RAW_DECL_WCPNCPY
972 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
973 "use gnulib module wcpncpy for portability");
978 /* Append SRC onto DEST. */
981 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
983 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
984 _GL_CXXALIASWARN (wcscat);
985 #elif defined GNULIB_POSIXCHECK
987 # if HAVE_RAW_DECL_WCSCAT
988 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
989 "use gnulib module wcscat for portability");
994 /* Append no more than N wide characters of SRC onto DEST. */
997 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
998 (wchar_t *dest, const wchar_t *src, size_t n));
1000 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
1001 (wchar_t *dest, const wchar_t *src, size_t n));
1002 _GL_CXXALIASWARN (wcsncat);
1003 #elif defined GNULIB_POSIXCHECK
1005 # if HAVE_RAW_DECL_WCSNCAT
1006 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1007 "use gnulib module wcsncat for portability");
1012 /* Compare S1 and S2. */
1015 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
1016 _GL_ATTRIBUTE_PURE);
1018 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1019 _GL_CXXALIASWARN (wcscmp);
1020 #elif defined GNULIB_POSIXCHECK
1022 # if HAVE_RAW_DECL_WCSCMP
1023 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1024 "use gnulib module wcscmp for portability");
1029 /* Compare no more than N wide characters of S1 and S2. */
1032 _GL_FUNCDECL_SYS (wcsncmp, int,
1033 (const wchar_t *s1, const wchar_t *s2, size_t n)
1034 _GL_ATTRIBUTE_PURE);
1036 _GL_CXXALIAS_SYS (wcsncmp, int,
1037 (const wchar_t *s1, const wchar_t *s2, size_t n));
1038 _GL_CXXALIASWARN (wcsncmp);
1039 #elif defined GNULIB_POSIXCHECK
1041 # if HAVE_RAW_DECL_WCSNCMP
1042 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1043 "use gnulib module wcsncmp for portability");
1048 /* Compare S1 and S2, ignoring case. */
1051 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
1052 _GL_ATTRIBUTE_PURE);
1054 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1055 _GL_CXXALIASWARN (wcscasecmp);
1056 #elif defined GNULIB_POSIXCHECK
1058 # if HAVE_RAW_DECL_WCSCASECMP
1059 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1060 "use gnulib module wcscasecmp for portability");
1065 /* Compare no more than N chars of S1 and S2, ignoring case. */
1068 _GL_FUNCDECL_SYS (wcsncasecmp, int,
1069 (const wchar_t *s1, const wchar_t *s2, size_t n)
1070 _GL_ATTRIBUTE_PURE);
1072 _GL_CXXALIAS_SYS (wcsncasecmp, int,
1073 (const wchar_t *s1, const wchar_t *s2, size_t n));
1074 _GL_CXXALIASWARN (wcsncasecmp);
1075 #elif defined GNULIB_POSIXCHECK
1077 # if HAVE_RAW_DECL_WCSNCASECMP
1078 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1079 "use gnulib module wcsncasecmp for portability");
1084 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
1085 category of the current locale. */
1088 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1090 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1091 _GL_CXXALIASWARN (wcscoll);
1092 #elif defined GNULIB_POSIXCHECK
1094 # if HAVE_RAW_DECL_WCSCOLL
1095 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1096 "use gnulib module wcscoll for portability");
1101 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
1102 to two transformed strings the result is the as applying 'wcscoll' to the
1103 original strings. */
1106 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1108 _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1109 _GL_CXXALIASWARN (wcsxfrm);
1110 #elif defined GNULIB_POSIXCHECK
1112 # if HAVE_RAW_DECL_WCSXFRM
1113 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1114 "use gnulib module wcsxfrm for portability");
1119 /* Duplicate S, returning an identical malloc'd string. */
1122 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1124 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1125 _GL_CXXALIASWARN (wcsdup);
1126 #elif defined GNULIB_POSIXCHECK
1128 # if HAVE_RAW_DECL_WCSDUP
1129 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1130 "use gnulib module wcsdup for portability");
1135 /* Find the first occurrence of WC in WCS. */
1138 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1139 _GL_ATTRIBUTE_PURE);
1141 /* On some systems, this function is defined as an overloaded function:
1143 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1144 wchar_t * std::wcschr (wchar_t *, wchar_t);
1146 _GL_CXXALIAS_SYS_CAST2 (wcschr,
1147 wchar_t *, (const wchar_t *, wchar_t),
1148 const wchar_t *, (const wchar_t *, wchar_t));
1149 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1150 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1151 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1152 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1154 _GL_CXXALIASWARN (wcschr);
1156 #elif defined GNULIB_POSIXCHECK
1158 # if HAVE_RAW_DECL_WCSCHR
1159 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1160 "use gnulib module wcschr for portability");
1165 /* Find the last occurrence of WC in WCS. */
1168 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1169 _GL_ATTRIBUTE_PURE);
1171 /* On some systems, this function is defined as an overloaded function:
1173 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1174 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1176 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1177 wchar_t *, (const wchar_t *, wchar_t),
1178 const wchar_t *, (const wchar_t *, wchar_t));
1179 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1180 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1181 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1182 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1184 _GL_CXXALIASWARN (wcsrchr);
1186 #elif defined GNULIB_POSIXCHECK
1188 # if HAVE_RAW_DECL_WCSRCHR
1189 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1190 "use gnulib module wcsrchr for portability");
1195 /* Return the length of the initial segmet of WCS which consists entirely
1196 of wide characters not in REJECT. */
1199 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1200 _GL_ATTRIBUTE_PURE);
1202 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1203 _GL_CXXALIASWARN (wcscspn);
1204 #elif defined GNULIB_POSIXCHECK
1206 # if HAVE_RAW_DECL_WCSCSPN
1207 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1208 "use gnulib module wcscspn for portability");
1213 /* Return the length of the initial segmet of WCS which consists entirely
1214 of wide characters in ACCEPT. */
1217 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1218 _GL_ATTRIBUTE_PURE);
1220 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1221 _GL_CXXALIASWARN (wcsspn);
1222 #elif defined GNULIB_POSIXCHECK
1224 # if HAVE_RAW_DECL_WCSSPN
1225 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1226 "use gnulib module wcsspn for portability");
1231 /* Find the first occurrence in WCS of any character in ACCEPT. */
1234 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1235 (const wchar_t *wcs, const wchar_t *accept)
1236 _GL_ATTRIBUTE_PURE);
1238 /* On some systems, this function is defined as an overloaded function:
1240 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1241 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1243 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1244 wchar_t *, (const wchar_t *, const wchar_t *),
1245 const wchar_t *, (const wchar_t *, const wchar_t *));
1246 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1247 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1248 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1249 (wchar_t *wcs, const wchar_t *accept));
1250 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1251 (const wchar_t *wcs, const wchar_t *accept));
1253 _GL_CXXALIASWARN (wcspbrk);
1255 #elif defined GNULIB_POSIXCHECK
1257 # if HAVE_RAW_DECL_WCSPBRK
1258 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1259 "use gnulib module wcspbrk for portability");
1264 /* Find the first occurrence of NEEDLE in HAYSTACK. */
1267 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1268 (const wchar_t *haystack, const wchar_t *needle)
1269 _GL_ATTRIBUTE_PURE);
1271 /* On some systems, this function is defined as an overloaded function:
1273 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1274 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1276 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1277 wchar_t *, (const wchar_t *, const wchar_t *),
1278 const wchar_t *, (const wchar_t *, const wchar_t *));
1279 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1280 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1281 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1282 (wchar_t *haystack, const wchar_t *needle));
1283 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1284 (const wchar_t *haystack, const wchar_t *needle));
1286 _GL_CXXALIASWARN (wcsstr);
1288 #elif defined GNULIB_POSIXCHECK
1290 # if HAVE_RAW_DECL_WCSSTR
1291 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1292 "use gnulib module wcsstr for portability");
1297 /* Divide WCS into tokens separated by characters in DELIM. */
1300 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1301 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1303 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1304 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1305 _GL_CXXALIASWARN (wcstok);
1306 #elif defined GNULIB_POSIXCHECK
1308 # if HAVE_RAW_DECL_WCSTOK
1309 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1310 "use gnulib module wcstok for portability");
1315 /* Determine number of column positions required for first N wide
1316 characters (or fewer if S ends before this) in S. */
1319 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1321 # define wcswidth rpl_wcswidth
1323 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1324 _GL_ATTRIBUTE_PURE);
1325 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1328 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1329 _GL_ATTRIBUTE_PURE);
1331 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1333 _GL_CXXALIASWARN (wcswidth);
1334 #elif defined GNULIB_POSIXCHECK
1336 # if HAVE_RAW_DECL_WCSWIDTH
1337 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1338 "use gnulib module wcswidth for portability");
1343 #endif /* _GL_WCHAR_H */
1344 #endif /* _GL_WCHAR_H */