1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* -*- buffer-read-only: t -*- vi: set ro: */
3 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
4 /* A GNU-like <string.h>.
6 Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
25 #pragma GCC system_header
28 /* The include_next requires a split double-inclusion guard. */
29 #include_next <string.h>
34 /* NetBSD 5.0 mis-defines NULL. */
37 /* MirBSD defines mbslen as a macro. */
38 #if 1 && defined __MirBSD__
43 /* This feature is available in gcc versions 2.5 and later. */
44 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
45 # define __attribute__(Spec) /* empty */
47 /* The attribute __pure__ was added in gcc 2.96. */
48 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
49 # define __pure__ /* empty */
54 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
58 /* The three most frequent use cases of these macros are:
60 * For providing a substitute for a function that is missing on some
61 platforms, but is declared and works fine on the platforms on which
66 _GL_FUNCDECL_SYS (foo, ...);
68 _GL_CXXALIAS_SYS (foo, ...);
69 _GL_CXXALIASWARN (foo);
70 #elif defined GNULIB_POSIXCHECK
74 * For providing a replacement for a function that exists on all platforms,
75 but is broken/insufficient and needs to be replaced on some platforms:
79 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
83 _GL_FUNCDECL_RPL (foo, ...);
84 _GL_CXXALIAS_RPL (foo, ...);
86 _GL_CXXALIAS_SYS (foo, ...);
88 _GL_CXXALIASWARN (foo);
89 #elif defined GNULIB_POSIXCHECK
93 * For providing a replacement for a function that exists on some platforms
94 but is broken/insufficient and needs to be replaced on some of them and
95 is additionally either missing or undeclared on some other platforms:
99 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
103 _GL_FUNCDECL_RPL (foo, ...);
104 _GL_CXXALIAS_RPL (foo, ...);
106 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
107 _GL_FUNCDECL_SYS (foo, ...);
109 _GL_CXXALIAS_SYS (foo, ...);
111 _GL_CXXALIASWARN (foo);
112 #elif defined GNULIB_POSIXCHECK
117 /* _GL_EXTERN_C declaration;
118 performs the declaration with C linkage. */
119 #if defined __cplusplus
120 # define _GL_EXTERN_C extern "C"
122 # define _GL_EXTERN_C extern
125 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
126 declares a replacement function, named rpl_func, with the given prototype,
127 consisting of return type, parameters, and attributes.
129 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
130 _GL_ARG_NONNULL ((1)));
132 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
133 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
134 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
135 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
137 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
138 declares the system function, named func, with the given prototype,
139 consisting of return type, parameters, and attributes.
141 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
142 _GL_ARG_NONNULL ((1)));
144 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
145 _GL_EXTERN_C rettype func parameters_and_attributes
147 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
148 declares a C++ alias called GNULIB_NAMESPACE::func
149 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
151 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
153 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
154 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
155 #if defined __cplusplus && defined GNULIB_NAMESPACE
156 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
157 namespace GNULIB_NAMESPACE \
159 rettype (*const func) parameters = ::rpl_func; \
161 _GL_EXTERN_C int _gl_cxxalias_dummy
163 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
164 _GL_EXTERN_C int _gl_cxxalias_dummy
167 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
168 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
169 except that the C function rpl_func may have a slightly different
170 declaration. A cast is used to silence the "invalid conversion" error
171 that would otherwise occur. */
172 #if defined __cplusplus && defined GNULIB_NAMESPACE
173 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
174 namespace GNULIB_NAMESPACE \
176 rettype (*const func) parameters = \
177 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
179 _GL_EXTERN_C int _gl_cxxalias_dummy
181 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
182 _GL_EXTERN_C int _gl_cxxalias_dummy
185 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
186 declares a C++ alias called GNULIB_NAMESPACE::func
187 that redirects to the system provided function func, if GNULIB_NAMESPACE
190 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
192 #if defined __cplusplus && defined GNULIB_NAMESPACE
193 /* If we were to write
194 rettype (*const func) parameters = ::func;
195 like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
196 better (remove an indirection through a 'static' pointer variable),
197 but then the _GL_CXXALIASWARN macro below would cause a warning not only
198 for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
199 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
200 namespace GNULIB_NAMESPACE \
202 static rettype (*func) parameters = ::func; \
204 _GL_EXTERN_C int _gl_cxxalias_dummy
206 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
207 _GL_EXTERN_C int _gl_cxxalias_dummy
210 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
211 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
212 except that the C function func may have a slightly different declaration.
213 A cast is used to silence the "invalid conversion" error that would
215 #if defined __cplusplus && defined GNULIB_NAMESPACE
216 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
217 namespace GNULIB_NAMESPACE \
219 static rettype (*func) parameters = \
220 reinterpret_cast<rettype(*)parameters>(::func); \
222 _GL_EXTERN_C int _gl_cxxalias_dummy
224 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
225 _GL_EXTERN_C int _gl_cxxalias_dummy
228 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
229 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
230 except that the C function is picked among a set of overloaded functions,
231 namely the one with rettype2 and parameters2. Two consecutive casts
232 are used to silence the "cannot find a match" and "invalid conversion"
233 errors that would otherwise occur. */
234 #if defined __cplusplus && defined GNULIB_NAMESPACE
235 /* The outer cast must be a reinterpret_cast.
236 The inner cast: When the function is defined as a set of overloaded
237 functions, it works as a static_cast<>, choosing the designated variant.
238 When the function is defined as a single variant, it works as a
239 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
240 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
241 namespace GNULIB_NAMESPACE \
243 static rettype (*func) parameters = \
244 reinterpret_cast<rettype(*)parameters>( \
245 (rettype2(*)parameters2)(::func)); \
247 _GL_EXTERN_C int _gl_cxxalias_dummy
249 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
250 _GL_EXTERN_C int _gl_cxxalias_dummy
253 /* _GL_CXXALIASWARN (func);
254 causes a warning to be emitted when ::func is used but not when
255 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
257 #if defined __cplusplus && defined GNULIB_NAMESPACE
258 # define _GL_CXXALIASWARN(func) \
259 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
260 # define _GL_CXXALIASWARN_1(func,namespace) \
261 _GL_CXXALIASWARN_2 (func, namespace)
262 # define _GL_CXXALIASWARN_2(func,namespace) \
263 _GL_WARN_ON_USE (func, \
264 "The symbol ::" #func " refers to the system function. " \
265 "Use " #namespace "::" #func " instead.")
267 # define _GL_CXXALIASWARN(func) \
268 _GL_EXTERN_C int _gl_cxxalias_dummy
271 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
272 causes a warning to be emitted when the given overloaded variant of ::func
273 is used but not when GNULIB_NAMESPACE::func is used. */
274 #if defined __cplusplus && defined GNULIB_NAMESPACE
275 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
276 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
278 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
279 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
280 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
281 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
282 "The symbol ::" #func " refers to the system function. " \
283 "Use " #namespace "::" #func " instead.")
285 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
286 _GL_EXTERN_C int _gl_cxxalias_dummy
289 #endif /* _GL_CXXDEFS_H */
291 /* The definition of _GL_ARG_NONNULL is copied here. */
292 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
293 that the values passed as arguments n, ..., m must be non-NULL pointers.
294 n = 1 stands for the first argument, n = 2 for the second argument etc. */
295 #ifndef _GL_ARG_NONNULL
296 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
297 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
299 # define _GL_ARG_NONNULL(params)
303 /* The definition of _GL_WARN_ON_USE is copied here. */
304 #ifndef _GL_WARN_ON_USE
306 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
307 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
308 # define _GL_WARN_ON_USE(function, message) \
309 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
310 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
311 /* Verify the existence of the function. */
312 # define _GL_WARN_ON_USE(function, message) \
313 extern __typeof__ (function) function
314 # else /* Unsupported. */
315 # define _GL_WARN_ON_USE(function, message) \
316 _GL_WARN_EXTERN_C int _gl_warn_on_use
320 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
321 is like _GL_WARN_ON_USE (function, "string"), except that the function is
322 declared with the given prototype, consisting of return type, parameters,
324 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
325 not work in this case. */
326 #ifndef _GL_WARN_ON_USE_CXX
327 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
328 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
329 extern rettype function parameters_and_attributes \
330 __attribute__ ((__warning__ (msg)))
331 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
332 /* Verify the existence of the function. */
333 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
334 extern rettype function parameters_and_attributes
335 # else /* Unsupported. */
336 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
337 _GL_WARN_EXTERN_C int _gl_warn_on_use
341 /* _GL_WARN_EXTERN_C declaration;
342 performs the declaration with C linkage. */
343 #ifndef _GL_WARN_EXTERN_C
344 # if defined __cplusplus
345 # define _GL_WARN_EXTERN_C extern "C"
347 # define _GL_WARN_EXTERN_C extern
352 /* Return the first instance of C within N bytes of S, or NULL. */
355 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
356 # define memchr rpl_memchr
358 _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
359 __attribute__ ((__pure__))
360 _GL_ARG_NONNULL ((1)));
361 _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
364 _GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
365 __attribute__ ((__pure__))
366 _GL_ARG_NONNULL ((1)));
368 /* On some systems, this function is defined as an overloaded function:
369 extern "C" { const void * std::memchr (const void *, int, size_t); }
370 extern "C++" { void * std::memchr (void *, int, size_t); } */
371 _GL_CXXALIAS_SYS_CAST2 (memchr,
372 void *, (void const *__s, int __c, size_t __n),
373 void const *, (void const *__s, int __c, size_t __n));
375 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
376 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
377 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
378 _GL_CXXALIASWARN1 (memchr, void const *,
379 (void const *__s, int __c, size_t __n));
381 _GL_CXXALIASWARN (memchr);
383 #elif defined GNULIB_POSIXCHECK
385 /* Assume memchr is always declared. */
386 _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
387 "use gnulib module memchr for portability" );
390 /* Return the first occurrence of NEEDLE in HAYSTACK. */
393 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
394 # define memmem rpl_memmem
396 _GL_FUNCDECL_RPL (memmem, void *,
397 (void const *__haystack, size_t __haystack_len,
398 void const *__needle, size_t __needle_len)
399 __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
400 _GL_CXXALIAS_RPL (memmem, void *,
401 (void const *__haystack, size_t __haystack_len,
402 void const *__needle, size_t __needle_len));
405 _GL_FUNCDECL_SYS (memmem, void *,
406 (void const *__haystack, size_t __haystack_len,
407 void const *__needle, size_t __needle_len)
408 __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
410 _GL_CXXALIAS_SYS (memmem, void *,
411 (void const *__haystack, size_t __haystack_len,
412 void const *__needle, size_t __needle_len));
414 _GL_CXXALIASWARN (memmem);
415 #elif defined GNULIB_POSIXCHECK
417 # if HAVE_RAW_DECL_MEMMEM
418 _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
419 "use gnulib module memmem-simple for portability, "
420 "and module memmem for speed" );
424 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
425 last written byte. */
428 _GL_FUNCDECL_SYS (mempcpy, void *,
429 (void *restrict __dest, void const *restrict __src,
431 _GL_ARG_NONNULL ((1, 2)));
433 _GL_CXXALIAS_SYS (mempcpy, void *,
434 (void *restrict __dest, void const *restrict __src,
436 _GL_CXXALIASWARN (mempcpy);
437 #elif defined GNULIB_POSIXCHECK
439 # if HAVE_RAW_DECL_MEMPCPY
440 _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
441 "use gnulib module mempcpy for portability");
445 /* Search backwards through a block for a byte (specified as an int). */
448 _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
449 __attribute__ ((__pure__))
450 _GL_ARG_NONNULL ((1)));
452 /* On some systems, this function is defined as an overloaded function:
453 extern "C++" { const void * std::memrchr (const void *, int, size_t); }
454 extern "C++" { void * std::memrchr (void *, int, size_t); } */
455 _GL_CXXALIAS_SYS_CAST2 (memrchr,
456 void *, (void const *, int, size_t),
457 void const *, (void const *, int, size_t));
458 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
459 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
460 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
461 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
463 _GL_CXXALIASWARN (memrchr);
465 #elif defined GNULIB_POSIXCHECK
467 # if HAVE_RAW_DECL_MEMRCHR
468 _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
469 "use gnulib module memrchr for portability");
473 /* Find the first occurrence of C in S. More efficient than
474 memchr(S,C,N), at the expense of undefined behavior if C does not
475 occur within N bytes. */
478 _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
479 __attribute__ ((__pure__))
480 _GL_ARG_NONNULL ((1)));
482 /* On some systems, this function is defined as an overloaded function:
483 extern "C++" { const void * std::rawmemchr (const void *, int); }
484 extern "C++" { void * std::rawmemchr (void *, int); } */
485 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
486 void *, (void const *__s, int __c_in),
487 void const *, (void const *__s, int __c_in));
488 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
489 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
490 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
491 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
493 _GL_CXXALIASWARN (rawmemchr);
495 #elif defined GNULIB_POSIXCHECK
497 # if HAVE_RAW_DECL_RAWMEMCHR
498 _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
499 "use gnulib module rawmemchr for portability");
503 /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
506 _GL_FUNCDECL_SYS (stpcpy, char *,
507 (char *restrict __dst, char const *restrict __src)
508 _GL_ARG_NONNULL ((1, 2)));
510 _GL_CXXALIAS_SYS (stpcpy, char *,
511 (char *restrict __dst, char const *restrict __src));
512 _GL_CXXALIASWARN (stpcpy);
513 #elif defined GNULIB_POSIXCHECK
515 # if HAVE_RAW_DECL_STPCPY
516 _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
517 "use gnulib module stpcpy for portability");
521 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
522 last non-NUL byte written into DST. */
525 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
526 # define stpncpy rpl_stpncpy
528 _GL_FUNCDECL_RPL (stpncpy, char *,
529 (char *restrict __dst, char const *restrict __src,
531 _GL_ARG_NONNULL ((1, 2)));
532 _GL_CXXALIAS_RPL (stpncpy, char *,
533 (char *restrict __dst, char const *restrict __src,
537 _GL_FUNCDECL_SYS (stpncpy, char *,
538 (char *restrict __dst, char const *restrict __src,
540 _GL_ARG_NONNULL ((1, 2)));
542 _GL_CXXALIAS_SYS (stpncpy, char *,
543 (char *restrict __dst, char const *restrict __src,
546 _GL_CXXALIASWARN (stpncpy);
547 #elif defined GNULIB_POSIXCHECK
549 # if HAVE_RAW_DECL_STPNCPY
550 _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
551 "use gnulib module stpncpy for portability");
555 #if defined GNULIB_POSIXCHECK
556 /* strchr() does not work with multibyte strings if the locale encoding is
557 GB18030 and the character to be searched is a digit. */
559 /* Assume strchr is always declared. */
560 _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
561 "in some multibyte locales - "
562 "use mbschr if you care about internationalization");
565 /* Find the first occurrence of C in S or the final NUL byte. */
568 _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
569 __attribute__ ((__pure__))
570 _GL_ARG_NONNULL ((1)));
572 /* On some systems, this function is defined as an overloaded function:
573 extern "C++" { const char * std::strchrnul (const char *, int); }
574 extern "C++" { char * std::strchrnul (char *, int); } */
575 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
576 char *, (char const *__s, int __c_in),
577 char const *, (char const *__s, int __c_in));
578 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
579 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
580 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
581 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
583 _GL_CXXALIASWARN (strchrnul);
585 #elif defined GNULIB_POSIXCHECK
587 # if HAVE_RAW_DECL_STRCHRNUL
588 _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
589 "use gnulib module strchrnul for portability");
593 /* Duplicate S, returning an identical malloc'd string. */
596 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
598 # define strdup rpl_strdup
600 _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
601 _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
603 # if !(1 || defined strdup)
604 _GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
606 _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
608 _GL_CXXALIASWARN (strdup);
609 #elif defined GNULIB_POSIXCHECK
611 # if HAVE_RAW_DECL_STRDUP
612 _GL_WARN_ON_USE (strdup, "strdup is unportable - "
613 "use gnulib module strdup for portability");
617 /* Append no more than N characters from SRC onto DEST. */
620 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
622 # define strncat rpl_strncat
624 _GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
625 _GL_ARG_NONNULL ((1, 2)));
626 _GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
628 _GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
630 _GL_CXXALIASWARN (strncat);
631 #elif defined GNULIB_POSIXCHECK
633 # if HAVE_RAW_DECL_STRNCAT
634 _GL_WARN_ON_USE (strncat, "strncat is unportable - "
635 "use gnulib module strncat for portability");
639 /* Return a newly allocated copy of at most N bytes of STRING. */
642 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
644 # define strndup rpl_strndup
646 _GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
647 _GL_ARG_NONNULL ((1)));
648 _GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
651 _GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
652 _GL_ARG_NONNULL ((1)));
654 _GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
656 _GL_CXXALIASWARN (strndup);
657 #elif defined GNULIB_POSIXCHECK
659 # if HAVE_RAW_DECL_STRNDUP
660 _GL_WARN_ON_USE (strndup, "strndup is unportable - "
661 "use gnulib module strndup for portability");
665 /* Find the length (number of bytes) of STRING, but scan at most
666 MAXLEN bytes. If no '\0' terminator is found in that many bytes,
670 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
672 # define strnlen rpl_strnlen
674 _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
675 __attribute__ ((__pure__))
676 _GL_ARG_NONNULL ((1)));
677 _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
680 _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
681 __attribute__ ((__pure__))
682 _GL_ARG_NONNULL ((1)));
684 _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
686 _GL_CXXALIASWARN (strnlen);
687 #elif defined GNULIB_POSIXCHECK
689 # if HAVE_RAW_DECL_STRNLEN
690 _GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
691 "use gnulib module strnlen for portability");
695 #if defined GNULIB_POSIXCHECK
696 /* strcspn() assumes the second argument is a list of single-byte characters.
697 Even in this simple case, it does not work with multibyte strings if the
698 locale encoding is GB18030 and one of the characters to be searched is a
701 /* Assume strcspn is always declared. */
702 _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
703 "in multibyte locales - "
704 "use mbscspn if you care about internationalization");
707 /* Find the first occurrence in S of any character in ACCEPT. */
710 _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
711 __attribute__ ((__pure__))
712 _GL_ARG_NONNULL ((1, 2)));
714 /* On some systems, this function is defined as an overloaded function:
715 extern "C" { const char * strpbrk (const char *, const char *); }
716 extern "C++" { char * strpbrk (char *, const char *); } */
717 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
718 char *, (char const *__s, char const *__accept),
719 const char *, (char const *__s, char const *__accept));
720 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
721 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
722 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
723 _GL_CXXALIASWARN1 (strpbrk, char const *,
724 (char const *__s, char const *__accept));
726 _GL_CXXALIASWARN (strpbrk);
728 # if defined GNULIB_POSIXCHECK
729 /* strpbrk() assumes the second argument is a list of single-byte characters.
730 Even in this simple case, it does not work with multibyte strings if the
731 locale encoding is GB18030 and one of the characters to be searched is a
734 _GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
735 "in multibyte locales - "
736 "use mbspbrk if you care about internationalization");
738 #elif defined GNULIB_POSIXCHECK
740 # if HAVE_RAW_DECL_STRPBRK
741 _GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
742 "use gnulib module strpbrk for portability");
746 #if defined GNULIB_POSIXCHECK
747 /* strspn() assumes the second argument is a list of single-byte characters.
748 Even in this simple case, it cannot work with multibyte strings. */
750 /* Assume strspn is always declared. */
751 _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
752 "in multibyte locales - "
753 "use mbsspn if you care about internationalization");
756 #if defined GNULIB_POSIXCHECK
757 /* strrchr() does not work with multibyte strings if the locale encoding is
758 GB18030 and the character to be searched is a digit. */
760 /* Assume strrchr is always declared. */
761 _GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
762 "in some multibyte locales - "
763 "use mbsrchr if you care about internationalization");
766 /* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
767 If one is found, overwrite it with a NUL, and advance *STRINGP
768 to point to the next char after it. Otherwise, set *STRINGP to NULL.
769 If *STRINGP was already NULL, nothing happens.
770 Return the old value of *STRINGP.
772 This is a variant of strtok() that is multithread-safe and supports
775 Caveat: It modifies the original string.
776 Caveat: These functions cannot be used on constant strings.
777 Caveat: The identity of the delimiting character is lost.
778 Caveat: It doesn't work with multibyte strings unless all of the delimiter
779 characters are ASCII characters < 0x30.
781 See also strtok_r(). */
784 _GL_FUNCDECL_SYS (strsep, char *,
785 (char **restrict __stringp, char const *restrict __delim)
786 _GL_ARG_NONNULL ((1, 2)));
788 _GL_CXXALIAS_SYS (strsep, char *,
789 (char **restrict __stringp, char const *restrict __delim));
790 _GL_CXXALIASWARN (strsep);
791 # if defined GNULIB_POSIXCHECK
793 _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
794 "in multibyte locales - "
795 "use mbssep if you care about internationalization");
797 #elif defined GNULIB_POSIXCHECK
799 # if HAVE_RAW_DECL_STRSEP
800 _GL_WARN_ON_USE (strsep, "strsep is unportable - "
801 "use gnulib module strsep for portability");
807 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
808 # define strstr rpl_strstr
810 _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
811 __attribute__ ((__pure__))
812 _GL_ARG_NONNULL ((1, 2)));
813 _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
815 /* On some systems, this function is defined as an overloaded function:
816 extern "C++" { const char * strstr (const char *, const char *); }
817 extern "C++" { char * strstr (char *, const char *); } */
818 _GL_CXXALIAS_SYS_CAST2 (strstr,
819 char *, (const char *haystack, const char *needle),
820 const char *, (const char *haystack, const char *needle));
822 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
823 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
824 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
825 _GL_CXXALIASWARN1 (strstr, const char *,
826 (const char *haystack, const char *needle));
828 _GL_CXXALIASWARN (strstr);
830 #elif defined GNULIB_POSIXCHECK
831 /* strstr() does not work with multibyte strings if the locale encoding is
832 different from UTF-8:
833 POSIX says that it operates on "strings", and "string" in POSIX is defined
834 as a sequence of bytes, not of characters. */
836 /* Assume strstr is always declared. */
837 _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
838 "work correctly on character strings in most "
839 "multibyte locales - "
840 "use mbsstr if you care about internationalization, "
841 "or use strstr if you care about speed");
844 /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
848 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
849 # define strcasestr rpl_strcasestr
851 _GL_FUNCDECL_RPL (strcasestr, char *,
852 (const char *haystack, const char *needle)
853 __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
854 _GL_CXXALIAS_RPL (strcasestr, char *,
855 (const char *haystack, const char *needle));
858 _GL_FUNCDECL_SYS (strcasestr, char *,
859 (const char *haystack, const char *needle)
860 __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
862 /* On some systems, this function is defined as an overloaded function:
863 extern "C++" { const char * strcasestr (const char *, const char *); }
864 extern "C++" { char * strcasestr (char *, const char *); } */
865 _GL_CXXALIAS_SYS_CAST2 (strcasestr,
866 char *, (const char *haystack, const char *needle),
867 const char *, (const char *haystack, const char *needle));
869 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
870 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
871 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
872 _GL_CXXALIASWARN1 (strcasestr, const char *,
873 (const char *haystack, const char *needle));
875 _GL_CXXALIASWARN (strcasestr);
877 #elif defined GNULIB_POSIXCHECK
878 /* strcasestr() does not work with multibyte strings:
879 It is a glibc extension, and glibc implements it only for unibyte
882 # if HAVE_RAW_DECL_STRCASESTR
883 _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
884 "strings in multibyte locales - "
885 "use mbscasestr if you care about "
886 "internationalization, or use c-strcasestr if you want "
887 "a locale independent function");
891 /* Parse S into tokens separated by characters in DELIM.
892 If S is NULL, the saved pointer in SAVE_PTR is used as
893 the next starting point. For example:
894 char s[] = "-abc-=-def";
896 x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
897 x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
898 x = strtok_r(NULL, "=", &sp); // x = NULL
901 This is a variant of strtok() that is multithread-safe.
903 For the POSIX documentation for this function, see:
904 http://www.opengroup.org/susv3xsh/strtok.html
906 Caveat: It modifies the original string.
907 Caveat: These functions cannot be used on constant strings.
908 Caveat: The identity of the delimiting character is lost.
909 Caveat: It doesn't work with multibyte strings unless all of the delimiter
910 characters are ASCII characters < 0x30.
912 See also strsep(). */
915 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
917 # define strtok_r rpl_strtok_r
919 _GL_FUNCDECL_RPL (strtok_r, char *,
920 (char *restrict s, char const *restrict delim,
921 char **restrict save_ptr)
922 _GL_ARG_NONNULL ((2, 3)));
923 _GL_CXXALIAS_RPL (strtok_r, char *,
924 (char *restrict s, char const *restrict delim,
925 char **restrict save_ptr));
927 # if 0 || defined GNULIB_POSIXCHECK
931 _GL_FUNCDECL_SYS (strtok_r, char *,
932 (char *restrict s, char const *restrict delim,
933 char **restrict save_ptr)
934 _GL_ARG_NONNULL ((2, 3)));
936 _GL_CXXALIAS_SYS (strtok_r, char *,
937 (char *restrict s, char const *restrict delim,
938 char **restrict save_ptr));
940 _GL_CXXALIASWARN (strtok_r);
941 # if defined GNULIB_POSIXCHECK
942 _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
943 "strings in multibyte locales - "
944 "use mbstok_r if you care about internationalization");
946 #elif defined GNULIB_POSIXCHECK
948 # if HAVE_RAW_DECL_STRTOK_R
949 _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
950 "use gnulib module strtok_r for portability");
955 /* The following functions are not specified by POSIX. They are gnulib
959 /* Return the number of multibyte characters in the character string STRING.
960 This considers multibyte characters, unlike strlen, which counts bytes. */
961 # ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
964 # if 0 /* AIX, OSF/1, MirBSD define mbslen already in libc. */
965 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
966 # define mbslen rpl_mbslen
968 _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
969 _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
971 _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
972 _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
974 _GL_CXXALIASWARN (mbslen);
978 /* Return the number of multibyte characters in the character string starting
979 at STRING and ending at STRING + LEN. */
980 _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
981 _GL_ARG_NONNULL ((1));
985 /* Locate the first single-byte character C in the character string STRING,
986 and return a pointer to it. Return NULL if C is not found in STRING.
987 Unlike strchr(), this function works correctly in multibyte locales with
988 encodings such as GB18030. */
990 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
991 # define mbschr rpl_mbschr /* avoid collision with HP-UX function */
993 _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
994 _GL_ARG_NONNULL ((1)));
995 _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
997 _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
998 _GL_ARG_NONNULL ((1)));
999 _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
1001 _GL_CXXALIASWARN (mbschr);
1005 /* Locate the last single-byte character C in the character string STRING,
1006 and return a pointer to it. Return NULL if C is not found in STRING.
1007 Unlike strrchr(), this function works correctly in multibyte locales with
1008 encodings such as GB18030. */
1010 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1011 # define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
1013 _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
1014 _GL_ARG_NONNULL ((1)));
1015 _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
1017 _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
1018 _GL_ARG_NONNULL ((1)));
1019 _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
1021 _GL_CXXALIASWARN (mbsrchr);
1025 /* Find the first occurrence of the character string NEEDLE in the character
1026 string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
1027 Unlike strstr(), this function works correctly in multibyte locales with
1028 encodings different from UTF-8. */
1029 _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
1030 _GL_ARG_NONNULL ((1, 2));
1034 /* Compare the character strings S1 and S2, ignoring case, returning less than,
1035 equal to or greater than zero if S1 is lexicographically less than, equal to
1037 Note: This function may, in multibyte locales, return 0 for strings of
1039 Unlike strcasecmp(), this function works correctly in multibyte locales. */
1040 _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
1041 _GL_ARG_NONNULL ((1, 2));
1045 /* Compare the initial segment of the character string S1 consisting of at most
1046 N characters with the initial segment of the character string S2 consisting
1047 of at most N characters, ignoring case, returning less than, equal to or
1048 greater than zero if the initial segment of S1 is lexicographically less
1049 than, equal to or greater than the initial segment of S2.
1050 Note: This function may, in multibyte locales, return 0 for initial segments
1051 of different lengths!
1052 Unlike strncasecmp(), this function works correctly in multibyte locales.
1053 But beware that N is not a byte count but a character count! */
1054 _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
1055 _GL_ARG_NONNULL ((1, 2));
1059 /* Compare the initial segment of the character string STRING consisting of
1060 at most mbslen (PREFIX) characters with the character string PREFIX,
1061 ignoring case, returning less than, equal to or greater than zero if this
1062 initial segment is lexicographically less than, equal to or greater than
1064 Note: This function may, in multibyte locales, return 0 if STRING is of
1065 smaller length than PREFIX!
1066 Unlike strncasecmp(), this function works correctly in multibyte
1068 _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
1069 _GL_ARG_NONNULL ((1, 2));
1073 /* Find the first occurrence of the character string NEEDLE in the character
1074 string HAYSTACK, using case-insensitive comparison.
1075 Note: This function may, in multibyte locales, return success even if
1076 strlen (haystack) < strlen (needle) !
1077 Unlike strcasestr(), this function works correctly in multibyte locales. */
1078 _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
1079 _GL_ARG_NONNULL ((1, 2));
1083 /* Find the first occurrence in the character string STRING of any character
1084 in the character string ACCEPT. Return the number of bytes from the
1085 beginning of the string to this occurrence, or to the end of the string
1087 Unlike strcspn(), this function works correctly in multibyte locales. */
1088 _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
1089 _GL_ARG_NONNULL ((1, 2));
1093 /* Find the first occurrence in the character string STRING of any character
1094 in the character string ACCEPT. Return the pointer to it, or NULL if none
1096 Unlike strpbrk(), this function works correctly in multibyte locales. */
1098 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1099 # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
1101 _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
1102 _GL_ARG_NONNULL ((1, 2)));
1103 _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
1105 _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
1106 _GL_ARG_NONNULL ((1, 2)));
1107 _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
1109 _GL_CXXALIASWARN (mbspbrk);
1113 /* Find the first occurrence in the character string STRING of any character
1114 not in the character string REJECT. Return the number of bytes from the
1115 beginning of the string to this occurrence, or to the end of the string
1117 Unlike strspn(), this function works correctly in multibyte locales. */
1118 _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
1119 _GL_ARG_NONNULL ((1, 2));
1123 /* Search the next delimiter (multibyte character listed in the character
1124 string DELIM) starting at the character string *STRINGP.
1125 If one is found, overwrite it with a NUL, and advance *STRINGP to point
1126 to the next multibyte character after it. Otherwise, set *STRINGP to NULL.
1127 If *STRINGP was already NULL, nothing happens.
1128 Return the old value of *STRINGP.
1130 This is a variant of mbstok_r() that supports empty fields.
1132 Caveat: It modifies the original string.
1133 Caveat: These functions cannot be used on constant strings.
1134 Caveat: The identity of the delimiting character is lost.
1136 See also mbstok_r(). */
1137 _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
1138 _GL_ARG_NONNULL ((1, 2));
1142 /* Parse the character string STRING into tokens separated by characters in
1143 the character string DELIM.
1144 If STRING is NULL, the saved pointer in SAVE_PTR is used as
1145 the next starting point. For example:
1146 char s[] = "-abc-=-def";
1148 x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def"
1149 x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL
1150 x = mbstok_r(NULL, "=", &sp); // x = NULL
1151 // s = "abc\0-def\0"
1153 Caveat: It modifies the original string.
1154 Caveat: These functions cannot be used on constant strings.
1155 Caveat: The identity of the delimiting character is lost.
1157 See also mbssep(). */
1158 _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
1159 _GL_ARG_NONNULL ((2, 3));
1162 /* Map any int, typically from errno, into an error message. */
1165 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1167 # define strerror rpl_strerror
1169 _GL_FUNCDECL_RPL (strerror, char *, (int));
1170 _GL_CXXALIAS_RPL (strerror, char *, (int));
1172 _GL_CXXALIAS_SYS (strerror, char *, (int));
1174 _GL_CXXALIASWARN (strerror);
1175 #elif defined GNULIB_POSIXCHECK
1177 /* Assume strerror is always declared. */
1178 _GL_WARN_ON_USE (strerror, "strerror is unportable - "
1179 "use gnulib module strerror to guarantee non-NULL result");
1184 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1185 # define strsignal rpl_strsignal
1187 _GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
1188 _GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
1191 _GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
1193 /* Need to cast, because on Cygwin 1.5.x systems, the return type is
1195 _GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
1197 _GL_CXXALIASWARN (strsignal);
1198 #elif defined GNULIB_POSIXCHECK
1200 # if HAVE_RAW_DECL_STRSIGNAL
1201 _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
1202 "use gnulib module strsignal for portability");
1208 _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
1209 _GL_ARG_NONNULL ((1, 2)));
1211 _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
1212 _GL_CXXALIASWARN (strverscmp);
1213 #elif defined GNULIB_POSIXCHECK
1215 # if HAVE_RAW_DECL_STRVERSCMP
1216 _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
1217 "use gnulib module strverscmp for portability");
1222 #endif /* _GL_STRING_H */
1223 #endif /* _GL_STRING_H */