xref: /dflybsd-src/gnu/usr.bin/gdb/libgnu/wchar.h (revision c33252afc5aa9790d4820b568316e03d695f6a65)
1*c33252afSJohn Marino /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2*c33252afSJohn Marino /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
3*c33252afSJohn Marino 
4*c33252afSJohn Marino    Copyright (C) 2007-2012 Free Software Foundation, Inc.
5*c33252afSJohn Marino 
6*c33252afSJohn Marino    This program is free software; you can redistribute it and/or modify
7*c33252afSJohn Marino    it under the terms of the GNU General Public License as published by
8*c33252afSJohn Marino    the Free Software Foundation; either version 3, or (at your option)
9*c33252afSJohn Marino    any later version.
10*c33252afSJohn Marino 
11*c33252afSJohn Marino    This program is distributed in the hope that it will be useful,
12*c33252afSJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*c33252afSJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*c33252afSJohn Marino    GNU General Public License for more details.
15*c33252afSJohn Marino 
16*c33252afSJohn Marino    You should have received a copy of the GNU General Public License
17*c33252afSJohn Marino    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
18*c33252afSJohn Marino 
19*c33252afSJohn Marino /* Written by Eric Blake.  */
20*c33252afSJohn Marino 
21*c33252afSJohn Marino /*
22*c33252afSJohn Marino  * ISO C 99 <wchar.h> for platforms that have issues.
23*c33252afSJohn Marino  * <http://www.opengroup.org/susv3xbd/wchar.h.html>
24*c33252afSJohn Marino  *
25*c33252afSJohn Marino  * For now, this just ensures proper prerequisite inclusion order and
26*c33252afSJohn Marino  * the declaration of wcwidth().
27*c33252afSJohn Marino  */
28*c33252afSJohn Marino 
29*c33252afSJohn Marino #if __GNUC__ >= 3
30*c33252afSJohn Marino #pragma GCC system_header
31*c33252afSJohn Marino #endif
32*c33252afSJohn Marino 
33*c33252afSJohn Marino 
34*c33252afSJohn Marino #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*c33252afSJohn Marino /* Special invocation convention:
36*c33252afSJohn Marino    - Inside glibc and uClibc header files.
37*c33252afSJohn Marino    - On HP-UX 11.00 we have a sequence of nested includes
38*c33252afSJohn Marino      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
39*c33252afSJohn Marino      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
40*c33252afSJohn Marino      and once directly.  In both situations 'wint_t' is not yet defined,
41*c33252afSJohn Marino      therefore we cannot provide the function overrides; instead include only
42*c33252afSJohn Marino      the system's <wchar.h>.
43*c33252afSJohn Marino    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
44*c33252afSJohn Marino      the latter includes <wchar.h>.  But here, we have no way to detect whether
45*c33252afSJohn Marino      <wctype.h> is completely included or is still being included.  */
46*c33252afSJohn Marino 
47*c33252afSJohn Marino #include_next <wchar.h>
48*c33252afSJohn Marino 
49*c33252afSJohn Marino #else
50*c33252afSJohn Marino /* Normal invocation convention.  */
51*c33252afSJohn Marino 
52*c33252afSJohn Marino #ifndef _GL_WCHAR_H
53*c33252afSJohn Marino 
54*c33252afSJohn Marino #define _GL_ALREADY_INCLUDING_WCHAR_H
55*c33252afSJohn Marino 
56*c33252afSJohn Marino #if 0
57*c33252afSJohn Marino # include <features.h> /* for __GLIBC__ */
58*c33252afSJohn Marino #endif
59*c33252afSJohn Marino 
60*c33252afSJohn Marino /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
61*c33252afSJohn Marino    <wchar.h>.
62*c33252afSJohn Marino    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
63*c33252afSJohn Marino    included before <wchar.h>.
64*c33252afSJohn Marino    In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
65*c33252afSJohn Marino    by <stddef.h>.
66*c33252afSJohn Marino    But avoid namespace pollution on glibc systems.  */
67*c33252afSJohn Marino #if !(defined __GLIBC__ && !defined __UCLIBC__)
68*c33252afSJohn Marino # include <stddef.h>
69*c33252afSJohn Marino #endif
70*c33252afSJohn Marino #ifndef __GLIBC__
71*c33252afSJohn Marino # include <stdio.h>
72*c33252afSJohn Marino # include <time.h>
73*c33252afSJohn Marino #endif
74*c33252afSJohn Marino 
75*c33252afSJohn Marino /* Include the original <wchar.h> if it exists.
76*c33252afSJohn Marino    Some builds of uClibc lack it.  */
77*c33252afSJohn Marino /* The include_next requires a split double-inclusion guard.  */
78*c33252afSJohn Marino #if 1
79*c33252afSJohn Marino # include_next <wchar.h>
80*c33252afSJohn Marino #endif
81*c33252afSJohn Marino 
82*c33252afSJohn Marino #undef _GL_ALREADY_INCLUDING_WCHAR_H
83*c33252afSJohn Marino 
84*c33252afSJohn Marino #ifndef _GL_WCHAR_H
85*c33252afSJohn Marino #define _GL_WCHAR_H
86*c33252afSJohn Marino 
87*c33252afSJohn Marino /* The __attribute__ feature is available in gcc versions 2.5 and later.
88*c33252afSJohn Marino    The attribute __pure__ was added in gcc 2.96.  */
89*c33252afSJohn Marino #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
90*c33252afSJohn Marino # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
91*c33252afSJohn Marino #else
92*c33252afSJohn Marino # define _GL_ATTRIBUTE_PURE /* empty */
93*c33252afSJohn Marino #endif
94*c33252afSJohn Marino 
95*c33252afSJohn Marino /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
96*c33252afSJohn Marino #ifndef _GL_CXXDEFS_H
97*c33252afSJohn Marino #define _GL_CXXDEFS_H
98*c33252afSJohn Marino 
99*c33252afSJohn Marino /* The three most frequent use cases of these macros are:
100*c33252afSJohn Marino 
101*c33252afSJohn Marino    * For providing a substitute for a function that is missing on some
102*c33252afSJohn Marino      platforms, but is declared and works fine on the platforms on which
103*c33252afSJohn Marino      it exists:
104*c33252afSJohn Marino 
105*c33252afSJohn Marino        #if @GNULIB_FOO@
106*c33252afSJohn Marino        # if !@HAVE_FOO@
107*c33252afSJohn Marino        _GL_FUNCDECL_SYS (foo, ...);
108*c33252afSJohn Marino        # endif
109*c33252afSJohn Marino        _GL_CXXALIAS_SYS (foo, ...);
110*c33252afSJohn Marino        _GL_CXXALIASWARN (foo);
111*c33252afSJohn Marino        #elif defined GNULIB_POSIXCHECK
112*c33252afSJohn Marino        ...
113*c33252afSJohn Marino        #endif
114*c33252afSJohn Marino 
115*c33252afSJohn Marino    * For providing a replacement for a function that exists on all platforms,
116*c33252afSJohn Marino      but is broken/insufficient and needs to be replaced on some platforms:
117*c33252afSJohn Marino 
118*c33252afSJohn Marino        #if @GNULIB_FOO@
119*c33252afSJohn Marino        # if @REPLACE_FOO@
120*c33252afSJohn Marino        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
121*c33252afSJohn Marino        #   undef foo
122*c33252afSJohn Marino        #   define foo rpl_foo
123*c33252afSJohn Marino        #  endif
124*c33252afSJohn Marino        _GL_FUNCDECL_RPL (foo, ...);
125*c33252afSJohn Marino        _GL_CXXALIAS_RPL (foo, ...);
126*c33252afSJohn Marino        # else
127*c33252afSJohn Marino        _GL_CXXALIAS_SYS (foo, ...);
128*c33252afSJohn Marino        # endif
129*c33252afSJohn Marino        _GL_CXXALIASWARN (foo);
130*c33252afSJohn Marino        #elif defined GNULIB_POSIXCHECK
131*c33252afSJohn Marino        ...
132*c33252afSJohn Marino        #endif
133*c33252afSJohn Marino 
134*c33252afSJohn Marino    * For providing a replacement for a function that exists on some platforms
135*c33252afSJohn Marino      but is broken/insufficient and needs to be replaced on some of them and
136*c33252afSJohn Marino      is additionally either missing or undeclared on some other platforms:
137*c33252afSJohn Marino 
138*c33252afSJohn Marino        #if @GNULIB_FOO@
139*c33252afSJohn Marino        # if @REPLACE_FOO@
140*c33252afSJohn Marino        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
141*c33252afSJohn Marino        #   undef foo
142*c33252afSJohn Marino        #   define foo rpl_foo
143*c33252afSJohn Marino        #  endif
144*c33252afSJohn Marino        _GL_FUNCDECL_RPL (foo, ...);
145*c33252afSJohn Marino        _GL_CXXALIAS_RPL (foo, ...);
146*c33252afSJohn Marino        # else
147*c33252afSJohn Marino        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
148*c33252afSJohn Marino        _GL_FUNCDECL_SYS (foo, ...);
149*c33252afSJohn Marino        #  endif
150*c33252afSJohn Marino        _GL_CXXALIAS_SYS (foo, ...);
151*c33252afSJohn Marino        # endif
152*c33252afSJohn Marino        _GL_CXXALIASWARN (foo);
153*c33252afSJohn Marino        #elif defined GNULIB_POSIXCHECK
154*c33252afSJohn Marino        ...
155*c33252afSJohn Marino        #endif
156*c33252afSJohn Marino */
157*c33252afSJohn Marino 
158*c33252afSJohn Marino /* _GL_EXTERN_C declaration;
159*c33252afSJohn Marino    performs the declaration with C linkage.  */
160*c33252afSJohn Marino #if defined __cplusplus
161*c33252afSJohn Marino # define _GL_EXTERN_C extern "C"
162*c33252afSJohn Marino #else
163*c33252afSJohn Marino # define _GL_EXTERN_C extern
164*c33252afSJohn Marino #endif
165*c33252afSJohn Marino 
166*c33252afSJohn Marino /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
167*c33252afSJohn Marino    declares a replacement function, named rpl_func, with the given prototype,
168*c33252afSJohn Marino    consisting of return type, parameters, and attributes.
169*c33252afSJohn Marino    Example:
170*c33252afSJohn Marino      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
171*c33252afSJohn Marino                                   _GL_ARG_NONNULL ((1)));
172*c33252afSJohn Marino  */
173*c33252afSJohn Marino #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
174*c33252afSJohn Marino   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
175*c33252afSJohn Marino #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
176*c33252afSJohn Marino   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
177*c33252afSJohn Marino 
178*c33252afSJohn Marino /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
179*c33252afSJohn Marino    declares the system function, named func, with the given prototype,
180*c33252afSJohn Marino    consisting of return type, parameters, and attributes.
181*c33252afSJohn Marino    Example:
182*c33252afSJohn Marino      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
183*c33252afSJohn Marino                                   _GL_ARG_NONNULL ((1)));
184*c33252afSJohn Marino  */
185*c33252afSJohn Marino #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
186*c33252afSJohn Marino   _GL_EXTERN_C rettype func parameters_and_attributes
187*c33252afSJohn Marino 
188*c33252afSJohn Marino /* _GL_CXXALIAS_RPL (func, rettype, parameters);
189*c33252afSJohn Marino    declares a C++ alias called GNULIB_NAMESPACE::func
190*c33252afSJohn Marino    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
191*c33252afSJohn Marino    Example:
192*c33252afSJohn Marino      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
193*c33252afSJohn Marino  */
194*c33252afSJohn Marino #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
195*c33252afSJohn Marino   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
196*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
197*c33252afSJohn Marino # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
198*c33252afSJohn Marino     namespace GNULIB_NAMESPACE                                \
199*c33252afSJohn Marino     {                                                         \
200*c33252afSJohn Marino       rettype (*const func) parameters = ::rpl_func;          \
201*c33252afSJohn Marino     }                                                         \
202*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
203*c33252afSJohn Marino #else
204*c33252afSJohn Marino # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
205*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
206*c33252afSJohn Marino #endif
207*c33252afSJohn Marino 
208*c33252afSJohn Marino /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
209*c33252afSJohn Marino    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
210*c33252afSJohn Marino    except that the C function rpl_func may have a slightly different
211*c33252afSJohn Marino    declaration.  A cast is used to silence the "invalid conversion" error
212*c33252afSJohn Marino    that would otherwise occur.  */
213*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
214*c33252afSJohn Marino # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
215*c33252afSJohn Marino     namespace GNULIB_NAMESPACE                                     \
216*c33252afSJohn Marino     {                                                              \
217*c33252afSJohn Marino       rettype (*const func) parameters =                           \
218*c33252afSJohn Marino         reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
219*c33252afSJohn Marino     }                                                              \
220*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
221*c33252afSJohn Marino #else
222*c33252afSJohn Marino # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
223*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
224*c33252afSJohn Marino #endif
225*c33252afSJohn Marino 
226*c33252afSJohn Marino /* _GL_CXXALIAS_SYS (func, rettype, parameters);
227*c33252afSJohn Marino    declares a C++ alias called GNULIB_NAMESPACE::func
228*c33252afSJohn Marino    that redirects to the system provided function func, if GNULIB_NAMESPACE
229*c33252afSJohn Marino    is defined.
230*c33252afSJohn Marino    Example:
231*c33252afSJohn Marino      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
232*c33252afSJohn Marino  */
233*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
234*c33252afSJohn Marino   /* If we were to write
235*c33252afSJohn Marino        rettype (*const func) parameters = ::func;
236*c33252afSJohn Marino      like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
237*c33252afSJohn Marino      better (remove an indirection through a 'static' pointer variable),
238*c33252afSJohn Marino      but then the _GL_CXXALIASWARN macro below would cause a warning not only
239*c33252afSJohn Marino      for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
240*c33252afSJohn Marino # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
241*c33252afSJohn Marino     namespace GNULIB_NAMESPACE                     \
242*c33252afSJohn Marino     {                                              \
243*c33252afSJohn Marino       static rettype (*func) parameters = ::func;  \
244*c33252afSJohn Marino     }                                              \
245*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
246*c33252afSJohn Marino #else
247*c33252afSJohn Marino # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
248*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
249*c33252afSJohn Marino #endif
250*c33252afSJohn Marino 
251*c33252afSJohn Marino /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
252*c33252afSJohn Marino    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
253*c33252afSJohn Marino    except that the C function func may have a slightly different declaration.
254*c33252afSJohn Marino    A cast is used to silence the "invalid conversion" error that would
255*c33252afSJohn Marino    otherwise occur.  */
256*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
257*c33252afSJohn Marino # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
258*c33252afSJohn Marino     namespace GNULIB_NAMESPACE                          \
259*c33252afSJohn Marino     {                                                   \
260*c33252afSJohn Marino       static rettype (*func) parameters =               \
261*c33252afSJohn Marino         reinterpret_cast<rettype(*)parameters>(::func); \
262*c33252afSJohn Marino     }                                                   \
263*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
264*c33252afSJohn Marino #else
265*c33252afSJohn Marino # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
266*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
267*c33252afSJohn Marino #endif
268*c33252afSJohn Marino 
269*c33252afSJohn Marino /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
270*c33252afSJohn Marino    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
271*c33252afSJohn Marino    except that the C function is picked among a set of overloaded functions,
272*c33252afSJohn Marino    namely the one with rettype2 and parameters2.  Two consecutive casts
273*c33252afSJohn Marino    are used to silence the "cannot find a match" and "invalid conversion"
274*c33252afSJohn Marino    errors that would otherwise occur.  */
275*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
276*c33252afSJohn Marino   /* The outer cast must be a reinterpret_cast.
277*c33252afSJohn Marino      The inner cast: When the function is defined as a set of overloaded
278*c33252afSJohn Marino      functions, it works as a static_cast<>, choosing the designated variant.
279*c33252afSJohn Marino      When the function is defined as a single variant, it works as a
280*c33252afSJohn Marino      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
281*c33252afSJohn Marino # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
282*c33252afSJohn Marino     namespace GNULIB_NAMESPACE                                                \
283*c33252afSJohn Marino     {                                                                         \
284*c33252afSJohn Marino       static rettype (*func) parameters =                                     \
285*c33252afSJohn Marino         reinterpret_cast<rettype(*)parameters>(                               \
286*c33252afSJohn Marino           (rettype2(*)parameters2)(::func));                                  \
287*c33252afSJohn Marino     }                                                                         \
288*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
289*c33252afSJohn Marino #else
290*c33252afSJohn Marino # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
291*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
292*c33252afSJohn Marino #endif
293*c33252afSJohn Marino 
294*c33252afSJohn Marino /* _GL_CXXALIASWARN (func);
295*c33252afSJohn Marino    causes a warning to be emitted when ::func is used but not when
296*c33252afSJohn Marino    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
297*c33252afSJohn Marino    variants.  */
298*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
299*c33252afSJohn Marino # define _GL_CXXALIASWARN(func) \
300*c33252afSJohn Marino    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
301*c33252afSJohn Marino # define _GL_CXXALIASWARN_1(func,namespace) \
302*c33252afSJohn Marino    _GL_CXXALIASWARN_2 (func, namespace)
303*c33252afSJohn Marino /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
304*c33252afSJohn Marino    we enable the warning only when not optimizing.  */
305*c33252afSJohn Marino # if !__OPTIMIZE__
306*c33252afSJohn Marino #  define _GL_CXXALIASWARN_2(func,namespace) \
307*c33252afSJohn Marino     _GL_WARN_ON_USE (func, \
308*c33252afSJohn Marino                      "The symbol ::" #func " refers to the system function. " \
309*c33252afSJohn Marino                      "Use " #namespace "::" #func " instead.")
310*c33252afSJohn Marino # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
311*c33252afSJohn Marino #  define _GL_CXXALIASWARN_2(func,namespace) \
312*c33252afSJohn Marino      extern __typeof__ (func) func
313*c33252afSJohn Marino # else
314*c33252afSJohn Marino #  define _GL_CXXALIASWARN_2(func,namespace) \
315*c33252afSJohn Marino      _GL_EXTERN_C int _gl_cxxalias_dummy
316*c33252afSJohn Marino # endif
317*c33252afSJohn Marino #else
318*c33252afSJohn Marino # define _GL_CXXALIASWARN(func) \
319*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
320*c33252afSJohn Marino #endif
321*c33252afSJohn Marino 
322*c33252afSJohn Marino /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
323*c33252afSJohn Marino    causes a warning to be emitted when the given overloaded variant of ::func
324*c33252afSJohn Marino    is used but not when GNULIB_NAMESPACE::func is used.  */
325*c33252afSJohn Marino #if defined __cplusplus && defined GNULIB_NAMESPACE
326*c33252afSJohn Marino # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
327*c33252afSJohn Marino    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
328*c33252afSJohn Marino                         GNULIB_NAMESPACE)
329*c33252afSJohn Marino # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
330*c33252afSJohn Marino    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
331*c33252afSJohn Marino /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
332*c33252afSJohn Marino    we enable the warning only when not optimizing.  */
333*c33252afSJohn Marino # if !__OPTIMIZE__
334*c33252afSJohn Marino #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
335*c33252afSJohn Marino     _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
336*c33252afSJohn Marino                          "The symbol ::" #func " refers to the system function. " \
337*c33252afSJohn Marino                          "Use " #namespace "::" #func " instead.")
338*c33252afSJohn Marino # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
339*c33252afSJohn Marino #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
340*c33252afSJohn Marino      extern __typeof__ (func) func
341*c33252afSJohn Marino # else
342*c33252afSJohn Marino #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
343*c33252afSJohn Marino      _GL_EXTERN_C int _gl_cxxalias_dummy
344*c33252afSJohn Marino # endif
345*c33252afSJohn Marino #else
346*c33252afSJohn Marino # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
347*c33252afSJohn Marino     _GL_EXTERN_C int _gl_cxxalias_dummy
348*c33252afSJohn Marino #endif
349*c33252afSJohn Marino 
350*c33252afSJohn Marino #endif /* _GL_CXXDEFS_H */
351*c33252afSJohn Marino 
352*c33252afSJohn Marino /* The definition of _GL_ARG_NONNULL is copied here.  */
353*c33252afSJohn Marino /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
354*c33252afSJohn Marino    that the values passed as arguments n, ..., m must be non-NULL pointers.
355*c33252afSJohn Marino    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
356*c33252afSJohn Marino #ifndef _GL_ARG_NONNULL
357*c33252afSJohn Marino # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
358*c33252afSJohn Marino #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
359*c33252afSJohn Marino # else
360*c33252afSJohn Marino #  define _GL_ARG_NONNULL(params)
361*c33252afSJohn Marino # endif
362*c33252afSJohn Marino #endif
363*c33252afSJohn Marino 
364*c33252afSJohn Marino /* The definition of _GL_WARN_ON_USE is copied here.  */
365*c33252afSJohn Marino #ifndef _GL_WARN_ON_USE
366*c33252afSJohn Marino 
367*c33252afSJohn Marino # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
368*c33252afSJohn Marino /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
369*c33252afSJohn Marino #  define _GL_WARN_ON_USE(function, message) \
370*c33252afSJohn Marino extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
371*c33252afSJohn Marino # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
372*c33252afSJohn Marino /* Verify the existence of the function.  */
373*c33252afSJohn Marino #  define _GL_WARN_ON_USE(function, message) \
374*c33252afSJohn Marino extern __typeof__ (function) function
375*c33252afSJohn Marino # else /* Unsupported.  */
376*c33252afSJohn Marino #  define _GL_WARN_ON_USE(function, message) \
377*c33252afSJohn Marino _GL_WARN_EXTERN_C int _gl_warn_on_use
378*c33252afSJohn Marino # endif
379*c33252afSJohn Marino #endif
380*c33252afSJohn Marino 
381*c33252afSJohn Marino /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
382*c33252afSJohn Marino    is like _GL_WARN_ON_USE (function, "string"), except that the function is
383*c33252afSJohn Marino    declared with the given prototype, consisting of return type, parameters,
384*c33252afSJohn Marino    and attributes.
385*c33252afSJohn Marino    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
386*c33252afSJohn Marino    not work in this case.  */
387*c33252afSJohn Marino #ifndef _GL_WARN_ON_USE_CXX
388*c33252afSJohn Marino # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
389*c33252afSJohn Marino #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
390*c33252afSJohn Marino extern rettype function parameters_and_attributes \
391*c33252afSJohn Marino      __attribute__ ((__warning__ (msg)))
392*c33252afSJohn Marino # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
393*c33252afSJohn Marino /* Verify the existence of the function.  */
394*c33252afSJohn Marino #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
395*c33252afSJohn Marino extern rettype function parameters_and_attributes
396*c33252afSJohn Marino # else /* Unsupported.  */
397*c33252afSJohn Marino #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
398*c33252afSJohn Marino _GL_WARN_EXTERN_C int _gl_warn_on_use
399*c33252afSJohn Marino # endif
400*c33252afSJohn Marino #endif
401*c33252afSJohn Marino 
402*c33252afSJohn Marino /* _GL_WARN_EXTERN_C declaration;
403*c33252afSJohn Marino    performs the declaration with C linkage.  */
404*c33252afSJohn Marino #ifndef _GL_WARN_EXTERN_C
405*c33252afSJohn Marino # if defined __cplusplus
406*c33252afSJohn Marino #  define _GL_WARN_EXTERN_C extern "C"
407*c33252afSJohn Marino # else
408*c33252afSJohn Marino #  define _GL_WARN_EXTERN_C extern
409*c33252afSJohn Marino # endif
410*c33252afSJohn Marino #endif
411*c33252afSJohn Marino 
412*c33252afSJohn Marino 
413*c33252afSJohn Marino /* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
414*c33252afSJohn Marino #if !1 && !defined wint_t
415*c33252afSJohn Marino # define wint_t int
416*c33252afSJohn Marino # ifndef WEOF
417*c33252afSJohn Marino #  define WEOF -1
418*c33252afSJohn Marino # endif
419*c33252afSJohn Marino #else
420*c33252afSJohn Marino /* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
421*c33252afSJohn Marino    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
422*c33252afSJohn Marino    "unchanged by default argument promotions".  Override it.  */
423*c33252afSJohn Marino # if defined _MSC_VER
424*c33252afSJohn Marino #  if !GNULIB_defined_wint_t
425*c33252afSJohn Marino #   include <crtdefs.h>
426*c33252afSJohn Marino typedef unsigned int rpl_wint_t;
427*c33252afSJohn Marino #   undef wint_t
428*c33252afSJohn Marino #   define wint_t rpl_wint_t
429*c33252afSJohn Marino #   define GNULIB_defined_wint_t 1
430*c33252afSJohn Marino #  endif
431*c33252afSJohn Marino # endif
432*c33252afSJohn Marino # ifndef WEOF
433*c33252afSJohn Marino #  define WEOF ((wint_t) -1)
434*c33252afSJohn Marino # endif
435*c33252afSJohn Marino #endif
436*c33252afSJohn Marino 
437*c33252afSJohn Marino 
438*c33252afSJohn Marino /* Override mbstate_t if it is too small.
439*c33252afSJohn Marino    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
440*c33252afSJohn Marino    implementing mbrtowc for encodings like UTF-8.  */
441*c33252afSJohn Marino #if !(1 && 1) || 0
442*c33252afSJohn Marino # if !GNULIB_defined_mbstate_t
443*c33252afSJohn Marino typedef int rpl_mbstate_t;
444*c33252afSJohn Marino #  undef mbstate_t
445*c33252afSJohn Marino #  define mbstate_t rpl_mbstate_t
446*c33252afSJohn Marino #  define GNULIB_defined_mbstate_t 1
447*c33252afSJohn Marino # endif
448*c33252afSJohn Marino #endif
449*c33252afSJohn Marino 
450*c33252afSJohn Marino 
451*c33252afSJohn Marino /* Convert a single-byte character to a wide character.  */
452*c33252afSJohn Marino #if 0
453*c33252afSJohn Marino # if 0
454*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
455*c33252afSJohn Marino #   undef btowc
456*c33252afSJohn Marino #   define btowc rpl_btowc
457*c33252afSJohn Marino #  endif
458*c33252afSJohn Marino _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
459*c33252afSJohn Marino _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
460*c33252afSJohn Marino # else
461*c33252afSJohn Marino #  if !1
462*c33252afSJohn Marino _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
463*c33252afSJohn Marino #  endif
464*c33252afSJohn Marino _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
465*c33252afSJohn Marino # endif
466*c33252afSJohn Marino _GL_CXXALIASWARN (btowc);
467*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
468*c33252afSJohn Marino # undef btowc
469*c33252afSJohn Marino # if HAVE_RAW_DECL_BTOWC
470*c33252afSJohn Marino _GL_WARN_ON_USE (btowc, "btowc is unportable - "
471*c33252afSJohn Marino                  "use gnulib module btowc for portability");
472*c33252afSJohn Marino # endif
473*c33252afSJohn Marino #endif
474*c33252afSJohn Marino 
475*c33252afSJohn Marino 
476*c33252afSJohn Marino /* Convert a wide character to a single-byte character.  */
477*c33252afSJohn Marino #if 0
478*c33252afSJohn Marino # if 0
479*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
480*c33252afSJohn Marino #   undef wctob
481*c33252afSJohn Marino #   define wctob rpl_wctob
482*c33252afSJohn Marino #  endif
483*c33252afSJohn Marino _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
484*c33252afSJohn Marino _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
485*c33252afSJohn Marino # else
486*c33252afSJohn Marino #  if !defined wctob && !1
487*c33252afSJohn Marino /* wctob is provided by gnulib, or wctob exists but is not declared.  */
488*c33252afSJohn Marino _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
489*c33252afSJohn Marino #  endif
490*c33252afSJohn Marino _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
491*c33252afSJohn Marino # endif
492*c33252afSJohn Marino _GL_CXXALIASWARN (wctob);
493*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
494*c33252afSJohn Marino # undef wctob
495*c33252afSJohn Marino # if HAVE_RAW_DECL_WCTOB
496*c33252afSJohn Marino _GL_WARN_ON_USE (wctob, "wctob is unportable - "
497*c33252afSJohn Marino                  "use gnulib module wctob for portability");
498*c33252afSJohn Marino # endif
499*c33252afSJohn Marino #endif
500*c33252afSJohn Marino 
501*c33252afSJohn Marino 
502*c33252afSJohn Marino /* Test whether *PS is in the initial state.  */
503*c33252afSJohn Marino #if 1
504*c33252afSJohn Marino # if 0
505*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
506*c33252afSJohn Marino #   undef mbsinit
507*c33252afSJohn Marino #   define mbsinit rpl_mbsinit
508*c33252afSJohn Marino #  endif
509*c33252afSJohn Marino _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
510*c33252afSJohn Marino _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
511*c33252afSJohn Marino # else
512*c33252afSJohn Marino #  if !1
513*c33252afSJohn Marino _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
514*c33252afSJohn Marino #  endif
515*c33252afSJohn Marino _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
516*c33252afSJohn Marino # endif
517*c33252afSJohn Marino _GL_CXXALIASWARN (mbsinit);
518*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
519*c33252afSJohn Marino # undef mbsinit
520*c33252afSJohn Marino # if HAVE_RAW_DECL_MBSINIT
521*c33252afSJohn Marino _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
522*c33252afSJohn Marino                  "use gnulib module mbsinit for portability");
523*c33252afSJohn Marino # endif
524*c33252afSJohn Marino #endif
525*c33252afSJohn Marino 
526*c33252afSJohn Marino 
527*c33252afSJohn Marino /* Convert a multibyte character to a wide character.  */
528*c33252afSJohn Marino #if 1
529*c33252afSJohn Marino # if 0
530*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
531*c33252afSJohn Marino #   undef mbrtowc
532*c33252afSJohn Marino #   define mbrtowc rpl_mbrtowc
533*c33252afSJohn Marino #  endif
534*c33252afSJohn Marino _GL_FUNCDECL_RPL (mbrtowc, size_t,
535*c33252afSJohn Marino                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
536*c33252afSJohn Marino _GL_CXXALIAS_RPL (mbrtowc, size_t,
537*c33252afSJohn Marino                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
538*c33252afSJohn Marino # else
539*c33252afSJohn Marino #  if !1
540*c33252afSJohn Marino _GL_FUNCDECL_SYS (mbrtowc, size_t,
541*c33252afSJohn Marino                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
542*c33252afSJohn Marino #  endif
543*c33252afSJohn Marino _GL_CXXALIAS_SYS (mbrtowc, size_t,
544*c33252afSJohn Marino                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
545*c33252afSJohn Marino # endif
546*c33252afSJohn Marino _GL_CXXALIASWARN (mbrtowc);
547*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
548*c33252afSJohn Marino # undef mbrtowc
549*c33252afSJohn Marino # if HAVE_RAW_DECL_MBRTOWC
550*c33252afSJohn Marino _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
551*c33252afSJohn Marino                  "use gnulib module mbrtowc for portability");
552*c33252afSJohn Marino # endif
553*c33252afSJohn Marino #endif
554*c33252afSJohn Marino 
555*c33252afSJohn Marino 
556*c33252afSJohn Marino /* Recognize a multibyte character.  */
557*c33252afSJohn Marino #if 0
558*c33252afSJohn Marino # if 0
559*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
560*c33252afSJohn Marino #   undef mbrlen
561*c33252afSJohn Marino #   define mbrlen rpl_mbrlen
562*c33252afSJohn Marino #  endif
563*c33252afSJohn Marino _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
564*c33252afSJohn Marino _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
565*c33252afSJohn Marino # else
566*c33252afSJohn Marino #  if !1
567*c33252afSJohn Marino _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
568*c33252afSJohn Marino #  endif
569*c33252afSJohn Marino _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
570*c33252afSJohn Marino # endif
571*c33252afSJohn Marino _GL_CXXALIASWARN (mbrlen);
572*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
573*c33252afSJohn Marino # undef mbrlen
574*c33252afSJohn Marino # if HAVE_RAW_DECL_MBRLEN
575*c33252afSJohn Marino _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
576*c33252afSJohn Marino                  "use gnulib module mbrlen for portability");
577*c33252afSJohn Marino # endif
578*c33252afSJohn Marino #endif
579*c33252afSJohn Marino 
580*c33252afSJohn Marino 
581*c33252afSJohn Marino /* Convert a string to a wide string.  */
582*c33252afSJohn Marino #if 1
583*c33252afSJohn Marino # if 0
584*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
585*c33252afSJohn Marino #   undef mbsrtowcs
586*c33252afSJohn Marino #   define mbsrtowcs rpl_mbsrtowcs
587*c33252afSJohn Marino #  endif
588*c33252afSJohn Marino _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
589*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
590*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
591*c33252afSJohn Marino _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
592*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t len,
593*c33252afSJohn Marino                    mbstate_t *ps));
594*c33252afSJohn Marino # else
595*c33252afSJohn Marino #  if !1
596*c33252afSJohn Marino _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
597*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
598*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
599*c33252afSJohn Marino #  endif
600*c33252afSJohn Marino _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
601*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t len,
602*c33252afSJohn Marino                    mbstate_t *ps));
603*c33252afSJohn Marino # endif
604*c33252afSJohn Marino _GL_CXXALIASWARN (mbsrtowcs);
605*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
606*c33252afSJohn Marino # undef mbsrtowcs
607*c33252afSJohn Marino # if HAVE_RAW_DECL_MBSRTOWCS
608*c33252afSJohn Marino _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
609*c33252afSJohn Marino                  "use gnulib module mbsrtowcs for portability");
610*c33252afSJohn Marino # endif
611*c33252afSJohn Marino #endif
612*c33252afSJohn Marino 
613*c33252afSJohn Marino 
614*c33252afSJohn Marino /* Convert a string to a wide string.  */
615*c33252afSJohn Marino #if 0
616*c33252afSJohn Marino # if 0
617*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
618*c33252afSJohn Marino #   undef mbsnrtowcs
619*c33252afSJohn Marino #   define mbsnrtowcs rpl_mbsnrtowcs
620*c33252afSJohn Marino #  endif
621*c33252afSJohn Marino _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
622*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
623*c33252afSJohn Marino                    mbstate_t *ps)
624*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
625*c33252afSJohn Marino _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
626*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
627*c33252afSJohn Marino                    mbstate_t *ps));
628*c33252afSJohn Marino # else
629*c33252afSJohn Marino #  if !1
630*c33252afSJohn Marino _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
631*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
632*c33252afSJohn Marino                    mbstate_t *ps)
633*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
634*c33252afSJohn Marino #  endif
635*c33252afSJohn Marino _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
636*c33252afSJohn Marino                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
637*c33252afSJohn Marino                    mbstate_t *ps));
638*c33252afSJohn Marino # endif
639*c33252afSJohn Marino _GL_CXXALIASWARN (mbsnrtowcs);
640*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
641*c33252afSJohn Marino # undef mbsnrtowcs
642*c33252afSJohn Marino # if HAVE_RAW_DECL_MBSNRTOWCS
643*c33252afSJohn Marino _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
644*c33252afSJohn Marino                  "use gnulib module mbsnrtowcs for portability");
645*c33252afSJohn Marino # endif
646*c33252afSJohn Marino #endif
647*c33252afSJohn Marino 
648*c33252afSJohn Marino 
649*c33252afSJohn Marino /* Convert a wide character to a multibyte character.  */
650*c33252afSJohn Marino #if 0
651*c33252afSJohn Marino # if 0
652*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
653*c33252afSJohn Marino #   undef wcrtomb
654*c33252afSJohn Marino #   define wcrtomb rpl_wcrtomb
655*c33252afSJohn Marino #  endif
656*c33252afSJohn Marino _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
657*c33252afSJohn Marino _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
658*c33252afSJohn Marino # else
659*c33252afSJohn Marino #  if !1
660*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
661*c33252afSJohn Marino #  endif
662*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
663*c33252afSJohn Marino # endif
664*c33252afSJohn Marino _GL_CXXALIASWARN (wcrtomb);
665*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
666*c33252afSJohn Marino # undef wcrtomb
667*c33252afSJohn Marino # if HAVE_RAW_DECL_WCRTOMB
668*c33252afSJohn Marino _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
669*c33252afSJohn Marino                  "use gnulib module wcrtomb for portability");
670*c33252afSJohn Marino # endif
671*c33252afSJohn Marino #endif
672*c33252afSJohn Marino 
673*c33252afSJohn Marino 
674*c33252afSJohn Marino /* Convert a wide string to a string.  */
675*c33252afSJohn Marino #if 0
676*c33252afSJohn Marino # if 0
677*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
678*c33252afSJohn Marino #   undef wcsrtombs
679*c33252afSJohn Marino #   define wcsrtombs rpl_wcsrtombs
680*c33252afSJohn Marino #  endif
681*c33252afSJohn Marino _GL_FUNCDECL_RPL (wcsrtombs, size_t,
682*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
683*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
684*c33252afSJohn Marino _GL_CXXALIAS_RPL (wcsrtombs, size_t,
685*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t len,
686*c33252afSJohn Marino                    mbstate_t *ps));
687*c33252afSJohn Marino # else
688*c33252afSJohn Marino #  if !1
689*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsrtombs, size_t,
690*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
691*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
692*c33252afSJohn Marino #  endif
693*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsrtombs, size_t,
694*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t len,
695*c33252afSJohn Marino                    mbstate_t *ps));
696*c33252afSJohn Marino # endif
697*c33252afSJohn Marino _GL_CXXALIASWARN (wcsrtombs);
698*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
699*c33252afSJohn Marino # undef wcsrtombs
700*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSRTOMBS
701*c33252afSJohn Marino _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
702*c33252afSJohn Marino                  "use gnulib module wcsrtombs for portability");
703*c33252afSJohn Marino # endif
704*c33252afSJohn Marino #endif
705*c33252afSJohn Marino 
706*c33252afSJohn Marino 
707*c33252afSJohn Marino /* Convert a wide string to a string.  */
708*c33252afSJohn Marino #if 0
709*c33252afSJohn Marino # if 0
710*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
711*c33252afSJohn Marino #   undef wcsnrtombs
712*c33252afSJohn Marino #   define wcsnrtombs rpl_wcsnrtombs
713*c33252afSJohn Marino #  endif
714*c33252afSJohn Marino _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
715*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
716*c33252afSJohn Marino                    mbstate_t *ps)
717*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
718*c33252afSJohn Marino _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
719*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
720*c33252afSJohn Marino                    mbstate_t *ps));
721*c33252afSJohn Marino # else
722*c33252afSJohn Marino #  if !1
723*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
724*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
725*c33252afSJohn Marino                    mbstate_t *ps)
726*c33252afSJohn Marino                   _GL_ARG_NONNULL ((2)));
727*c33252afSJohn Marino #  endif
728*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
729*c33252afSJohn Marino                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
730*c33252afSJohn Marino                    mbstate_t *ps));
731*c33252afSJohn Marino # endif
732*c33252afSJohn Marino _GL_CXXALIASWARN (wcsnrtombs);
733*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
734*c33252afSJohn Marino # undef wcsnrtombs
735*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNRTOMBS
736*c33252afSJohn Marino _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
737*c33252afSJohn Marino                  "use gnulib module wcsnrtombs for portability");
738*c33252afSJohn Marino # endif
739*c33252afSJohn Marino #endif
740*c33252afSJohn Marino 
741*c33252afSJohn Marino 
742*c33252afSJohn Marino /* Return the number of screen columns needed for WC.  */
743*c33252afSJohn Marino #if 0
744*c33252afSJohn Marino # if 0
745*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
746*c33252afSJohn Marino #   undef wcwidth
747*c33252afSJohn Marino #   define wcwidth rpl_wcwidth
748*c33252afSJohn Marino #  endif
749*c33252afSJohn Marino _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
750*c33252afSJohn Marino _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
751*c33252afSJohn Marino # else
752*c33252afSJohn Marino #  if !1
753*c33252afSJohn Marino /* wcwidth exists but is not declared.  */
754*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
755*c33252afSJohn Marino #  endif
756*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
757*c33252afSJohn Marino # endif
758*c33252afSJohn Marino _GL_CXXALIASWARN (wcwidth);
759*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
760*c33252afSJohn Marino # undef wcwidth
761*c33252afSJohn Marino # if HAVE_RAW_DECL_WCWIDTH
762*c33252afSJohn Marino _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
763*c33252afSJohn Marino                  "use gnulib module wcwidth for portability");
764*c33252afSJohn Marino # endif
765*c33252afSJohn Marino #endif
766*c33252afSJohn Marino 
767*c33252afSJohn Marino 
768*c33252afSJohn Marino /* Search N wide characters of S for C.  */
769*c33252afSJohn Marino #if 0
770*c33252afSJohn Marino # if !1
771*c33252afSJohn Marino _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
772*c33252afSJohn Marino                                       _GL_ATTRIBUTE_PURE);
773*c33252afSJohn Marino # endif
774*c33252afSJohn Marino   /* On some systems, this function is defined as an overloaded function:
775*c33252afSJohn Marino        extern "C++" {
776*c33252afSJohn Marino          const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
777*c33252afSJohn Marino          wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
778*c33252afSJohn Marino        }  */
779*c33252afSJohn Marino _GL_CXXALIAS_SYS_CAST2 (wmemchr,
780*c33252afSJohn Marino                         wchar_t *, (const wchar_t *, wchar_t, size_t),
781*c33252afSJohn Marino                         const wchar_t *, (const wchar_t *, wchar_t, size_t));
782*c33252afSJohn Marino # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
783*c33252afSJohn Marino      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
784*c33252afSJohn Marino _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
785*c33252afSJohn Marino _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
786*c33252afSJohn Marino                    (const wchar_t *s, wchar_t c, size_t n));
787*c33252afSJohn Marino # else
788*c33252afSJohn Marino _GL_CXXALIASWARN (wmemchr);
789*c33252afSJohn Marino # endif
790*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
791*c33252afSJohn Marino # undef wmemchr
792*c33252afSJohn Marino # if HAVE_RAW_DECL_WMEMCHR
793*c33252afSJohn Marino _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
794*c33252afSJohn Marino                  "use gnulib module wmemchr for portability");
795*c33252afSJohn Marino # endif
796*c33252afSJohn Marino #endif
797*c33252afSJohn Marino 
798*c33252afSJohn Marino 
799*c33252afSJohn Marino /* Compare N wide characters of S1 and S2.  */
800*c33252afSJohn Marino #if 0
801*c33252afSJohn Marino # if !1
802*c33252afSJohn Marino _GL_FUNCDECL_SYS (wmemcmp, int,
803*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n)
804*c33252afSJohn Marino                   _GL_ATTRIBUTE_PURE);
805*c33252afSJohn Marino # endif
806*c33252afSJohn Marino _GL_CXXALIAS_SYS (wmemcmp, int,
807*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n));
808*c33252afSJohn Marino _GL_CXXALIASWARN (wmemcmp);
809*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
810*c33252afSJohn Marino # undef wmemcmp
811*c33252afSJohn Marino # if HAVE_RAW_DECL_WMEMCMP
812*c33252afSJohn Marino _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
813*c33252afSJohn Marino                  "use gnulib module wmemcmp for portability");
814*c33252afSJohn Marino # endif
815*c33252afSJohn Marino #endif
816*c33252afSJohn Marino 
817*c33252afSJohn Marino 
818*c33252afSJohn Marino /* Copy N wide characters of SRC to DEST.  */
819*c33252afSJohn Marino #if 0
820*c33252afSJohn Marino # if !1
821*c33252afSJohn Marino _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
822*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
823*c33252afSJohn Marino # endif
824*c33252afSJohn Marino _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
825*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
826*c33252afSJohn Marino _GL_CXXALIASWARN (wmemcpy);
827*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
828*c33252afSJohn Marino # undef wmemcpy
829*c33252afSJohn Marino # if HAVE_RAW_DECL_WMEMCPY
830*c33252afSJohn Marino _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
831*c33252afSJohn Marino                  "use gnulib module wmemcpy for portability");
832*c33252afSJohn Marino # endif
833*c33252afSJohn Marino #endif
834*c33252afSJohn Marino 
835*c33252afSJohn Marino 
836*c33252afSJohn Marino /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
837*c33252afSJohn Marino    overlapping memory areas.  */
838*c33252afSJohn Marino #if 0
839*c33252afSJohn Marino # if !1
840*c33252afSJohn Marino _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
841*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
842*c33252afSJohn Marino # endif
843*c33252afSJohn Marino _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
844*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
845*c33252afSJohn Marino _GL_CXXALIASWARN (wmemmove);
846*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
847*c33252afSJohn Marino # undef wmemmove
848*c33252afSJohn Marino # if HAVE_RAW_DECL_WMEMMOVE
849*c33252afSJohn Marino _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
850*c33252afSJohn Marino                  "use gnulib module wmemmove for portability");
851*c33252afSJohn Marino # endif
852*c33252afSJohn Marino #endif
853*c33252afSJohn Marino 
854*c33252afSJohn Marino 
855*c33252afSJohn Marino /* Set N wide characters of S to C.  */
856*c33252afSJohn Marino #if 0
857*c33252afSJohn Marino # if !1
858*c33252afSJohn Marino _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
859*c33252afSJohn Marino # endif
860*c33252afSJohn Marino _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
861*c33252afSJohn Marino _GL_CXXALIASWARN (wmemset);
862*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
863*c33252afSJohn Marino # undef wmemset
864*c33252afSJohn Marino # if HAVE_RAW_DECL_WMEMSET
865*c33252afSJohn Marino _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
866*c33252afSJohn Marino                  "use gnulib module wmemset for portability");
867*c33252afSJohn Marino # endif
868*c33252afSJohn Marino #endif
869*c33252afSJohn Marino 
870*c33252afSJohn Marino 
871*c33252afSJohn Marino /* Return the number of wide characters in S.  */
872*c33252afSJohn Marino #if 0
873*c33252afSJohn Marino # if !1
874*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
875*c33252afSJohn Marino # endif
876*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
877*c33252afSJohn Marino _GL_CXXALIASWARN (wcslen);
878*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
879*c33252afSJohn Marino # undef wcslen
880*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSLEN
881*c33252afSJohn Marino _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
882*c33252afSJohn Marino                  "use gnulib module wcslen for portability");
883*c33252afSJohn Marino # endif
884*c33252afSJohn Marino #endif
885*c33252afSJohn Marino 
886*c33252afSJohn Marino 
887*c33252afSJohn Marino /* Return the number of wide characters in S, but at most MAXLEN.  */
888*c33252afSJohn Marino #if 0
889*c33252afSJohn Marino # if !1
890*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
891*c33252afSJohn Marino                                    _GL_ATTRIBUTE_PURE);
892*c33252afSJohn Marino # endif
893*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
894*c33252afSJohn Marino _GL_CXXALIASWARN (wcsnlen);
895*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
896*c33252afSJohn Marino # undef wcsnlen
897*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNLEN
898*c33252afSJohn Marino _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
899*c33252afSJohn Marino                  "use gnulib module wcsnlen for portability");
900*c33252afSJohn Marino # endif
901*c33252afSJohn Marino #endif
902*c33252afSJohn Marino 
903*c33252afSJohn Marino 
904*c33252afSJohn Marino /* Copy SRC to DEST.  */
905*c33252afSJohn Marino #if 0
906*c33252afSJohn Marino # if !1
907*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
908*c33252afSJohn Marino # endif
909*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
910*c33252afSJohn Marino _GL_CXXALIASWARN (wcscpy);
911*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
912*c33252afSJohn Marino # undef wcscpy
913*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCPY
914*c33252afSJohn Marino _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
915*c33252afSJohn Marino                  "use gnulib module wcscpy for portability");
916*c33252afSJohn Marino # endif
917*c33252afSJohn Marino #endif
918*c33252afSJohn Marino 
919*c33252afSJohn Marino 
920*c33252afSJohn Marino /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
921*c33252afSJohn Marino #if 0
922*c33252afSJohn Marino # if !1
923*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
924*c33252afSJohn Marino # endif
925*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
926*c33252afSJohn Marino _GL_CXXALIASWARN (wcpcpy);
927*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
928*c33252afSJohn Marino # undef wcpcpy
929*c33252afSJohn Marino # if HAVE_RAW_DECL_WCPCPY
930*c33252afSJohn Marino _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
931*c33252afSJohn Marino                  "use gnulib module wcpcpy for portability");
932*c33252afSJohn Marino # endif
933*c33252afSJohn Marino #endif
934*c33252afSJohn Marino 
935*c33252afSJohn Marino 
936*c33252afSJohn Marino /* Copy no more than N wide characters of SRC to DEST.  */
937*c33252afSJohn Marino #if 0
938*c33252afSJohn Marino # if !1
939*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
940*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
941*c33252afSJohn Marino # endif
942*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
943*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
944*c33252afSJohn Marino _GL_CXXALIASWARN (wcsncpy);
945*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
946*c33252afSJohn Marino # undef wcsncpy
947*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNCPY
948*c33252afSJohn Marino _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
949*c33252afSJohn Marino                  "use gnulib module wcsncpy for portability");
950*c33252afSJohn Marino # endif
951*c33252afSJohn Marino #endif
952*c33252afSJohn Marino 
953*c33252afSJohn Marino 
954*c33252afSJohn Marino /* Copy no more than N characters of SRC to DEST, returning the address of
955*c33252afSJohn Marino    the last character written into DEST.  */
956*c33252afSJohn Marino #if 0
957*c33252afSJohn Marino # if !1
958*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
959*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
960*c33252afSJohn Marino # endif
961*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
962*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
963*c33252afSJohn Marino _GL_CXXALIASWARN (wcpncpy);
964*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
965*c33252afSJohn Marino # undef wcpncpy
966*c33252afSJohn Marino # if HAVE_RAW_DECL_WCPNCPY
967*c33252afSJohn Marino _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
968*c33252afSJohn Marino                  "use gnulib module wcpncpy for portability");
969*c33252afSJohn Marino # endif
970*c33252afSJohn Marino #endif
971*c33252afSJohn Marino 
972*c33252afSJohn Marino 
973*c33252afSJohn Marino /* Append SRC onto DEST.  */
974*c33252afSJohn Marino #if 0
975*c33252afSJohn Marino # if !1
976*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
977*c33252afSJohn Marino # endif
978*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
979*c33252afSJohn Marino _GL_CXXALIASWARN (wcscat);
980*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
981*c33252afSJohn Marino # undef wcscat
982*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCAT
983*c33252afSJohn Marino _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
984*c33252afSJohn Marino                  "use gnulib module wcscat for portability");
985*c33252afSJohn Marino # endif
986*c33252afSJohn Marino #endif
987*c33252afSJohn Marino 
988*c33252afSJohn Marino 
989*c33252afSJohn Marino /* Append no more than N wide characters of SRC onto DEST.  */
990*c33252afSJohn Marino #if 0
991*c33252afSJohn Marino # if !1
992*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
993*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
994*c33252afSJohn Marino # endif
995*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
996*c33252afSJohn Marino                   (wchar_t *dest, const wchar_t *src, size_t n));
997*c33252afSJohn Marino _GL_CXXALIASWARN (wcsncat);
998*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
999*c33252afSJohn Marino # undef wcsncat
1000*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNCAT
1001*c33252afSJohn Marino _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1002*c33252afSJohn Marino                  "use gnulib module wcsncat for portability");
1003*c33252afSJohn Marino # endif
1004*c33252afSJohn Marino #endif
1005*c33252afSJohn Marino 
1006*c33252afSJohn Marino 
1007*c33252afSJohn Marino /* Compare S1 and S2.  */
1008*c33252afSJohn Marino #if 0
1009*c33252afSJohn Marino # if !1
1010*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
1011*c33252afSJohn Marino                                _GL_ATTRIBUTE_PURE);
1012*c33252afSJohn Marino # endif
1013*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1014*c33252afSJohn Marino _GL_CXXALIASWARN (wcscmp);
1015*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1016*c33252afSJohn Marino # undef wcscmp
1017*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCMP
1018*c33252afSJohn Marino _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1019*c33252afSJohn Marino                  "use gnulib module wcscmp for portability");
1020*c33252afSJohn Marino # endif
1021*c33252afSJohn Marino #endif
1022*c33252afSJohn Marino 
1023*c33252afSJohn Marino 
1024*c33252afSJohn Marino /* Compare no more than N wide characters of S1 and S2.  */
1025*c33252afSJohn Marino #if 0
1026*c33252afSJohn Marino # if !1
1027*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsncmp, int,
1028*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n)
1029*c33252afSJohn Marino                   _GL_ATTRIBUTE_PURE);
1030*c33252afSJohn Marino # endif
1031*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsncmp, int,
1032*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n));
1033*c33252afSJohn Marino _GL_CXXALIASWARN (wcsncmp);
1034*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1035*c33252afSJohn Marino # undef wcsncmp
1036*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNCMP
1037*c33252afSJohn Marino _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1038*c33252afSJohn Marino                  "use gnulib module wcsncmp for portability");
1039*c33252afSJohn Marino # endif
1040*c33252afSJohn Marino #endif
1041*c33252afSJohn Marino 
1042*c33252afSJohn Marino 
1043*c33252afSJohn Marino /* Compare S1 and S2, ignoring case.  */
1044*c33252afSJohn Marino #if 0
1045*c33252afSJohn Marino # if !1
1046*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
1047*c33252afSJohn Marino                                    _GL_ATTRIBUTE_PURE);
1048*c33252afSJohn Marino # endif
1049*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1050*c33252afSJohn Marino _GL_CXXALIASWARN (wcscasecmp);
1051*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1052*c33252afSJohn Marino # undef wcscasecmp
1053*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCASECMP
1054*c33252afSJohn Marino _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1055*c33252afSJohn Marino                  "use gnulib module wcscasecmp for portability");
1056*c33252afSJohn Marino # endif
1057*c33252afSJohn Marino #endif
1058*c33252afSJohn Marino 
1059*c33252afSJohn Marino 
1060*c33252afSJohn Marino /* Compare no more than N chars of S1 and S2, ignoring case.  */
1061*c33252afSJohn Marino #if 0
1062*c33252afSJohn Marino # if !1
1063*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsncasecmp, int,
1064*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n)
1065*c33252afSJohn Marino                   _GL_ATTRIBUTE_PURE);
1066*c33252afSJohn Marino # endif
1067*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsncasecmp, int,
1068*c33252afSJohn Marino                   (const wchar_t *s1, const wchar_t *s2, size_t n));
1069*c33252afSJohn Marino _GL_CXXALIASWARN (wcsncasecmp);
1070*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1071*c33252afSJohn Marino # undef wcsncasecmp
1072*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSNCASECMP
1073*c33252afSJohn Marino _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1074*c33252afSJohn Marino                  "use gnulib module wcsncasecmp for portability");
1075*c33252afSJohn Marino # endif
1076*c33252afSJohn Marino #endif
1077*c33252afSJohn Marino 
1078*c33252afSJohn Marino 
1079*c33252afSJohn Marino /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
1080*c33252afSJohn Marino    category of the current locale.  */
1081*c33252afSJohn Marino #if 0
1082*c33252afSJohn Marino # if !1
1083*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1084*c33252afSJohn Marino # endif
1085*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1086*c33252afSJohn Marino _GL_CXXALIASWARN (wcscoll);
1087*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1088*c33252afSJohn Marino # undef wcscoll
1089*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCOLL
1090*c33252afSJohn Marino _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1091*c33252afSJohn Marino                  "use gnulib module wcscoll for portability");
1092*c33252afSJohn Marino # endif
1093*c33252afSJohn Marino #endif
1094*c33252afSJohn Marino 
1095*c33252afSJohn Marino 
1096*c33252afSJohn Marino /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
1097*c33252afSJohn Marino    to two transformed strings the result is the as applying 'wcscoll' to the
1098*c33252afSJohn Marino    original strings.  */
1099*c33252afSJohn Marino #if 0
1100*c33252afSJohn Marino # if !1
1101*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1102*c33252afSJohn Marino # endif
1103*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
1104*c33252afSJohn Marino _GL_CXXALIASWARN (wcsxfrm);
1105*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1106*c33252afSJohn Marino # undef wcsxfrm
1107*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSXFRM
1108*c33252afSJohn Marino _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1109*c33252afSJohn Marino                  "use gnulib module wcsxfrm for portability");
1110*c33252afSJohn Marino # endif
1111*c33252afSJohn Marino #endif
1112*c33252afSJohn Marino 
1113*c33252afSJohn Marino 
1114*c33252afSJohn Marino /* Duplicate S, returning an identical malloc'd string.  */
1115*c33252afSJohn Marino #if 0
1116*c33252afSJohn Marino # if !1
1117*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1118*c33252afSJohn Marino # endif
1119*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1120*c33252afSJohn Marino _GL_CXXALIASWARN (wcsdup);
1121*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1122*c33252afSJohn Marino # undef wcsdup
1123*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSDUP
1124*c33252afSJohn Marino _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1125*c33252afSJohn Marino                  "use gnulib module wcsdup for portability");
1126*c33252afSJohn Marino # endif
1127*c33252afSJohn Marino #endif
1128*c33252afSJohn Marino 
1129*c33252afSJohn Marino 
1130*c33252afSJohn Marino /* Find the first occurrence of WC in WCS.  */
1131*c33252afSJohn Marino #if 0
1132*c33252afSJohn Marino # if !1
1133*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1134*c33252afSJohn Marino                                      _GL_ATTRIBUTE_PURE);
1135*c33252afSJohn Marino # endif
1136*c33252afSJohn Marino   /* On some systems, this function is defined as an overloaded function:
1137*c33252afSJohn Marino        extern "C++" {
1138*c33252afSJohn Marino          const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1139*c33252afSJohn Marino          wchar_t * std::wcschr (wchar_t *, wchar_t);
1140*c33252afSJohn Marino        }  */
1141*c33252afSJohn Marino _GL_CXXALIAS_SYS_CAST2 (wcschr,
1142*c33252afSJohn Marino                         wchar_t *, (const wchar_t *, wchar_t),
1143*c33252afSJohn Marino                         const wchar_t *, (const wchar_t *, wchar_t));
1144*c33252afSJohn Marino # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1145*c33252afSJohn Marino      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1146*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1147*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1148*c33252afSJohn Marino # else
1149*c33252afSJohn Marino _GL_CXXALIASWARN (wcschr);
1150*c33252afSJohn Marino # endif
1151*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1152*c33252afSJohn Marino # undef wcschr
1153*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCHR
1154*c33252afSJohn Marino _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1155*c33252afSJohn Marino                  "use gnulib module wcschr for portability");
1156*c33252afSJohn Marino # endif
1157*c33252afSJohn Marino #endif
1158*c33252afSJohn Marino 
1159*c33252afSJohn Marino 
1160*c33252afSJohn Marino /* Find the last occurrence of WC in WCS.  */
1161*c33252afSJohn Marino #if 0
1162*c33252afSJohn Marino # if !1
1163*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1164*c33252afSJohn Marino                                       _GL_ATTRIBUTE_PURE);
1165*c33252afSJohn Marino # endif
1166*c33252afSJohn Marino   /* On some systems, this function is defined as an overloaded function:
1167*c33252afSJohn Marino        extern "C++" {
1168*c33252afSJohn Marino          const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1169*c33252afSJohn Marino          wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1170*c33252afSJohn Marino        }  */
1171*c33252afSJohn Marino _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1172*c33252afSJohn Marino                         wchar_t *, (const wchar_t *, wchar_t),
1173*c33252afSJohn Marino                         const wchar_t *, (const wchar_t *, wchar_t));
1174*c33252afSJohn Marino # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1175*c33252afSJohn Marino      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1176*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1177*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1178*c33252afSJohn Marino # else
1179*c33252afSJohn Marino _GL_CXXALIASWARN (wcsrchr);
1180*c33252afSJohn Marino # endif
1181*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1182*c33252afSJohn Marino # undef wcsrchr
1183*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSRCHR
1184*c33252afSJohn Marino _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1185*c33252afSJohn Marino                  "use gnulib module wcsrchr for portability");
1186*c33252afSJohn Marino # endif
1187*c33252afSJohn Marino #endif
1188*c33252afSJohn Marino 
1189*c33252afSJohn Marino 
1190*c33252afSJohn Marino /* Return the length of the initial segmet of WCS which consists entirely
1191*c33252afSJohn Marino    of wide characters not in REJECT.  */
1192*c33252afSJohn Marino #if 0
1193*c33252afSJohn Marino # if !1
1194*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1195*c33252afSJohn Marino                                    _GL_ATTRIBUTE_PURE);
1196*c33252afSJohn Marino # endif
1197*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1198*c33252afSJohn Marino _GL_CXXALIASWARN (wcscspn);
1199*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1200*c33252afSJohn Marino # undef wcscspn
1201*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSCSPN
1202*c33252afSJohn Marino _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1203*c33252afSJohn Marino                  "use gnulib module wcscspn for portability");
1204*c33252afSJohn Marino # endif
1205*c33252afSJohn Marino #endif
1206*c33252afSJohn Marino 
1207*c33252afSJohn Marino 
1208*c33252afSJohn Marino /* Return the length of the initial segmet of WCS which consists entirely
1209*c33252afSJohn Marino    of wide characters in ACCEPT.  */
1210*c33252afSJohn Marino #if 0
1211*c33252afSJohn Marino # if !1
1212*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1213*c33252afSJohn Marino                                   _GL_ATTRIBUTE_PURE);
1214*c33252afSJohn Marino # endif
1215*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1216*c33252afSJohn Marino _GL_CXXALIASWARN (wcsspn);
1217*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1218*c33252afSJohn Marino # undef wcsspn
1219*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSSPN
1220*c33252afSJohn Marino _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1221*c33252afSJohn Marino                  "use gnulib module wcsspn for portability");
1222*c33252afSJohn Marino # endif
1223*c33252afSJohn Marino #endif
1224*c33252afSJohn Marino 
1225*c33252afSJohn Marino 
1226*c33252afSJohn Marino /* Find the first occurrence in WCS of any character in ACCEPT.  */
1227*c33252afSJohn Marino #if 0
1228*c33252afSJohn Marino # if !1
1229*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1230*c33252afSJohn Marino                   (const wchar_t *wcs, const wchar_t *accept)
1231*c33252afSJohn Marino                   _GL_ATTRIBUTE_PURE);
1232*c33252afSJohn Marino # endif
1233*c33252afSJohn Marino   /* On some systems, this function is defined as an overloaded function:
1234*c33252afSJohn Marino        extern "C++" {
1235*c33252afSJohn Marino          const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1236*c33252afSJohn Marino          wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1237*c33252afSJohn Marino        }  */
1238*c33252afSJohn Marino _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1239*c33252afSJohn Marino                         wchar_t *, (const wchar_t *, const wchar_t *),
1240*c33252afSJohn Marino                         const wchar_t *, (const wchar_t *, const wchar_t *));
1241*c33252afSJohn Marino # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1242*c33252afSJohn Marino      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1243*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1244*c33252afSJohn Marino                    (wchar_t *wcs, const wchar_t *accept));
1245*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1246*c33252afSJohn Marino                    (const wchar_t *wcs, const wchar_t *accept));
1247*c33252afSJohn Marino # else
1248*c33252afSJohn Marino _GL_CXXALIASWARN (wcspbrk);
1249*c33252afSJohn Marino # endif
1250*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1251*c33252afSJohn Marino # undef wcspbrk
1252*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSPBRK
1253*c33252afSJohn Marino _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1254*c33252afSJohn Marino                  "use gnulib module wcspbrk for portability");
1255*c33252afSJohn Marino # endif
1256*c33252afSJohn Marino #endif
1257*c33252afSJohn Marino 
1258*c33252afSJohn Marino 
1259*c33252afSJohn Marino /* Find the first occurrence of NEEDLE in HAYSTACK.  */
1260*c33252afSJohn Marino #if 0
1261*c33252afSJohn Marino # if !1
1262*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1263*c33252afSJohn Marino                   (const wchar_t *haystack, const wchar_t *needle)
1264*c33252afSJohn Marino                   _GL_ATTRIBUTE_PURE);
1265*c33252afSJohn Marino # endif
1266*c33252afSJohn Marino   /* On some systems, this function is defined as an overloaded function:
1267*c33252afSJohn Marino        extern "C++" {
1268*c33252afSJohn Marino          const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1269*c33252afSJohn Marino          wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1270*c33252afSJohn Marino        }  */
1271*c33252afSJohn Marino _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1272*c33252afSJohn Marino                         wchar_t *, (const wchar_t *, const wchar_t *),
1273*c33252afSJohn Marino                         const wchar_t *, (const wchar_t *, const wchar_t *));
1274*c33252afSJohn Marino # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1275*c33252afSJohn Marino      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1276*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1277*c33252afSJohn Marino                    (wchar_t *haystack, const wchar_t *needle));
1278*c33252afSJohn Marino _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1279*c33252afSJohn Marino                    (const wchar_t *haystack, const wchar_t *needle));
1280*c33252afSJohn Marino # else
1281*c33252afSJohn Marino _GL_CXXALIASWARN (wcsstr);
1282*c33252afSJohn Marino # endif
1283*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1284*c33252afSJohn Marino # undef wcsstr
1285*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSSTR
1286*c33252afSJohn Marino _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1287*c33252afSJohn Marino                  "use gnulib module wcsstr for portability");
1288*c33252afSJohn Marino # endif
1289*c33252afSJohn Marino #endif
1290*c33252afSJohn Marino 
1291*c33252afSJohn Marino 
1292*c33252afSJohn Marino /* Divide WCS into tokens separated by characters in DELIM.  */
1293*c33252afSJohn Marino #if 0
1294*c33252afSJohn Marino # if !1
1295*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1296*c33252afSJohn Marino                   (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1297*c33252afSJohn Marino # endif
1298*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1299*c33252afSJohn Marino                   (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
1300*c33252afSJohn Marino _GL_CXXALIASWARN (wcstok);
1301*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1302*c33252afSJohn Marino # undef wcstok
1303*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSTOK
1304*c33252afSJohn Marino _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1305*c33252afSJohn Marino                  "use gnulib module wcstok for portability");
1306*c33252afSJohn Marino # endif
1307*c33252afSJohn Marino #endif
1308*c33252afSJohn Marino 
1309*c33252afSJohn Marino 
1310*c33252afSJohn Marino /* Determine number of column positions required for first N wide
1311*c33252afSJohn Marino    characters (or fewer if S ends before this) in S.  */
1312*c33252afSJohn Marino #if 0
1313*c33252afSJohn Marino # if 0
1314*c33252afSJohn Marino #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1315*c33252afSJohn Marino #   undef wcswidth
1316*c33252afSJohn Marino #   define wcswidth rpl_wcswidth
1317*c33252afSJohn Marino #  endif
1318*c33252afSJohn Marino _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1319*c33252afSJohn Marino                                  _GL_ATTRIBUTE_PURE);
1320*c33252afSJohn Marino _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1321*c33252afSJohn Marino # else
1322*c33252afSJohn Marino #  if !1
1323*c33252afSJohn Marino _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1324*c33252afSJohn Marino                                  _GL_ATTRIBUTE_PURE);
1325*c33252afSJohn Marino #  endif
1326*c33252afSJohn Marino _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1327*c33252afSJohn Marino # endif
1328*c33252afSJohn Marino _GL_CXXALIASWARN (wcswidth);
1329*c33252afSJohn Marino #elif defined GNULIB_POSIXCHECK
1330*c33252afSJohn Marino # undef wcswidth
1331*c33252afSJohn Marino # if HAVE_RAW_DECL_WCSWIDTH
1332*c33252afSJohn Marino _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1333*c33252afSJohn Marino                  "use gnulib module wcswidth for portability");
1334*c33252afSJohn Marino # endif
1335*c33252afSJohn Marino #endif
1336*c33252afSJohn Marino 
1337*c33252afSJohn Marino 
1338*c33252afSJohn Marino #endif /* _GL_WCHAR_H */
1339*c33252afSJohn Marino #endif /* _GL_WCHAR_H */
1340*c33252afSJohn Marino #endif
1341