blob: 54631a3451d11e1524cb42e5da1ea5170e6f9b36 [file] [log] [blame]
Ying Wang05436632013-04-05 16:01:00 -07001/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
3
4 Copyright (C) 2007-2012 Free Software Foundation, Inc.
5
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)
9 any later version.
10
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.
15
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/>. */
18
19/* Written by Eric Blake. */
20
21/*
22 * ISO C 99 <wchar.h> for platforms that have issues.
23 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
24 *
25 * For now, this just ensures proper prerequisite inclusion order and
26 * the declaration of wcwidth().
27 */
28
29#if __GNUC__ >= 3
30#pragma GCC system_header
31#endif
32
33
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. */
46
47#include_next <wchar.h>
48
49#else
50/* Normal invocation convention. */
51
52#ifndef _GL_WCHAR_H
53
54#define _GL_ALREADY_INCLUDING_WCHAR_H
55
56#if 1
57# include <features.h> /* for __GLIBC__ */
58#endif
59
60/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
61 <wchar.h>.
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
65 by <stddef.h>.
66 But avoid namespace pollution on glibc systems. */
67#if !(defined __GLIBC__ && !defined __UCLIBC__)
68# include <stddef.h>
69#endif
70#ifndef __GLIBC__
71# include <stdio.h>
72# include <time.h>
73#endif
74
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. */
78#if 1
79# include_next <wchar.h>
80#endif
81
82#undef _GL_ALREADY_INCLUDING_WCHAR_H
83
84#ifndef _GL_WCHAR_H
85#define _GL_WCHAR_H
86
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__))
91#else
92# define _GL_ATTRIBUTE_PURE /* empty */
93#endif
94
95/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
96#ifndef _GL_CXXDEFS_H
97#define _GL_CXXDEFS_H
98
99/* The three most frequent use cases of these macros are:
100
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
103 it exists:
104
105 #if @GNULIB_FOO@
106 # if !@HAVE_FOO@
107 _GL_FUNCDECL_SYS (foo, ...);
108 # endif
109 _GL_CXXALIAS_SYS (foo, ...);
110 _GL_CXXALIASWARN (foo);
111 #elif defined GNULIB_POSIXCHECK
112 ...
113 #endif
114
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:
117
118 #if @GNULIB_FOO@
119 # if @REPLACE_FOO@
120 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
121 # undef foo
122 # define foo rpl_foo
123 # endif
124 _GL_FUNCDECL_RPL (foo, ...);
125 _GL_CXXALIAS_RPL (foo, ...);
126 # else
127 _GL_CXXALIAS_SYS (foo, ...);
128 # endif
129 _GL_CXXALIASWARN (foo);
130 #elif defined GNULIB_POSIXCHECK
131 ...
132 #endif
133
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:
137
138 #if @GNULIB_FOO@
139 # if @REPLACE_FOO@
140 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
141 # undef foo
142 # define foo rpl_foo
143 # endif
144 _GL_FUNCDECL_RPL (foo, ...);
145 _GL_CXXALIAS_RPL (foo, ...);
146 # else
147 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
148 _GL_FUNCDECL_SYS (foo, ...);
149 # endif
150 _GL_CXXALIAS_SYS (foo, ...);
151 # endif
152 _GL_CXXALIASWARN (foo);
153 #elif defined GNULIB_POSIXCHECK
154 ...
155 #endif
156*/
157
158/* _GL_EXTERN_C declaration;
159 performs the declaration with C linkage. */
160#if defined __cplusplus
161# define _GL_EXTERN_C extern "C"
162#else
163# define _GL_EXTERN_C extern
164#endif
165
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.
169 Example:
170 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
171 _GL_ARG_NONNULL ((1)));
172 */
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
177
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.
181 Example:
182 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
183 _GL_ARG_NONNULL ((1)));
184 */
185#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
186 _GL_EXTERN_C rettype func parameters_and_attributes
187
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.
191 Example:
192 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
193 */
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 \
199 { \
200 rettype (*const func) parameters = ::rpl_func; \
201 } \
202 _GL_EXTERN_C int _gl_cxxalias_dummy
203#else
204# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
205 _GL_EXTERN_C int _gl_cxxalias_dummy
206#endif
207
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 \
216 { \
217 rettype (*const func) parameters = \
218 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
219 } \
220 _GL_EXTERN_C int _gl_cxxalias_dummy
221#else
222# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
223 _GL_EXTERN_C int _gl_cxxalias_dummy
224#endif
225
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
229 is defined.
230 Example:
231 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
232 */
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 \
242 { \
243 static rettype (*func) parameters = ::func; \
244 } \
245 _GL_EXTERN_C int _gl_cxxalias_dummy
246#else
247# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
248 _GL_EXTERN_C int _gl_cxxalias_dummy
249#endif
250
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
255 otherwise occur. */
256#if defined __cplusplus && defined GNULIB_NAMESPACE
257# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
258 namespace GNULIB_NAMESPACE \
259 { \
260 static rettype (*func) parameters = \
261 reinterpret_cast<rettype(*)parameters>(::func); \
262 } \
263 _GL_EXTERN_C int _gl_cxxalias_dummy
264#else
265# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
266 _GL_EXTERN_C int _gl_cxxalias_dummy
267#endif
268
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 \
283 { \
284 static rettype (*func) parameters = \
285 reinterpret_cast<rettype(*)parameters>( \
286 (rettype2(*)parameters2)(::func)); \
287 } \
288 _GL_EXTERN_C int _gl_cxxalias_dummy
289#else
290# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
291 _GL_EXTERN_C int _gl_cxxalias_dummy
292#endif
293
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
297 variants. */
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. */
305# if !__OPTIMIZE__
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
313# else
314# define _GL_CXXALIASWARN_2(func,namespace) \
315 _GL_EXTERN_C int _gl_cxxalias_dummy
316# endif
317#else
318# define _GL_CXXALIASWARN(func) \
319 _GL_EXTERN_C int _gl_cxxalias_dummy
320#endif
321
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, \
328 GNULIB_NAMESPACE)
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. */
333# if !__OPTIMIZE__
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
341# else
342# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
343 _GL_EXTERN_C int _gl_cxxalias_dummy
344# endif
345#else
346# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
347 _GL_EXTERN_C int _gl_cxxalias_dummy
348#endif
349
350#endif /* _GL_CXXDEFS_H */
351
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))
359# else
360# define _GL_ARG_NONNULL(params)
361# endif
362#endif
363
364/* The definition of _GL_WARN_ON_USE is copied here. */
365#ifndef _GL_WARN_ON_USE
366
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) \
370extern __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) \
374extern __typeof__ (function) function
375# else /* Unsupported. */
376# define _GL_WARN_ON_USE(function, message) \
377_GL_WARN_EXTERN_C int _gl_warn_on_use
378# endif
379#endif
380
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,
384 and attributes.
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) \
390extern 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) \
395extern 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
399# endif
400#endif
401
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"
407# else
408# define _GL_WARN_EXTERN_C extern
409# endif
410#endif
411
412
413/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
414#if !1 && !defined wint_t
415# define wint_t int
416# ifndef WEOF
417# define WEOF -1
418# endif
419#else
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>
426typedef unsigned int rpl_wint_t;
427# undef wint_t
428# define wint_t rpl_wint_t
429# define GNULIB_defined_wint_t 1
430# endif
431# endif
432# ifndef WEOF
433# define WEOF ((wint_t) -1)
434# endif
435#endif
436
437
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. */
441#if !(1 && 1) || 0
442# if !GNULIB_defined_mbstate_t
443typedef int rpl_mbstate_t;
444# undef mbstate_t
445# define mbstate_t rpl_mbstate_t
446# define GNULIB_defined_mbstate_t 1
447# endif
448#endif
449
450
451/* Convert a single-byte character to a wide character. */
452#if 0
453# if 0
454# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
455# undef btowc
456# define btowc rpl_btowc
457# endif
458_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
459_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
460# else
461# if !1
462_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
463# endif
464_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
465# endif
466_GL_CXXALIASWARN (btowc);
467#elif defined GNULIB_POSIXCHECK
468# undef btowc
469# if HAVE_RAW_DECL_BTOWC
470_GL_WARN_ON_USE (btowc, "btowc is unportable - "
471 "use gnulib module btowc for portability");
472# endif
473#endif
474
475
476/* Convert a wide character to a single-byte character. */
477#if 0
478# if 0
479# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
480# undef wctob
481# define wctob rpl_wctob
482# endif
483_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
484_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
485# else
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);
489# endif
490_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
491# endif
492_GL_CXXALIASWARN (wctob);
493#elif defined GNULIB_POSIXCHECK
494# undef wctob
495# if HAVE_RAW_DECL_WCTOB
496_GL_WARN_ON_USE (wctob, "wctob is unportable - "
497 "use gnulib module wctob for portability");
498# endif
499#endif
500
501
502/* Test whether *PS is in the initial state. */
503#if 1
504# if 0
505# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
506# undef mbsinit
507# define mbsinit rpl_mbsinit
508# endif
509_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
510_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
511# else
512# if !1
513_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
514# endif
515_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
516# endif
517_GL_CXXALIASWARN (mbsinit);
518#elif defined GNULIB_POSIXCHECK
519# undef mbsinit
520# if HAVE_RAW_DECL_MBSINIT
521_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
522 "use gnulib module mbsinit for portability");
523# endif
524#endif
525
526
527/* Convert a multibyte character to a wide character. */
528#if 1
529# if 0
530# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
531# undef mbrtowc
532# define mbrtowc rpl_mbrtowc
533# endif
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));
538# else
539# if !1
540_GL_FUNCDECL_SYS (mbrtowc, size_t,
541 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
542# endif
543_GL_CXXALIAS_SYS (mbrtowc, size_t,
544 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
545# endif
546_GL_CXXALIASWARN (mbrtowc);
547#elif defined GNULIB_POSIXCHECK
548# undef mbrtowc
549# if HAVE_RAW_DECL_MBRTOWC
550_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
551 "use gnulib module mbrtowc for portability");
552# endif
553#endif
554
555
556/* Recognize a multibyte character. */
557#if 0
558# if 0
559# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
560# undef mbrlen
561# define mbrlen rpl_mbrlen
562# endif
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));
565# else
566# if !1
567_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
568# endif
569_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
570# endif
571_GL_CXXALIASWARN (mbrlen);
572#elif defined GNULIB_POSIXCHECK
573# undef mbrlen
574# if HAVE_RAW_DECL_MBRLEN
575_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
576 "use gnulib module mbrlen for portability");
577# endif
578#endif
579
580
581/* Convert a string to a wide string. */
582#if 0
583# if 0
584# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
585# undef mbsrtowcs
586# define mbsrtowcs rpl_mbsrtowcs
587# endif
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,
593 mbstate_t *ps));
594# else
595# if !1
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)));
599# endif
600_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
601 (wchar_t *dest, const char **srcp, size_t len,
602 mbstate_t *ps));
603# endif
604_GL_CXXALIASWARN (mbsrtowcs);
605#elif defined GNULIB_POSIXCHECK
606# undef mbsrtowcs
607# if HAVE_RAW_DECL_MBSRTOWCS
608_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
609 "use gnulib module mbsrtowcs for portability");
610# endif
611#endif
612
613
614/* Convert a string to a wide string. */
615#if 0
616# if 0
617# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
618# undef mbsnrtowcs
619# define mbsnrtowcs rpl_mbsnrtowcs
620# endif
621_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
622 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
623 mbstate_t *ps)
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,
627 mbstate_t *ps));
628# else
629# if !1
630_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
631 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
632 mbstate_t *ps)
633 _GL_ARG_NONNULL ((2)));
634# endif
635_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
636 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
637 mbstate_t *ps));
638# endif
639_GL_CXXALIASWARN (mbsnrtowcs);
640#elif defined GNULIB_POSIXCHECK
641# undef mbsnrtowcs
642# if HAVE_RAW_DECL_MBSNRTOWCS
643_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
644 "use gnulib module mbsnrtowcs for portability");
645# endif
646#endif
647
648
649/* Convert a wide character to a multibyte character. */
650#if 0
651# if 0
652# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
653# undef wcrtomb
654# define wcrtomb rpl_wcrtomb
655# endif
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));
658# else
659# if !1
660_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
661# endif
662_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
663# endif
664_GL_CXXALIASWARN (wcrtomb);
665#elif defined GNULIB_POSIXCHECK
666# undef wcrtomb
667# if HAVE_RAW_DECL_WCRTOMB
668_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
669 "use gnulib module wcrtomb for portability");
670# endif
671#endif
672
673
674/* Convert a wide string to a string. */
675#if 0
676# if 0
677# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
678# undef wcsrtombs
679# define wcsrtombs rpl_wcsrtombs
680# endif
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,
686 mbstate_t *ps));
687# else
688# if !1
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)));
692# endif
693_GL_CXXALIAS_SYS (wcsrtombs, size_t,
694 (char *dest, const wchar_t **srcp, size_t len,
695 mbstate_t *ps));
696# endif
697_GL_CXXALIASWARN (wcsrtombs);
698#elif defined GNULIB_POSIXCHECK
699# undef wcsrtombs
700# if HAVE_RAW_DECL_WCSRTOMBS
701_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
702 "use gnulib module wcsrtombs for portability");
703# endif
704#endif
705
706
707/* Convert a wide string to a string. */
708#if 0
709# if 0
710# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
711# undef wcsnrtombs
712# define wcsnrtombs rpl_wcsnrtombs
713# endif
714_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
715 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
716 mbstate_t *ps)
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,
720 mbstate_t *ps));
721# else
722# if !1
723_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
724 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
725 mbstate_t *ps)
726 _GL_ARG_NONNULL ((2)));
727# endif
728_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
729 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
730 mbstate_t *ps));
731# endif
732_GL_CXXALIASWARN (wcsnrtombs);
733#elif defined GNULIB_POSIXCHECK
734# undef wcsnrtombs
735# if HAVE_RAW_DECL_WCSNRTOMBS
736_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
737 "use gnulib module wcsnrtombs for portability");
738# endif
739#endif
740
741
742/* Return the number of screen columns needed for WC. */
743#if 1
744# if 0
745# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
746# undef wcwidth
747# define wcwidth rpl_wcwidth
748# endif
749_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
750_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
751# else
752# if !1
753/* wcwidth exists but is not declared. */
754_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
755# endif
756_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
757# endif
758_GL_CXXALIASWARN (wcwidth);
759#elif defined GNULIB_POSIXCHECK
760# undef wcwidth
761# if HAVE_RAW_DECL_WCWIDTH
762_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
763 "use gnulib module wcwidth for portability");
764# endif
765#endif
766
767
768/* Search N wide characters of S for C. */
769#if 0
770# if !1
771_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
772 _GL_ATTRIBUTE_PURE);
773# endif
774 /* On some systems, this function is defined as an overloaded function:
775 extern "C++" {
776 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
777 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
778 } */
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));
787# else
788_GL_CXXALIASWARN (wmemchr);
789# endif
790#elif defined GNULIB_POSIXCHECK
791# undef wmemchr
792# if HAVE_RAW_DECL_WMEMCHR
793_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
794 "use gnulib module wmemchr for portability");
795# endif
796#endif
797
798
799/* Compare N wide characters of S1 and S2. */
800#if 0
801# if !1
802_GL_FUNCDECL_SYS (wmemcmp, int,
803 (const wchar_t *s1, const wchar_t *s2, size_t n)
804 _GL_ATTRIBUTE_PURE);
805# endif
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
810# undef wmemcmp
811# if HAVE_RAW_DECL_WMEMCMP
812_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
813 "use gnulib module wmemcmp for portability");
814# endif
815#endif
816
817
818/* Copy N wide characters of SRC to DEST. */
819#if 0
820# if !1
821_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
822 (wchar_t *dest, const wchar_t *src, size_t n));
823# endif
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
828# undef wmemcpy
829# if HAVE_RAW_DECL_WMEMCPY
830_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
831 "use gnulib module wmemcpy for portability");
832# endif
833#endif
834
835
836/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
837 overlapping memory areas. */
838#if 0
839# if !1
840_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
841 (wchar_t *dest, const wchar_t *src, size_t n));
842# endif
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
847# undef wmemmove
848# if HAVE_RAW_DECL_WMEMMOVE
849_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
850 "use gnulib module wmemmove for portability");
851# endif
852#endif
853
854
855/* Set N wide characters of S to C. */
856#if 0
857# if !1
858_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
859# endif
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
863# undef wmemset
864# if HAVE_RAW_DECL_WMEMSET
865_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
866 "use gnulib module wmemset for portability");
867# endif
868#endif
869
870
871/* Return the number of wide characters in S. */
872#if 0
873# if !1
874_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
875# endif
876_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
877_GL_CXXALIASWARN (wcslen);
878#elif defined GNULIB_POSIXCHECK
879# undef wcslen
880# if HAVE_RAW_DECL_WCSLEN
881_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
882 "use gnulib module wcslen for portability");
883# endif
884#endif
885
886
887/* Return the number of wide characters in S, but at most MAXLEN. */
888#if 0
889# if !1
890_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
891 _GL_ATTRIBUTE_PURE);
892# endif
893_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
894_GL_CXXALIASWARN (wcsnlen);
895#elif defined GNULIB_POSIXCHECK
896# undef wcsnlen
897# if HAVE_RAW_DECL_WCSNLEN
898_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
899 "use gnulib module wcsnlen for portability");
900# endif
901#endif
902
903
904/* Copy SRC to DEST. */
905#if 0
906# if !1
907_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
908# endif
909_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
910_GL_CXXALIASWARN (wcscpy);
911#elif defined GNULIB_POSIXCHECK
912# undef wcscpy
913# if HAVE_RAW_DECL_WCSCPY
914_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
915 "use gnulib module wcscpy for portability");
916# endif
917#endif
918
919
920/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
921#if 0
922# if !1
923_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
924# endif
925_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
926_GL_CXXALIASWARN (wcpcpy);
927#elif defined GNULIB_POSIXCHECK
928# undef wcpcpy
929# if HAVE_RAW_DECL_WCPCPY
930_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
931 "use gnulib module wcpcpy for portability");
932# endif
933#endif
934
935
936/* Copy no more than N wide characters of SRC to DEST. */
937#if 0
938# if !1
939_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
940 (wchar_t *dest, const wchar_t *src, size_t n));
941# endif
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
946# undef wcsncpy
947# if HAVE_RAW_DECL_WCSNCPY
948_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
949 "use gnulib module wcsncpy for portability");
950# endif
951#endif
952
953
954/* Copy no more than N characters of SRC to DEST, returning the address of
955 the last character written into DEST. */
956#if 0
957# if !1
958_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
959 (wchar_t *dest, const wchar_t *src, size_t n));
960# endif
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
965# undef wcpncpy
966# if HAVE_RAW_DECL_WCPNCPY
967_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
968 "use gnulib module wcpncpy for portability");
969# endif
970#endif
971
972
973/* Append SRC onto DEST. */
974#if 0
975# if !1
976_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
977# endif
978_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
979_GL_CXXALIASWARN (wcscat);
980#elif defined GNULIB_POSIXCHECK
981# undef wcscat
982# if HAVE_RAW_DECL_WCSCAT
983_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
984 "use gnulib module wcscat for portability");
985# endif
986#endif
987
988
989/* Append no more than N wide characters of SRC onto DEST. */
990#if 0
991# if !1
992_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
993 (wchar_t *dest, const wchar_t *src, size_t n));
994# endif
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
999# undef wcsncat
1000# if HAVE_RAW_DECL_WCSNCAT
1001_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1002 "use gnulib module wcsncat for portability");
1003# endif
1004#endif
1005
1006
1007/* Compare S1 and S2. */
1008#if 0
1009# if !1
1010_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
1011 _GL_ATTRIBUTE_PURE);
1012# endif
1013_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1014_GL_CXXALIASWARN (wcscmp);
1015#elif defined GNULIB_POSIXCHECK
1016# undef wcscmp
1017# if HAVE_RAW_DECL_WCSCMP
1018_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1019 "use gnulib module wcscmp for portability");
1020# endif
1021#endif
1022
1023
1024/* Compare no more than N wide characters of S1 and S2. */
1025#if 0
1026# if !1
1027_GL_FUNCDECL_SYS (wcsncmp, int,
1028 (const wchar_t *s1, const wchar_t *s2, size_t n)
1029 _GL_ATTRIBUTE_PURE);
1030# endif
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
1035# undef wcsncmp
1036# if HAVE_RAW_DECL_WCSNCMP
1037_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1038 "use gnulib module wcsncmp for portability");
1039# endif
1040#endif
1041
1042
1043/* Compare S1 and S2, ignoring case. */
1044#if 0
1045# if !1
1046_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
1047 _GL_ATTRIBUTE_PURE);
1048# endif
1049_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1050_GL_CXXALIASWARN (wcscasecmp);
1051#elif defined GNULIB_POSIXCHECK
1052# undef wcscasecmp
1053# if HAVE_RAW_DECL_WCSCASECMP
1054_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1055 "use gnulib module wcscasecmp for portability");
1056# endif
1057#endif
1058
1059
1060/* Compare no more than N chars of S1 and S2, ignoring case. */
1061#if 0
1062# if !1
1063_GL_FUNCDECL_SYS (wcsncasecmp, int,
1064 (const wchar_t *s1, const wchar_t *s2, size_t n)
1065 _GL_ATTRIBUTE_PURE);
1066# endif
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
1071# undef wcsncasecmp
1072# if HAVE_RAW_DECL_WCSNCASECMP
1073_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1074 "use gnulib module wcsncasecmp for portability");
1075# endif
1076#endif
1077
1078
1079/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
1080 category of the current locale. */
1081#if 0
1082# if !1
1083_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1084# endif
1085_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1086_GL_CXXALIASWARN (wcscoll);
1087#elif defined GNULIB_POSIXCHECK
1088# undef wcscoll
1089# if HAVE_RAW_DECL_WCSCOLL
1090_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1091 "use gnulib module wcscoll for portability");
1092# endif
1093#endif
1094
1095
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. */
1099#if 0
1100# if !1
1101_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1102# endif
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
1106# undef wcsxfrm
1107# if HAVE_RAW_DECL_WCSXFRM
1108_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1109 "use gnulib module wcsxfrm for portability");
1110# endif
1111#endif
1112
1113
1114/* Duplicate S, returning an identical malloc'd string. */
1115#if 0
1116# if !1
1117_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1118# endif
1119_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1120_GL_CXXALIASWARN (wcsdup);
1121#elif defined GNULIB_POSIXCHECK
1122# undef wcsdup
1123# if HAVE_RAW_DECL_WCSDUP
1124_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1125 "use gnulib module wcsdup for portability");
1126# endif
1127#endif
1128
1129
1130/* Find the first occurrence of WC in WCS. */
1131#if 0
1132# if !1
1133_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1134 _GL_ATTRIBUTE_PURE);
1135# endif
1136 /* On some systems, this function is defined as an overloaded function:
1137 extern "C++" {
1138 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1139 wchar_t * std::wcschr (wchar_t *, wchar_t);
1140 } */
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));
1148# else
1149_GL_CXXALIASWARN (wcschr);
1150# endif
1151#elif defined GNULIB_POSIXCHECK
1152# undef wcschr
1153# if HAVE_RAW_DECL_WCSCHR
1154_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1155 "use gnulib module wcschr for portability");
1156# endif
1157#endif
1158
1159
1160/* Find the last occurrence of WC in WCS. */
1161#if 0
1162# if !1
1163_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1164 _GL_ATTRIBUTE_PURE);
1165# endif
1166 /* On some systems, this function is defined as an overloaded function:
1167 extern "C++" {
1168 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1169 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1170 } */
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));
1178# else
1179_GL_CXXALIASWARN (wcsrchr);
1180# endif
1181#elif defined GNULIB_POSIXCHECK
1182# undef wcsrchr
1183# if HAVE_RAW_DECL_WCSRCHR
1184_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1185 "use gnulib module wcsrchr for portability");
1186# endif
1187#endif
1188
1189
1190/* Return the length of the initial segmet of WCS which consists entirely
1191 of wide characters not in REJECT. */
1192#if 0
1193# if !1
1194_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1195 _GL_ATTRIBUTE_PURE);
1196# endif
1197_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1198_GL_CXXALIASWARN (wcscspn);
1199#elif defined GNULIB_POSIXCHECK
1200# undef wcscspn
1201# if HAVE_RAW_DECL_WCSCSPN
1202_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1203 "use gnulib module wcscspn for portability");
1204# endif
1205#endif
1206
1207
1208/* Return the length of the initial segmet of WCS which consists entirely
1209 of wide characters in ACCEPT. */
1210#if 0
1211# if !1
1212_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1213 _GL_ATTRIBUTE_PURE);
1214# endif
1215_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1216_GL_CXXALIASWARN (wcsspn);
1217#elif defined GNULIB_POSIXCHECK
1218# undef wcsspn
1219# if HAVE_RAW_DECL_WCSSPN
1220_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1221 "use gnulib module wcsspn for portability");
1222# endif
1223#endif
1224
1225
1226/* Find the first occurrence in WCS of any character in ACCEPT. */
1227#if 0
1228# if !1
1229_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1230 (const wchar_t *wcs, const wchar_t *accept)
1231 _GL_ATTRIBUTE_PURE);
1232# endif
1233 /* On some systems, this function is defined as an overloaded function:
1234 extern "C++" {
1235 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1236 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1237 } */
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));
1247# else
1248_GL_CXXALIASWARN (wcspbrk);
1249# endif
1250#elif defined GNULIB_POSIXCHECK
1251# undef wcspbrk
1252# if HAVE_RAW_DECL_WCSPBRK
1253_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1254 "use gnulib module wcspbrk for portability");
1255# endif
1256#endif
1257
1258
1259/* Find the first occurrence of NEEDLE in HAYSTACK. */
1260#if 0
1261# if !1
1262_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1263 (const wchar_t *haystack, const wchar_t *needle)
1264 _GL_ATTRIBUTE_PURE);
1265# endif
1266 /* On some systems, this function is defined as an overloaded function:
1267 extern "C++" {
1268 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1269 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1270 } */
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));
1280# else
1281_GL_CXXALIASWARN (wcsstr);
1282# endif
1283#elif defined GNULIB_POSIXCHECK
1284# undef wcsstr
1285# if HAVE_RAW_DECL_WCSSTR
1286_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1287 "use gnulib module wcsstr for portability");
1288# endif
1289#endif
1290
1291
1292/* Divide WCS into tokens separated by characters in DELIM. */
1293#if 0
1294# if !1
1295_GL_FUNCDECL_SYS (wcstok, wchar_t *,
1296 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1297# endif
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
1302# undef wcstok
1303# if HAVE_RAW_DECL_WCSTOK
1304_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1305 "use gnulib module wcstok for portability");
1306# endif
1307#endif
1308
1309
1310/* Determine number of column positions required for first N wide
1311 characters (or fewer if S ends before this) in S. */
1312#if 0
1313# if 0
1314# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1315# undef wcswidth
1316# define wcswidth rpl_wcswidth
1317# endif
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));
1321# else
1322# if !1
1323_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1324 _GL_ATTRIBUTE_PURE);
1325# endif
1326_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1327# endif
1328_GL_CXXALIASWARN (wcswidth);
1329#elif defined GNULIB_POSIXCHECK
1330# undef wcswidth
1331# if HAVE_RAW_DECL_WCSWIDTH
1332_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1333 "use gnulib module wcswidth for portability");
1334# endif
1335#endif
1336
1337
1338#endif /* _GL_WCHAR_H */
1339#endif /* _GL_WCHAR_H */
1340#endif