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