xref: /Universal-ctags/win32/gnulib_h/wchar.h (revision b1e8ecf2bc855e6f2e21fef8ee2f21ee477be7f7)
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
3 
4    Copyright (C) 2007-2021 Free Software Foundation, Inc.
5 
6    This file is free software: you can redistribute it and/or modify
7    it under the terms of the GNU Lesser General Public License as
8    published by the Free Software Foundation; either version 2.1 of the
9    License, or (at your option) any later version.
10 
11    This file 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 Lesser General Public License for more details.
15 
16    You should have received a copy of the GNU Lesser General Public License
17    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
18 
19 /* Written by Eric Blake.  */
20 
21 /*
22  * ISO C 99 <wchar.h> for platforms that have issues.
23  * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/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)               \
35       && !defined __MINGW32__)                                          \
36      || (defined __hpux                                                 \
37          && ((defined _INTTYPES_INCLUDED                                \
38               && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H)     \
39              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
40      || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
41      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
42 /* Special invocation convention:
43    - Inside glibc and uClibc header files, but not MinGW.
44    - On HP-UX 11.00 we have a sequence of nested includes
45      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
46      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
47      and once directly.  In both situations 'wint_t' is not yet defined,
48      therefore we cannot provide the function overrides; instead include only
49      the system's <wchar.h>.
50    - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
51      <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
52    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
53      the latter includes <wchar.h>.  But here, we have no way to detect whether
54      <wctype.h> is completely included or is still being included.  */
55 
56 #include_next <wchar.h>
57 
58 #else
59 /* Normal invocation convention.  */
60 
61 #ifndef _GL_WCHAR_H
62 
63 #define _GL_ALREADY_INCLUDING_WCHAR_H
64 
65 #if 0
66 # include <features.h> /* for __GLIBC__ */
67 #endif
68 
69 /* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
70    by <stddef.h>.
71    But avoid namespace pollution on glibc systems.  */
72 #if !(defined __GLIBC__ && !defined __UCLIBC__)
73 # include <stddef.h>
74 #endif
75 
76 /* Include the original <wchar.h> if it exists.
77    Some builds of uClibc lack it.  */
78 /* The include_next requires a split double-inclusion guard.  */
79 #if 1
80 # include_next <wchar.h>
81 #endif
82 
83 #undef _GL_ALREADY_INCLUDING_WCHAR_H
84 
85 #ifndef _GL_WCHAR_H
86 #define _GL_WCHAR_H
87 
88 /* The __attribute__ feature is available in gcc versions 2.5 and later.
89    The attribute __pure__ was added in gcc 2.96.  */
90 #ifndef _GL_ATTRIBUTE_PURE
91 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
92 #  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
93 # else
94 #  define _GL_ATTRIBUTE_PURE /* empty */
95 # endif
96 #endif
97 
98 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
99 /* C++ compatible function declaration macros.
100    Copyright (C) 2010-2021 Free Software Foundation, Inc.
101 
102    This program is free software: you can redistribute it and/or modify it
103    under the terms of the GNU Lesser General Public License as published
104    by the Free Software Foundation; either version 2 of the License, or
105    (at your option) any later version.
106 
107    This program is distributed in the hope that it will be useful,
108    but WITHOUT ANY WARRANTY; without even the implied warranty of
109    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
110    Lesser General Public License for more details.
111 
112    You should have received a copy of the GNU Lesser General Public License
113    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
114 
115 #ifndef _GL_CXXDEFS_H
116 #define _GL_CXXDEFS_H
117 
118 /* Begin/end the GNULIB_NAMESPACE namespace.  */
119 #if defined __cplusplus && defined GNULIB_NAMESPACE
120 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
121 # define _GL_END_NAMESPACE }
122 #else
123 # define _GL_BEGIN_NAMESPACE
124 # define _GL_END_NAMESPACE
125 #endif
126 
127 /* The three most frequent use cases of these macros are:
128 
129    * For providing a substitute for a function that is missing on some
130      platforms, but is declared and works fine on the platforms on which
131      it exists:
132 
133        #if @GNULIB_FOO@
134        # if !@HAVE_FOO@
135        _GL_FUNCDECL_SYS (foo, ...);
136        # endif
137        _GL_CXXALIAS_SYS (foo, ...);
138        _GL_CXXALIASWARN (foo);
139        #elif defined GNULIB_POSIXCHECK
140        ...
141        #endif
142 
143    * For providing a replacement for a function that exists on all platforms,
144      but is broken/insufficient and needs to be replaced on some platforms:
145 
146        #if @GNULIB_FOO@
147        # if @REPLACE_FOO@
148        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
149        #   undef foo
150        #   define foo rpl_foo
151        #  endif
152        _GL_FUNCDECL_RPL (foo, ...);
153        _GL_CXXALIAS_RPL (foo, ...);
154        # else
155        _GL_CXXALIAS_SYS (foo, ...);
156        # endif
157        _GL_CXXALIASWARN (foo);
158        #elif defined GNULIB_POSIXCHECK
159        ...
160        #endif
161 
162    * For providing a replacement for a function that exists on some platforms
163      but is broken/insufficient and needs to be replaced on some of them and
164      is additionally either missing or undeclared on some other platforms:
165 
166        #if @GNULIB_FOO@
167        # if @REPLACE_FOO@
168        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
169        #   undef foo
170        #   define foo rpl_foo
171        #  endif
172        _GL_FUNCDECL_RPL (foo, ...);
173        _GL_CXXALIAS_RPL (foo, ...);
174        # else
175        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
176        _GL_FUNCDECL_SYS (foo, ...);
177        #  endif
178        _GL_CXXALIAS_SYS (foo, ...);
179        # endif
180        _GL_CXXALIASWARN (foo);
181        #elif defined GNULIB_POSIXCHECK
182        ...
183        #endif
184 */
185 
186 /* _GL_EXTERN_C declaration;
187    performs the declaration with C linkage.  */
188 #if defined __cplusplus
189 # define _GL_EXTERN_C extern "C"
190 #else
191 # define _GL_EXTERN_C extern
192 #endif
193 
194 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
195    declares a replacement function, named rpl_func, with the given prototype,
196    consisting of return type, parameters, and attributes.
197    Example:
198      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
199                                   _GL_ARG_NONNULL ((1)));
200  */
201 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
202   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
203 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
204   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
205 
206 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
207    declares the system function, named func, with the given prototype,
208    consisting of return type, parameters, and attributes.
209    Example:
210      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
211                                   _GL_ARG_NONNULL ((1)));
212  */
213 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
214   _GL_EXTERN_C rettype func parameters_and_attributes
215 
216 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
217    declares a C++ alias called GNULIB_NAMESPACE::func
218    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
219    Example:
220      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
221 
222    Wrapping rpl_func in an object with an inline conversion operator
223    avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
224    actually used in the program.  */
225 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
226   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
227 #if defined __cplusplus && defined GNULIB_NAMESPACE
228 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
229     namespace GNULIB_NAMESPACE                                \
230     {                                                         \
231       static const struct _gl_ ## func ## _wrapper            \
232       {                                                       \
233         typedef rettype (*type) parameters;                   \
234                                                               \
235         inline operator type () const                         \
236         {                                                     \
237           return ::rpl_func;                                  \
238         }                                                     \
239       } func = {};                                            \
240     }                                                         \
241     _GL_EXTERN_C int _gl_cxxalias_dummy
242 #else
243 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
244     _GL_EXTERN_C int _gl_cxxalias_dummy
245 #endif
246 
247 /* _GL_CXXALIAS_MDA (func, rettype, parameters);
248    is to be used when func is a Microsoft deprecated alias, on native Windows.
249    It declares a C++ alias called GNULIB_NAMESPACE::func
250    that redirects to _func, if GNULIB_NAMESPACE is defined.
251    Example:
252      _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
253  */
254 #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
255   _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
256 
257 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
258    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
259    except that the C function rpl_func may have a slightly different
260    declaration.  A cast is used to silence the "invalid conversion" error
261    that would otherwise occur.  */
262 #if defined __cplusplus && defined GNULIB_NAMESPACE
263 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
264     namespace GNULIB_NAMESPACE                                     \
265     {                                                              \
266       static const struct _gl_ ## func ## _wrapper                 \
267       {                                                            \
268         typedef rettype (*type) parameters;                        \
269                                                                    \
270         inline operator type () const                              \
271         {                                                          \
272           return reinterpret_cast<type>(::rpl_func);               \
273         }                                                          \
274       } func = {};                                                 \
275     }                                                              \
276     _GL_EXTERN_C int _gl_cxxalias_dummy
277 #else
278 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
279     _GL_EXTERN_C int _gl_cxxalias_dummy
280 #endif
281 
282 /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
283    is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
284    except that the C function func may have a slightly different declaration.
285    A cast is used to silence the "invalid conversion" error that would
286    otherwise occur.  */
287 #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
288   _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
289 
290 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
291    declares a C++ alias called GNULIB_NAMESPACE::func
292    that redirects to the system provided function func, if GNULIB_NAMESPACE
293    is defined.
294    Example:
295      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
296 
297    Wrapping func in an object with an inline conversion operator
298    avoids a reference to func unless GNULIB_NAMESPACE::func is
299    actually used in the program.  */
300 #if defined __cplusplus && defined GNULIB_NAMESPACE
301 # define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
302     namespace GNULIB_NAMESPACE                                \
303     {                                                         \
304       static const struct _gl_ ## func ## _wrapper            \
305       {                                                       \
306         typedef rettype (*type) parameters;                   \
307                                                               \
308         inline operator type () const                         \
309         {                                                     \
310           return ::func;                                      \
311         }                                                     \
312       } func = {};                                            \
313     }                                                         \
314     _GL_EXTERN_C int _gl_cxxalias_dummy
315 #else
316 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
317     _GL_EXTERN_C int _gl_cxxalias_dummy
318 #endif
319 
320 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
321    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
322    except that the C function func may have a slightly different declaration.
323    A cast is used to silence the "invalid conversion" error that would
324    otherwise occur.  */
325 #if defined __cplusplus && defined GNULIB_NAMESPACE
326 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
327     namespace GNULIB_NAMESPACE                          \
328     {                                                   \
329       static const struct _gl_ ## func ## _wrapper      \
330       {                                                 \
331         typedef rettype (*type) parameters;             \
332                                                         \
333         inline operator type () const                   \
334         {                                               \
335           return reinterpret_cast<type>(::func);        \
336         }                                               \
337       } func = {};                                      \
338     }                                                   \
339     _GL_EXTERN_C int _gl_cxxalias_dummy
340 #else
341 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
342     _GL_EXTERN_C int _gl_cxxalias_dummy
343 #endif
344 
345 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
346    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
347    except that the C function is picked among a set of overloaded functions,
348    namely the one with rettype2 and parameters2.  Two consecutive casts
349    are used to silence the "cannot find a match" and "invalid conversion"
350    errors that would otherwise occur.  */
351 #if defined __cplusplus && defined GNULIB_NAMESPACE
352   /* The outer cast must be a reinterpret_cast.
353      The inner cast: When the function is defined as a set of overloaded
354      functions, it works as a static_cast<>, choosing the designated variant.
355      When the function is defined as a single variant, it works as a
356      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
357 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
358     namespace GNULIB_NAMESPACE                                                \
359     {                                                                         \
360       static const struct _gl_ ## func ## _wrapper                            \
361       {                                                                       \
362         typedef rettype (*type) parameters;                                   \
363                                                                               \
364         inline operator type () const                                         \
365         {                                                                     \
366           return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
367         }                                                                     \
368       } func = {};                                                            \
369     }                                                                         \
370     _GL_EXTERN_C int _gl_cxxalias_dummy
371 #else
372 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
373     _GL_EXTERN_C int _gl_cxxalias_dummy
374 #endif
375 
376 /* _GL_CXXALIASWARN (func);
377    causes a warning to be emitted when ::func is used but not when
378    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
379    variants.  */
380 #if defined __cplusplus && defined GNULIB_NAMESPACE
381 # define _GL_CXXALIASWARN(func) \
382    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
383 # define _GL_CXXALIASWARN_1(func,namespace) \
384    _GL_CXXALIASWARN_2 (func, namespace)
385 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
386    we enable the warning only when not optimizing.  */
387 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
388 #  define _GL_CXXALIASWARN_2(func,namespace) \
389     _GL_WARN_ON_USE (func, \
390                      "The symbol ::" #func " refers to the system function. " \
391                      "Use " #namespace "::" #func " instead.")
392 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
393 #  define _GL_CXXALIASWARN_2(func,namespace) \
394      extern __typeof__ (func) func
395 # else
396 #  define _GL_CXXALIASWARN_2(func,namespace) \
397      _GL_EXTERN_C int _gl_cxxalias_dummy
398 # endif
399 #else
400 # define _GL_CXXALIASWARN(func) \
401     _GL_EXTERN_C int _gl_cxxalias_dummy
402 #endif
403 
404 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
405    causes a warning to be emitted when the given overloaded variant of ::func
406    is used but not when GNULIB_NAMESPACE::func is used.  */
407 #if defined __cplusplus && defined GNULIB_NAMESPACE
408 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
409    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
410                         GNULIB_NAMESPACE)
411 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
412    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
413 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
414    we enable the warning only when not optimizing.  */
415 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
416 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
417     _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
418                          "The symbol ::" #func " refers to the system function. " \
419                          "Use " #namespace "::" #func " instead.")
420 # else
421 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
422      _GL_EXTERN_C int _gl_cxxalias_dummy
423 # endif
424 #else
425 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
426     _GL_EXTERN_C int _gl_cxxalias_dummy
427 #endif
428 
429 #endif /* _GL_CXXDEFS_H */
430 
431 /* The definition of _GL_ARG_NONNULL is copied here.  */
432 /* A C macro for declaring that specific arguments must not be NULL.
433    Copyright (C) 2009-2021 Free Software Foundation, Inc.
434 
435    This program is free software: you can redistribute it and/or modify it
436    under the terms of the GNU Lesser General Public License as published
437    by the Free Software Foundation; either version 2 of the License, or
438    (at your option) any later version.
439 
440    This program is distributed in the hope that it will be useful,
441    but WITHOUT ANY WARRANTY; without even the implied warranty of
442    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
443    Lesser General Public License for more details.
444 
445    You should have received a copy of the GNU Lesser General Public License
446    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
447 
448 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
449    that the values passed as arguments n, ..., m must be non-NULL pointers.
450    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
451 #ifndef _GL_ARG_NONNULL
452 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
453 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
454 # else
455 #  define _GL_ARG_NONNULL(params)
456 # endif
457 #endif
458 
459 /* The definition of _GL_WARN_ON_USE is copied here.  */
460 /* A C macro for emitting warnings if a function is used.
461    Copyright (C) 2010-2021 Free Software Foundation, Inc.
462 
463    This program is free software: you can redistribute it and/or modify it
464    under the terms of the GNU Lesser General Public License as published
465    by the Free Software Foundation; either version 2 of the License, or
466    (at your option) any later version.
467 
468    This program is distributed in the hope that it will be useful,
469    but WITHOUT ANY WARRANTY; without even the implied warranty of
470    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
471    Lesser General Public License for more details.
472 
473    You should have received a copy of the GNU Lesser General Public License
474    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
475 
476 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
477    for FUNCTION which will then trigger a compiler warning containing
478    the text of "literal string" anywhere that function is called, if
479    supported by the compiler.  If the compiler does not support this
480    feature, the macro expands to an unused extern declaration.
481 
482    _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
483    attribute used in _GL_WARN_ON_USE.  If the compiler does not support
484    this feature, it expands to empty.
485 
486    These macros are useful for marking a function as a potential
487    portability trap, with the intent that "literal string" include
488    instructions on the replacement function that should be used
489    instead.
490    _GL_WARN_ON_USE is for functions with 'extern' linkage.
491    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
492    linkage.
493 
494    However, one of the reasons that a function is a portability trap is
495    if it has the wrong signature.  Declaring FUNCTION with a different
496    signature in C is a compilation error, so this macro must use the
497    same type as any existing declaration so that programs that avoid
498    the problematic FUNCTION do not fail to compile merely because they
499    included a header that poisoned the function.  But this implies that
500    _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
501    have a declaration.  Use of this macro implies that there must not
502    be any other macro hiding the declaration of FUNCTION; but
503    undefining FUNCTION first is part of the poisoning process anyway
504    (although for symbols that are provided only via a macro, the result
505    is a compilation error rather than a warning containing
506    "literal string").  Also note that in C++, it is only safe to use if
507    FUNCTION has no overloads.
508 
509    For an example, it is possible to poison 'getline' by:
510    - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
511      [getline]) in configure.ac, which potentially defines
512      HAVE_RAW_DECL_GETLINE
513    - adding this code to a header that wraps the system <stdio.h>:
514      #undef getline
515      #if HAVE_RAW_DECL_GETLINE
516      _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
517        "not universally present; use the gnulib module getline");
518      #endif
519 
520    It is not possible to directly poison global variables.  But it is
521    possible to write a wrapper accessor function, and poison that
522    (less common usage, like &environ, will cause a compilation error
523    rather than issue the nice warning, but the end result of informing
524    the developer about their portability problem is still achieved):
525      #if HAVE_RAW_DECL_ENVIRON
526      static char ***
527      rpl_environ (void) { return &environ; }
528      _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
529      # undef environ
530      # define environ (*rpl_environ ())
531      #endif
532    or better (avoiding contradictory use of 'static' and 'extern'):
533      #if HAVE_RAW_DECL_ENVIRON
534      static char ***
535      _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
536      rpl_environ (void) { return &environ; }
537      # undef environ
538      # define environ (*rpl_environ ())
539      #endif
540    */
541 #ifndef _GL_WARN_ON_USE
542 
543 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
544 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
545 #  define _GL_WARN_ON_USE(function, message) \
546 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
547 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
548   __attribute__ ((__warning__ (message)))
549 # elif __clang_major__ >= 4
550 /* Another compiler attribute is available in clang.  */
551 #  define _GL_WARN_ON_USE(function, message) \
552 extern __typeof__ (function) function \
553   __attribute__ ((__diagnose_if__ (1, message, "warning")))
554 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
555   __attribute__ ((__diagnose_if__ (1, message, "warning")))
556 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
557 /* Verify the existence of the function.  */
558 #  define _GL_WARN_ON_USE(function, message) \
559 extern __typeof__ (function) function
560 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
561 # else /* Unsupported.  */
562 #  define _GL_WARN_ON_USE(function, message) \
563 _GL_WARN_EXTERN_C int _gl_warn_on_use
564 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
565 # endif
566 #endif
567 
568 /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
569    is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
570    function is declared with the given prototype, consisting of return type,
571    parameters, and attributes.
572    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
573    not work in this case.  */
574 #ifndef _GL_WARN_ON_USE_CXX
575 # if !defined __cplusplus
576 #  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
577      _GL_WARN_ON_USE (function, msg)
578 # else
579 #  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
580 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
581 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
582 extern rettype_gcc function parameters_and_attributes \
583   __attribute__ ((__warning__ (msg)))
584 #  elif __clang_major__ >= 4
585 /* Another compiler attribute is available in clang.  */
586 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
587 extern rettype_clang function parameters_and_attributes \
588   __attribute__ ((__diagnose_if__ (1, msg, "warning")))
589 #  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
590 /* Verify the existence of the function.  */
591 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
592 extern rettype_gcc function parameters_and_attributes
593 #  else /* Unsupported.  */
594 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
595 _GL_WARN_EXTERN_C int _gl_warn_on_use
596 #  endif
597 # endif
598 #endif
599 
600 /* _GL_WARN_EXTERN_C declaration;
601    performs the declaration with C linkage.  */
602 #ifndef _GL_WARN_EXTERN_C
603 # if defined __cplusplus
604 #  define _GL_WARN_EXTERN_C extern "C"
605 # else
606 #  define _GL_WARN_EXTERN_C extern
607 # endif
608 #endif
609 
610 
611 /* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
612 #if !1 && !defined wint_t
613 # define wint_t int
614 # ifndef WEOF
615 #  define WEOF -1
616 # endif
617 #else
618 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
619    <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
620    wint_t must be "unchanged by default argument promotions".  Override it.  */
621 # if 0
622 #  if !GNULIB_defined_wint_t
623 #   if 0
624 #    include <crtdefs.h>
625 #   else
626 #    include <stddef.h>
627 #   endif
628 typedef unsigned int rpl_wint_t;
629 #   undef wint_t
630 #   define wint_t rpl_wint_t
631 #   define GNULIB_defined_wint_t 1
632 #  endif
633 # endif
634 # ifndef WEOF
635 #  define WEOF ((wint_t) -1)
636 # endif
637 #endif
638 
639 
640 /* Override mbstate_t if it is too small.
641    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
642    implementing mbrtowc for encodings like UTF-8.
643    On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
644    large enough and overriding it would cause problems in C++ mode.  */
645 #if !(((defined _WIN32 && !defined __CYGWIN__) || 1) && 1) || 0
646 # if !GNULIB_defined_mbstate_t
647 #  if !(defined _AIX || defined _MSC_VER)
648 typedef int rpl_mbstate_t;
649 #   undef mbstate_t
650 #   define mbstate_t rpl_mbstate_t
651 #  endif
652 #  define GNULIB_defined_mbstate_t 1
653 # endif
654 #endif
655 
656 
657 /* Convert a single-byte character to a wide character.  */
658 #if 1
659 # if 0
660 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
661 #   undef btowc
662 #   define btowc rpl_btowc
663 #  endif
664 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
665 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
666 # else
667 #  if !1
668 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
669 #  endif
670 /* Need to cast, because on mingw, the return type is 'unsigned short'.  */
671 _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
672 # endif
673 # if __GLIBC__ >= 2
674 _GL_CXXALIASWARN (btowc);
675 # endif
676 #elif defined GNULIB_POSIXCHECK
677 # undef btowc
678 # if HAVE_RAW_DECL_BTOWC
679 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
680                  "use gnulib module btowc for portability");
681 # endif
682 #endif
683 
684 
685 /* Convert a wide character to a single-byte character.  */
686 #if 0
687 # if 0
688 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
689 #   undef wctob
690 #   define wctob rpl_wctob
691 #  endif
692 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
693 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
694 # else
695 #  if !defined wctob && !1
696 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
697 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
698 #  endif
699 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
700 # endif
701 # if __GLIBC__ >= 2
702 _GL_CXXALIASWARN (wctob);
703 # endif
704 #elif defined GNULIB_POSIXCHECK
705 # undef wctob
706 # if HAVE_RAW_DECL_WCTOB
707 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
708                  "use gnulib module wctob for portability");
709 # endif
710 #endif
711 
712 
713 /* Test whether *PS is in the initial state.  */
714 #if 1
715 # if 0
716 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
717 #   undef mbsinit
718 #   define mbsinit rpl_mbsinit
719 #  endif
720 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
721 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
722 # else
723 #  if !1
724 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
725 #  endif
726 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
727 # endif
728 # if __GLIBC__ >= 2
729 _GL_CXXALIASWARN (mbsinit);
730 # endif
731 #elif defined GNULIB_POSIXCHECK
732 # undef mbsinit
733 # if HAVE_RAW_DECL_MBSINIT
734 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
735                  "use gnulib module mbsinit for portability");
736 # endif
737 #endif
738 
739 
740 /* Convert a multibyte character to a wide character.  */
741 #if 1
742 # if 0
743 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
744 #   undef mbrtowc
745 #   define mbrtowc rpl_mbrtowc
746 #  endif
747 _GL_FUNCDECL_RPL (mbrtowc, size_t,
748                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
749                    mbstate_t *restrict ps));
750 _GL_CXXALIAS_RPL (mbrtowc, size_t,
751                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
752                    mbstate_t *restrict ps));
753 # else
754 #  if !1
755 _GL_FUNCDECL_SYS (mbrtowc, size_t,
756                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
757                    mbstate_t *restrict ps));
758 #  endif
759 _GL_CXXALIAS_SYS (mbrtowc, size_t,
760                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
761                    mbstate_t *restrict ps));
762 # endif
763 # if __GLIBC__ >= 2
764 _GL_CXXALIASWARN (mbrtowc);
765 # endif
766 #elif defined GNULIB_POSIXCHECK
767 # undef mbrtowc
768 # if HAVE_RAW_DECL_MBRTOWC
769 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
770                  "use gnulib module mbrtowc for portability");
771 # endif
772 #endif
773 
774 
775 /* Recognize a multibyte character.  */
776 #if 0
777 # if 0
778 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
779 #   undef mbrlen
780 #   define mbrlen rpl_mbrlen
781 #  endif
782 _GL_FUNCDECL_RPL (mbrlen, size_t,
783                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
784 _GL_CXXALIAS_RPL (mbrlen, size_t,
785                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
786 # else
787 #  if !1
788 _GL_FUNCDECL_SYS (mbrlen, size_t,
789                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
790 #  endif
791 _GL_CXXALIAS_SYS (mbrlen, size_t,
792                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
793 # endif
794 # if __GLIBC__ >= 2
795 _GL_CXXALIASWARN (mbrlen);
796 # endif
797 #elif defined GNULIB_POSIXCHECK
798 # undef mbrlen
799 # if HAVE_RAW_DECL_MBRLEN
800 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
801                  "use gnulib module mbrlen for portability");
802 # endif
803 #endif
804 
805 
806 /* Convert a string to a wide string.  */
807 #if 1
808 # if 0
809 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
810 #   undef mbsrtowcs
811 #   define mbsrtowcs rpl_mbsrtowcs
812 #  endif
813 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
814                   (wchar_t *restrict dest,
815                    const char **restrict srcp, size_t len,
816                    mbstate_t *restrict ps)
817                   _GL_ARG_NONNULL ((2)));
818 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
819                   (wchar_t *restrict dest,
820                    const char **restrict srcp, size_t len,
821                    mbstate_t *restrict ps));
822 # else
823 #  if !1
824 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
825                   (wchar_t *restrict dest,
826                    const char **restrict srcp, size_t len,
827                    mbstate_t *restrict ps)
828                   _GL_ARG_NONNULL ((2)));
829 #  endif
830 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
831                   (wchar_t *restrict dest,
832                    const char **restrict srcp, size_t len,
833                    mbstate_t *restrict ps));
834 # endif
835 # if __GLIBC__ >= 2
836 _GL_CXXALIASWARN (mbsrtowcs);
837 # endif
838 #elif defined GNULIB_POSIXCHECK
839 # undef mbsrtowcs
840 # if HAVE_RAW_DECL_MBSRTOWCS
841 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
842                  "use gnulib module mbsrtowcs for portability");
843 # endif
844 #endif
845 
846 
847 /* Convert a string to a wide string.  */
848 #if 0
849 # if 0
850 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
851 #   undef mbsnrtowcs
852 #   define mbsnrtowcs rpl_mbsnrtowcs
853 #  endif
854 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
855                   (wchar_t *restrict dest,
856                    const char **restrict srcp, size_t srclen, size_t len,
857                    mbstate_t *restrict ps)
858                   _GL_ARG_NONNULL ((2)));
859 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
860                   (wchar_t *restrict dest,
861                    const char **restrict srcp, size_t srclen, size_t len,
862                    mbstate_t *restrict ps));
863 # else
864 #  if !1
865 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
866                   (wchar_t *restrict dest,
867                    const char **restrict srcp, size_t srclen, size_t len,
868                    mbstate_t *restrict ps)
869                   _GL_ARG_NONNULL ((2)));
870 #  endif
871 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
872                   (wchar_t *restrict dest,
873                    const char **restrict srcp, size_t srclen, size_t len,
874                    mbstate_t *restrict ps));
875 # endif
876 _GL_CXXALIASWARN (mbsnrtowcs);
877 #elif defined GNULIB_POSIXCHECK
878 # undef mbsnrtowcs
879 # if HAVE_RAW_DECL_MBSNRTOWCS
880 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
881                  "use gnulib module mbsnrtowcs for portability");
882 # endif
883 #endif
884 
885 
886 /* Convert a wide character to a multibyte character.  */
887 #if 1
888 # if 0
889 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
890 #   undef wcrtomb
891 #   define wcrtomb rpl_wcrtomb
892 #  endif
893 _GL_FUNCDECL_RPL (wcrtomb, size_t,
894                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
895 _GL_CXXALIAS_RPL (wcrtomb, size_t,
896                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
897 # else
898 #  if !1
899 _GL_FUNCDECL_SYS (wcrtomb, size_t,
900                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
901 #  endif
902 _GL_CXXALIAS_SYS (wcrtomb, size_t,
903                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
904 # endif
905 # if __GLIBC__ >= 2
906 _GL_CXXALIASWARN (wcrtomb);
907 # endif
908 #elif defined GNULIB_POSIXCHECK
909 # undef wcrtomb
910 # if HAVE_RAW_DECL_WCRTOMB
911 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
912                  "use gnulib module wcrtomb for portability");
913 # endif
914 #endif
915 
916 
917 /* Convert a wide string to a string.  */
918 #if 0
919 # if 0
920 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
921 #   undef wcsrtombs
922 #   define wcsrtombs rpl_wcsrtombs
923 #  endif
924 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
925                   (char *restrict dest, const wchar_t **restrict srcp,
926                    size_t len,
927                    mbstate_t *restrict ps)
928                   _GL_ARG_NONNULL ((2)));
929 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
930                   (char *restrict dest, const wchar_t **restrict srcp,
931                    size_t len,
932                    mbstate_t *restrict ps));
933 # else
934 #  if !1
935 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
936                   (char *restrict dest, const wchar_t **restrict srcp,
937                    size_t len,
938                    mbstate_t *restrict ps)
939                   _GL_ARG_NONNULL ((2)));
940 #  endif
941 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
942                   (char *restrict dest, const wchar_t **restrict srcp,
943                    size_t len,
944                    mbstate_t *restrict ps));
945 # endif
946 # if __GLIBC__ >= 2
947 _GL_CXXALIASWARN (wcsrtombs);
948 # endif
949 #elif defined GNULIB_POSIXCHECK
950 # undef wcsrtombs
951 # if HAVE_RAW_DECL_WCSRTOMBS
952 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
953                  "use gnulib module wcsrtombs for portability");
954 # endif
955 #endif
956 
957 
958 /* Convert a wide string to a string.  */
959 #if 0
960 # if 0
961 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
962 #   undef wcsnrtombs
963 #   define wcsnrtombs rpl_wcsnrtombs
964 #  endif
965 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
966                   (char *restrict dest,
967                    const wchar_t **restrict srcp, size_t srclen,
968                    size_t len,
969                    mbstate_t *restrict ps)
970                   _GL_ARG_NONNULL ((2)));
971 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
972                   (char *restrict dest,
973                    const wchar_t **restrict srcp, size_t srclen,
974                    size_t len,
975                    mbstate_t *restrict ps));
976 # else
977 #  if !1 || (defined __cplusplus && defined __sun)
978 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
979                   (char *restrict dest,
980                    const wchar_t **restrict srcp, size_t srclen,
981                    size_t len,
982                    mbstate_t *restrict ps)
983                   _GL_ARG_NONNULL ((2)));
984 #  endif
985 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
986                   (char *restrict dest,
987                    const wchar_t **restrict srcp, size_t srclen,
988                    size_t len,
989                    mbstate_t *restrict ps));
990 # endif
991 # if __GLIBC__ >= 2
992 _GL_CXXALIASWARN (wcsnrtombs);
993 # endif
994 #elif defined GNULIB_POSIXCHECK
995 # undef wcsnrtombs
996 # if HAVE_RAW_DECL_WCSNRTOMBS
997 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
998                  "use gnulib module wcsnrtombs for portability");
999 # endif
1000 #endif
1001 
1002 
1003 /* Return the number of screen columns needed for WC.  */
1004 #if 0
1005 # if 0
1006 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1007 #   undef wcwidth
1008 #   define wcwidth rpl_wcwidth
1009 #  endif
1010 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
1011 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
1012 # else
1013 #  if !1
1014 /* wcwidth exists but is not declared.  */
1015 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
1016 #  endif
1017 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
1018 # endif
1019 # if __GLIBC__ >= 2
1020 _GL_CXXALIASWARN (wcwidth);
1021 # endif
1022 #elif defined GNULIB_POSIXCHECK
1023 # undef wcwidth
1024 # if HAVE_RAW_DECL_WCWIDTH
1025 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
1026                  "use gnulib module wcwidth for portability");
1027 # endif
1028 #endif
1029 
1030 
1031 /* Search N wide characters of S for C.  */
1032 #if 1
1033 # if !1
1034 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
1035                                       _GL_ATTRIBUTE_PURE);
1036 # endif
1037   /* On some systems, this function is defined as an overloaded function:
1038        extern "C++" {
1039          const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
1040          wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
1041        }  */
1042 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
1043                         wchar_t *, (const wchar_t *, wchar_t, size_t),
1044                         const wchar_t *, (const wchar_t *, wchar_t, size_t));
1045 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1046      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1047 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
1048 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
1049                    (const wchar_t *s, wchar_t c, size_t n));
1050 # elif __GLIBC__ >= 2
1051 _GL_CXXALIASWARN (wmemchr);
1052 # endif
1053 #elif defined GNULIB_POSIXCHECK
1054 # undef wmemchr
1055 # if HAVE_RAW_DECL_WMEMCHR
1056 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
1057                  "use gnulib module wmemchr for portability");
1058 # endif
1059 #endif
1060 
1061 
1062 /* Compare N wide characters of S1 and S2.  */
1063 #if 0
1064 # if !1
1065 _GL_FUNCDECL_SYS (wmemcmp, int,
1066                   (const wchar_t *s1, const wchar_t *s2, size_t n)
1067                   _GL_ATTRIBUTE_PURE);
1068 # endif
1069 _GL_CXXALIAS_SYS (wmemcmp, int,
1070                   (const wchar_t *s1, const wchar_t *s2, size_t n));
1071 # if __GLIBC__ >= 2
1072 _GL_CXXALIASWARN (wmemcmp);
1073 # endif
1074 #elif defined GNULIB_POSIXCHECK
1075 # undef wmemcmp
1076 # if HAVE_RAW_DECL_WMEMCMP
1077 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
1078                  "use gnulib module wmemcmp for portability");
1079 # endif
1080 #endif
1081 
1082 
1083 /* Copy N wide characters of SRC to DEST.  */
1084 #if 0
1085 # if !1
1086 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
1087                   (wchar_t *restrict dest,
1088                    const wchar_t *restrict src, size_t n));
1089 # endif
1090 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
1091                   (wchar_t *restrict dest,
1092                    const wchar_t *restrict src, size_t n));
1093 # if __GLIBC__ >= 2
1094 _GL_CXXALIASWARN (wmemcpy);
1095 # endif
1096 #elif defined GNULIB_POSIXCHECK
1097 # undef wmemcpy
1098 # if HAVE_RAW_DECL_WMEMCPY
1099 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
1100                  "use gnulib module wmemcpy for portability");
1101 # endif
1102 #endif
1103 
1104 
1105 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
1106    overlapping memory areas.  */
1107 #if 0
1108 # if !1
1109 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
1110                   (wchar_t *dest, const wchar_t *src, size_t n));
1111 # endif
1112 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
1113                   (wchar_t *dest, const wchar_t *src, size_t n));
1114 # if __GLIBC__ >= 2
1115 _GL_CXXALIASWARN (wmemmove);
1116 # endif
1117 #elif defined GNULIB_POSIXCHECK
1118 # undef wmemmove
1119 # if HAVE_RAW_DECL_WMEMMOVE
1120 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
1121                  "use gnulib module wmemmove for portability");
1122 # endif
1123 #endif
1124 
1125 
1126 /* Copy N wide characters of SRC to DEST.
1127    Return pointer to wide characters after the last written wide character.  */
1128 #if 1
1129 # if 1
1130 _GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
1131                   (wchar_t *restrict dest,
1132                    const wchar_t *restrict src, size_t n));
1133 # endif
1134 _GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
1135                   (wchar_t *restrict dest,
1136                    const wchar_t *restrict src, size_t n));
1137 # if __GLIBC__ >= 2
1138 _GL_CXXALIASWARN (wmempcpy);
1139 # endif
1140 #elif defined GNULIB_POSIXCHECK
1141 # undef wmempcpy
1142 # if HAVE_RAW_DECL_WMEMPCPY
1143 _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
1144                  "use gnulib module wmempcpy for portability");
1145 # endif
1146 #endif
1147 
1148 
1149 /* Set N wide characters of S to C.  */
1150 #if 0
1151 # if !1
1152 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
1153 # endif
1154 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
1155 # if __GLIBC__ >= 2
1156 _GL_CXXALIASWARN (wmemset);
1157 # endif
1158 #elif defined GNULIB_POSIXCHECK
1159 # undef wmemset
1160 # if HAVE_RAW_DECL_WMEMSET
1161 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
1162                  "use gnulib module wmemset for portability");
1163 # endif
1164 #endif
1165 
1166 
1167 /* Return the number of wide characters in S.  */
1168 #if 0
1169 # if !1
1170 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
1171 # endif
1172 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
1173 # if __GLIBC__ >= 2
1174 _GL_CXXALIASWARN (wcslen);
1175 # endif
1176 #elif defined GNULIB_POSIXCHECK
1177 # undef wcslen
1178 # if HAVE_RAW_DECL_WCSLEN
1179 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
1180                  "use gnulib module wcslen for portability");
1181 # endif
1182 #endif
1183 
1184 
1185 /* Return the number of wide characters in S, but at most MAXLEN.  */
1186 #if 0
1187 # if !1
1188 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
1189                                    _GL_ATTRIBUTE_PURE);
1190 # endif
1191 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
1192 _GL_CXXALIASWARN (wcsnlen);
1193 #elif defined GNULIB_POSIXCHECK
1194 # undef wcsnlen
1195 # if HAVE_RAW_DECL_WCSNLEN
1196 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
1197                  "use gnulib module wcsnlen for portability");
1198 # endif
1199 #endif
1200 
1201 
1202 /* Copy SRC to DEST.  */
1203 #if 0
1204 # if !1
1205 _GL_FUNCDECL_SYS (wcscpy, wchar_t *,
1206                   (wchar_t *restrict dest, const wchar_t *restrict src));
1207 # endif
1208 _GL_CXXALIAS_SYS (wcscpy, wchar_t *,
1209                   (wchar_t *restrict dest, const wchar_t *restrict src));
1210 # if __GLIBC__ >= 2
1211 _GL_CXXALIASWARN (wcscpy);
1212 # endif
1213 #elif defined GNULIB_POSIXCHECK
1214 # undef wcscpy
1215 # if HAVE_RAW_DECL_WCSCPY
1216 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
1217                  "use gnulib module wcscpy for portability");
1218 # endif
1219 #endif
1220 
1221 
1222 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
1223 #if 0
1224 # if !1
1225 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
1226                   (wchar_t *restrict dest, const wchar_t *restrict src));
1227 # endif
1228 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
1229                   (wchar_t *restrict dest, const wchar_t *restrict src));
1230 _GL_CXXALIASWARN (wcpcpy);
1231 #elif defined GNULIB_POSIXCHECK
1232 # undef wcpcpy
1233 # if HAVE_RAW_DECL_WCPCPY
1234 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
1235                  "use gnulib module wcpcpy for portability");
1236 # endif
1237 #endif
1238 
1239 
1240 /* Copy no more than N wide characters of SRC to DEST.  */
1241 #if 0
1242 # if !1
1243 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
1244                   (wchar_t *restrict dest,
1245                    const wchar_t *restrict src, size_t n));
1246 # endif
1247 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
1248                   (wchar_t *restrict dest,
1249                    const wchar_t *restrict src, size_t n));
1250 # if __GLIBC__ >= 2
1251 _GL_CXXALIASWARN (wcsncpy);
1252 # endif
1253 #elif defined GNULIB_POSIXCHECK
1254 # undef wcsncpy
1255 # if HAVE_RAW_DECL_WCSNCPY
1256 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
1257                  "use gnulib module wcsncpy for portability");
1258 # endif
1259 #endif
1260 
1261 
1262 /* Copy no more than N characters of SRC to DEST, returning the address of
1263    the last character written into DEST.  */
1264 #if 0
1265 # if !1
1266 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
1267                   (wchar_t *restrict dest,
1268                    const wchar_t *restrict src, size_t n));
1269 # endif
1270 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
1271                   (wchar_t *restrict dest,
1272                    const wchar_t *restrict src, size_t n));
1273 _GL_CXXALIASWARN (wcpncpy);
1274 #elif defined GNULIB_POSIXCHECK
1275 # undef wcpncpy
1276 # if HAVE_RAW_DECL_WCPNCPY
1277 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
1278                  "use gnulib module wcpncpy for portability");
1279 # endif
1280 #endif
1281 
1282 
1283 /* Append SRC onto DEST.  */
1284 #if 0
1285 # if !1
1286 _GL_FUNCDECL_SYS (wcscat, wchar_t *,
1287                   (wchar_t *restrict dest, const wchar_t *restrict src));
1288 # endif
1289 _GL_CXXALIAS_SYS (wcscat, wchar_t *,
1290                   (wchar_t *restrict dest, const wchar_t *restrict src));
1291 # if __GLIBC__ >= 2
1292 _GL_CXXALIASWARN (wcscat);
1293 # endif
1294 #elif defined GNULIB_POSIXCHECK
1295 # undef wcscat
1296 # if HAVE_RAW_DECL_WCSCAT
1297 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
1298                  "use gnulib module wcscat for portability");
1299 # endif
1300 #endif
1301 
1302 
1303 /* Append no more than N wide characters of SRC onto DEST.  */
1304 #if 0
1305 # if !1
1306 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
1307                   (wchar_t *restrict dest, const wchar_t *restrict src,
1308                    size_t n));
1309 # endif
1310 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
1311                   (wchar_t *restrict dest, const wchar_t *restrict src,
1312                    size_t n));
1313 # if __GLIBC__ >= 2
1314 _GL_CXXALIASWARN (wcsncat);
1315 # endif
1316 #elif defined GNULIB_POSIXCHECK
1317 # undef wcsncat
1318 # if HAVE_RAW_DECL_WCSNCAT
1319 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
1320                  "use gnulib module wcsncat for portability");
1321 # endif
1322 #endif
1323 
1324 
1325 /* Compare S1 and S2.  */
1326 #if 0
1327 # if !1
1328 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
1329                                _GL_ATTRIBUTE_PURE);
1330 # endif
1331 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
1332 # if __GLIBC__ >= 2
1333 _GL_CXXALIASWARN (wcscmp);
1334 # endif
1335 #elif defined GNULIB_POSIXCHECK
1336 # undef wcscmp
1337 # if HAVE_RAW_DECL_WCSCMP
1338 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
1339                  "use gnulib module wcscmp for portability");
1340 # endif
1341 #endif
1342 
1343 
1344 /* Compare no more than N wide characters of S1 and S2.  */
1345 #if 0
1346 # if !1
1347 _GL_FUNCDECL_SYS (wcsncmp, int,
1348                   (const wchar_t *s1, const wchar_t *s2, size_t n)
1349                   _GL_ATTRIBUTE_PURE);
1350 # endif
1351 _GL_CXXALIAS_SYS (wcsncmp, int,
1352                   (const wchar_t *s1, const wchar_t *s2, size_t n));
1353 # if __GLIBC__ >= 2
1354 _GL_CXXALIASWARN (wcsncmp);
1355 # endif
1356 #elif defined GNULIB_POSIXCHECK
1357 # undef wcsncmp
1358 # if HAVE_RAW_DECL_WCSNCMP
1359 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
1360                  "use gnulib module wcsncmp for portability");
1361 # endif
1362 #endif
1363 
1364 
1365 /* Compare S1 and S2, ignoring case.  */
1366 #if 0
1367 # if !1
1368 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
1369                                    _GL_ATTRIBUTE_PURE);
1370 # endif
1371 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
1372 _GL_CXXALIASWARN (wcscasecmp);
1373 #elif defined GNULIB_POSIXCHECK
1374 # undef wcscasecmp
1375 # if HAVE_RAW_DECL_WCSCASECMP
1376 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
1377                  "use gnulib module wcscasecmp for portability");
1378 # endif
1379 #endif
1380 
1381 
1382 /* Compare no more than N chars of S1 and S2, ignoring case.  */
1383 #if 0
1384 # if !1
1385 _GL_FUNCDECL_SYS (wcsncasecmp, int,
1386                   (const wchar_t *s1, const wchar_t *s2, size_t n)
1387                   _GL_ATTRIBUTE_PURE);
1388 # endif
1389 _GL_CXXALIAS_SYS (wcsncasecmp, int,
1390                   (const wchar_t *s1, const wchar_t *s2, size_t n));
1391 _GL_CXXALIASWARN (wcsncasecmp);
1392 #elif defined GNULIB_POSIXCHECK
1393 # undef wcsncasecmp
1394 # if HAVE_RAW_DECL_WCSNCASECMP
1395 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
1396                  "use gnulib module wcsncasecmp for portability");
1397 # endif
1398 #endif
1399 
1400 
1401 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
1402    category of the current locale.  */
1403 #if 0
1404 # if !1
1405 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1406 # endif
1407 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
1408 # if __GLIBC__ >= 2
1409 _GL_CXXALIASWARN (wcscoll);
1410 # endif
1411 #elif defined GNULIB_POSIXCHECK
1412 # undef wcscoll
1413 # if HAVE_RAW_DECL_WCSCOLL
1414 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
1415                  "use gnulib module wcscoll for portability");
1416 # endif
1417 #endif
1418 
1419 
1420 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
1421    to two transformed strings the result is the as applying 'wcscoll' to the
1422    original strings.  */
1423 #if 0
1424 # if !1
1425 _GL_FUNCDECL_SYS (wcsxfrm, size_t,
1426                   (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
1427 # endif
1428 _GL_CXXALIAS_SYS (wcsxfrm, size_t,
1429                   (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
1430 # if __GLIBC__ >= 2
1431 _GL_CXXALIASWARN (wcsxfrm);
1432 # endif
1433 #elif defined GNULIB_POSIXCHECK
1434 # undef wcsxfrm
1435 # if HAVE_RAW_DECL_WCSXFRM
1436 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
1437                  "use gnulib module wcsxfrm for portability");
1438 # endif
1439 #endif
1440 
1441 
1442 /* Duplicate S, returning an identical malloc'd string.  */
1443 #if 0
1444 # if defined _WIN32 && !defined __CYGWIN__
1445 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1446 #   undef wcsdup
1447 #   define wcsdup _wcsdup
1448 #  endif
1449 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1450 # else
1451 #  if !1
1452 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1453 #  endif
1454 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1455 # endif
1456 _GL_CXXALIASWARN (wcsdup);
1457 #elif defined GNULIB_POSIXCHECK
1458 # undef wcsdup
1459 # if HAVE_RAW_DECL_WCSDUP
1460 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
1461                  "use gnulib module wcsdup for portability");
1462 # endif
1463 #elif 1
1464 /* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
1465    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1466    platforms by defining GNULIB_NAMESPACE::wcsdup always.  */
1467 # if defined _WIN32 && !defined __CYGWIN__
1468 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1469 #   undef wcsdup
1470 #   define wcsdup _wcsdup
1471 #  endif
1472 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
1473 # else
1474 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1475 #  if 1
1476 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
1477 #  endif
1478 # endif
1479 # if (defined _WIN32 && !defined __CYGWIN__) || 1
1480 _GL_CXXALIASWARN (wcsdup);
1481 # endif
1482 #endif
1483 
1484 
1485 /* Find the first occurrence of WC in WCS.  */
1486 #if 0
1487 # if !1
1488 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1489                                      _GL_ATTRIBUTE_PURE);
1490 # endif
1491   /* On some systems, this function is defined as an overloaded function:
1492        extern "C++" {
1493          const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1494          wchar_t * std::wcschr (wchar_t *, wchar_t);
1495        }  */
1496 _GL_CXXALIAS_SYS_CAST2 (wcschr,
1497                         wchar_t *, (const wchar_t *, wchar_t),
1498                         const wchar_t *, (const wchar_t *, wchar_t));
1499 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1500      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1501 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1502 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1503 # elif __GLIBC__ >= 2
1504 _GL_CXXALIASWARN (wcschr);
1505 # endif
1506 #elif defined GNULIB_POSIXCHECK
1507 # undef wcschr
1508 # if HAVE_RAW_DECL_WCSCHR
1509 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1510                  "use gnulib module wcschr for portability");
1511 # endif
1512 #endif
1513 
1514 
1515 /* Find the last occurrence of WC in WCS.  */
1516 #if 0
1517 # if !1
1518 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1519                                       _GL_ATTRIBUTE_PURE);
1520 # endif
1521   /* On some systems, this function is defined as an overloaded function:
1522        extern "C++" {
1523          const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1524          wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1525        }  */
1526 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1527                         wchar_t *, (const wchar_t *, wchar_t),
1528                         const wchar_t *, (const wchar_t *, wchar_t));
1529 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1530      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1531 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1532 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1533 # elif __GLIBC__ >= 2
1534 _GL_CXXALIASWARN (wcsrchr);
1535 # endif
1536 #elif defined GNULIB_POSIXCHECK
1537 # undef wcsrchr
1538 # if HAVE_RAW_DECL_WCSRCHR
1539 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1540                  "use gnulib module wcsrchr for portability");
1541 # endif
1542 #endif
1543 
1544 
1545 /* Return the length of the initial segmet of WCS which consists entirely
1546    of wide characters not in REJECT.  */
1547 #if 0
1548 # if !1
1549 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1550                                    _GL_ATTRIBUTE_PURE);
1551 # endif
1552 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1553 # if __GLIBC__ >= 2
1554 _GL_CXXALIASWARN (wcscspn);
1555 # endif
1556 #elif defined GNULIB_POSIXCHECK
1557 # undef wcscspn
1558 # if HAVE_RAW_DECL_WCSCSPN
1559 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1560                  "use gnulib module wcscspn for portability");
1561 # endif
1562 #endif
1563 
1564 
1565 /* Return the length of the initial segmet of WCS which consists entirely
1566    of wide characters in ACCEPT.  */
1567 #if 0
1568 # if !1
1569 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1570                                   _GL_ATTRIBUTE_PURE);
1571 # endif
1572 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1573 # if __GLIBC__ >= 2
1574 _GL_CXXALIASWARN (wcsspn);
1575 # endif
1576 #elif defined GNULIB_POSIXCHECK
1577 # undef wcsspn
1578 # if HAVE_RAW_DECL_WCSSPN
1579 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1580                  "use gnulib module wcsspn for portability");
1581 # endif
1582 #endif
1583 
1584 
1585 /* Find the first occurrence in WCS of any character in ACCEPT.  */
1586 #if 0
1587 # if !1
1588 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1589                   (const wchar_t *wcs, const wchar_t *accept)
1590                   _GL_ATTRIBUTE_PURE);
1591 # endif
1592   /* On some systems, this function is defined as an overloaded function:
1593        extern "C++" {
1594          const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1595          wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1596        }  */
1597 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1598                         wchar_t *, (const wchar_t *, const wchar_t *),
1599                         const wchar_t *, (const wchar_t *, const wchar_t *));
1600 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1601      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1602 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1603                    (wchar_t *wcs, const wchar_t *accept));
1604 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1605                    (const wchar_t *wcs, const wchar_t *accept));
1606 # elif __GLIBC__ >= 2
1607 _GL_CXXALIASWARN (wcspbrk);
1608 # endif
1609 #elif defined GNULIB_POSIXCHECK
1610 # undef wcspbrk
1611 # if HAVE_RAW_DECL_WCSPBRK
1612 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1613                  "use gnulib module wcspbrk for portability");
1614 # endif
1615 #endif
1616 
1617 
1618 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
1619 #if 0
1620 # if !1
1621 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1622                   (const wchar_t *restrict haystack,
1623                    const wchar_t *restrict needle)
1624                   _GL_ATTRIBUTE_PURE);
1625 # endif
1626   /* On some systems, this function is defined as an overloaded function:
1627        extern "C++" {
1628          const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1629          wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1630        }  */
1631 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1632                         wchar_t *,
1633                         (const wchar_t *restrict, const wchar_t *restrict),
1634                         const wchar_t *,
1635                         (const wchar_t *restrict, const wchar_t *restrict));
1636 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1637      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1638 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1639                    (wchar_t *restrict haystack,
1640                     const wchar_t *restrict needle));
1641 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1642                    (const wchar_t *restrict haystack,
1643                     const wchar_t *restrict needle));
1644 # elif __GLIBC__ >= 2
1645 _GL_CXXALIASWARN (wcsstr);
1646 # endif
1647 #elif defined GNULIB_POSIXCHECK
1648 # undef wcsstr
1649 # if HAVE_RAW_DECL_WCSSTR
1650 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1651                  "use gnulib module wcsstr for portability");
1652 # endif
1653 #endif
1654 
1655 
1656 /* Divide WCS into tokens separated by characters in DELIM.  */
1657 #if 0
1658 # if 0
1659 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1660 #   undef wcstok
1661 #   define wcstok rpl_wcstok
1662 #  endif
1663 _GL_FUNCDECL_RPL (wcstok, wchar_t *,
1664                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1665                    wchar_t **restrict ptr));
1666 _GL_CXXALIAS_RPL (wcstok, wchar_t *,
1667                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1668                    wchar_t **restrict ptr));
1669 # else
1670 #  if !1
1671 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1672                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1673                    wchar_t **restrict ptr));
1674 #  endif
1675 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1676                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1677                    wchar_t **restrict ptr));
1678 # endif
1679 # if __GLIBC__ >= 2
1680 _GL_CXXALIASWARN (wcstok);
1681 # endif
1682 #elif defined GNULIB_POSIXCHECK
1683 # undef wcstok
1684 # if HAVE_RAW_DECL_WCSTOK
1685 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1686                  "use gnulib module wcstok for portability");
1687 # endif
1688 #endif
1689 
1690 
1691 /* Determine number of column positions required for first N wide
1692    characters (or fewer if S ends before this) in S.  */
1693 #if 0
1694 # if 0
1695 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1696 #   undef wcswidth
1697 #   define wcswidth rpl_wcswidth
1698 #  endif
1699 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1700                                  _GL_ATTRIBUTE_PURE);
1701 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1702 # else
1703 #  if !1
1704 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1705                                  _GL_ATTRIBUTE_PURE);
1706 #  endif
1707 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1708 # endif
1709 # if __GLIBC__ >= 2
1710 _GL_CXXALIASWARN (wcswidth);
1711 # endif
1712 #elif defined GNULIB_POSIXCHECK
1713 # undef wcswidth
1714 # if HAVE_RAW_DECL_WCSWIDTH
1715 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1716                  "use gnulib module wcswidth for portability");
1717 # endif
1718 #endif
1719 
1720 
1721 /* Convert *TP to a date and time wide string.  See
1722    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>.  */
1723 #if 0
1724 # if 0
1725 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1726 #   undef wcsftime
1727 #   define wcsftime rpl_wcsftime
1728 #  endif
1729 _GL_FUNCDECL_RPL (wcsftime, size_t,
1730                   (wchar_t *restrict __buf, size_t __bufsize,
1731                    const wchar_t *restrict __fmt,
1732                    const struct tm *restrict __tp)
1733                   _GL_ARG_NONNULL ((1, 3, 4)));
1734 _GL_CXXALIAS_RPL (wcsftime, size_t,
1735                   (wchar_t *restrict __buf, size_t __bufsize,
1736                    const wchar_t *restrict __fmt,
1737                    const struct tm *restrict __tp));
1738 # else
1739 #  if !1
1740 _GL_FUNCDECL_SYS (wcsftime, size_t,
1741                   (wchar_t *restrict __buf, size_t __bufsize,
1742                    const wchar_t *restrict __fmt,
1743                    const struct tm *restrict __tp)
1744                   _GL_ARG_NONNULL ((1, 3, 4)));
1745 #  endif
1746 _GL_CXXALIAS_SYS (wcsftime, size_t,
1747                   (wchar_t *restrict __buf, size_t __bufsize,
1748                    const wchar_t *restrict __fmt,
1749                    const struct tm *restrict __tp));
1750 # endif
1751 # if __GLIBC__ >= 2
1752 _GL_CXXALIASWARN (wcsftime);
1753 # endif
1754 #elif defined GNULIB_POSIXCHECK
1755 # undef wcsftime
1756 # if HAVE_RAW_DECL_WCSFTIME
1757 _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1758                  "use gnulib module wcsftime for portability");
1759 # endif
1760 #endif
1761 
1762 
1763 #endif /* _GL_WCHAR_H */
1764 #endif /* _GL_WCHAR_H */
1765 #endif
1766