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