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