1/* A GNU-like <string.h>.
2
3   Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
4
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation; either version 3, or (at your option)
8   any later version.
9
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14
15   You should have received a copy of the GNU General Public License
16   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
17
18#if __GNUC__ >= 3
19@PRAGMA_SYSTEM_HEADER@
20#endif
21@PRAGMA_COLUMNS@
22
23#if defined _GL_ALREADY_INCLUDING_STRING_H
24/* Special invocation convention:
25   - On OS X/NetBSD we have a sequence of nested includes
26       <string.h> -> <strings.h> -> "string.h"
27     In this situation system _chk variants due to -D_FORTIFY_SOURCE
28     might be used after any replacements defined here.  */
29
30#@INCLUDE_NEXT@ @NEXT_STRING_H@
31
32#else
33/* Normal invocation convention.  */
34
35#ifndef _@GUARD_PREFIX@_STRING_H
36
37#define _GL_ALREADY_INCLUDING_STRING_H
38
39/* The include_next requires a split double-inclusion guard.  */
40#@INCLUDE_NEXT@ @NEXT_STRING_H@
41
42#undef _GL_ALREADY_INCLUDING_STRING_H
43
44#ifndef _@GUARD_PREFIX@_STRING_H
45#define _@GUARD_PREFIX@_STRING_H
46
47/* NetBSD 5.0 mis-defines NULL.  */
48#include <stddef.h>
49
50/* MirBSD defines mbslen as a macro.  */
51#if @GNULIB_MBSLEN@ && defined __MirBSD__
52# include <wchar.h>
53#endif
54
55/* The __attribute__ feature is available in gcc versions 2.5 and later.
56   The attribute __pure__ was added in gcc 2.96.  */
57#ifndef _GL_ATTRIBUTE_PURE
58# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
59#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
60# else
61#  define _GL_ATTRIBUTE_PURE /* empty */
62# endif
63#endif
64
65/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>.  */
66/* But in any case avoid namespace pollution on glibc systems.  */
67#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
68    && ! defined __GLIBC__
69# include <unistd.h>
70#endif
71
72/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
73
74/* The definition of _GL_ARG_NONNULL is copied here.  */
75
76/* The definition of _GL_WARN_ON_USE is copied here.  */
77
78
79/* Clear a block of memory.  The compiler will not delete a call to
80   this function, even if the block is dead after the call.  */
81#if @GNULIB_EXPLICIT_BZERO@
82# if ! @HAVE_EXPLICIT_BZERO@
83_GL_FUNCDECL_SYS (explicit_bzero, void,
84                  (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
85# endif
86_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
87_GL_CXXALIASWARN (explicit_bzero);
88#elif defined GNULIB_POSIXCHECK
89# undef explicit_bzero
90# if HAVE_RAW_DECL_EXPLICIT_BZERO
91_GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
92                 "use gnulib module explicit_bzero for portability");
93# endif
94#endif
95
96/* Find the index of the least-significant set bit.  */
97#if @GNULIB_FFSL@
98# if !@HAVE_FFSL@
99_GL_FUNCDECL_SYS (ffsl, int, (long int i));
100# endif
101_GL_CXXALIAS_SYS (ffsl, int, (long int i));
102_GL_CXXALIASWARN (ffsl);
103#elif defined GNULIB_POSIXCHECK
104# undef ffsl
105# if HAVE_RAW_DECL_FFSL
106_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
107# endif
108#endif
109
110
111/* Find the index of the least-significant set bit.  */
112#if @GNULIB_FFSLL@
113# if !@HAVE_FFSLL@
114_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
115# endif
116_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
117_GL_CXXALIASWARN (ffsll);
118#elif defined GNULIB_POSIXCHECK
119# undef ffsll
120# if HAVE_RAW_DECL_FFSLL
121_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
122# endif
123#endif
124
125
126/* Return the first instance of C within N bytes of S, or NULL.  */
127#if @GNULIB_MEMCHR@
128# if @REPLACE_MEMCHR@
129#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
130#   define memchr rpl_memchr
131#  endif
132_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
133                                  _GL_ATTRIBUTE_PURE
134                                  _GL_ARG_NONNULL ((1)));
135_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
136# else
137#  if ! @HAVE_MEMCHR@
138_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
139                                  _GL_ATTRIBUTE_PURE
140                                  _GL_ARG_NONNULL ((1)));
141#  endif
142  /* On some systems, this function is defined as an overloaded function:
143       extern "C" { const void * std::memchr (const void *, int, size_t); }
144       extern "C++" { void * std::memchr (void *, int, size_t); }  */
145_GL_CXXALIAS_SYS_CAST2 (memchr,
146                        void *, (void const *__s, int __c, size_t __n),
147                        void const *, (void const *__s, int __c, size_t __n));
148# endif
149# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
150     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
151_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
152_GL_CXXALIASWARN1 (memchr, void const *,
153                   (void const *__s, int __c, size_t __n));
154# elif __GLIBC__ >= 2
155_GL_CXXALIASWARN (memchr);
156# endif
157#elif defined GNULIB_POSIXCHECK
158# undef memchr
159/* Assume memchr is always declared.  */
160_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
161                 "use gnulib module memchr for portability" );
162#endif
163
164/* Return the first occurrence of NEEDLE in HAYSTACK.  */
165#if @GNULIB_MEMMEM@
166# if @REPLACE_MEMMEM@
167#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
168#   define memmem rpl_memmem
169#  endif
170_GL_FUNCDECL_RPL (memmem, void *,
171                  (void const *__haystack, size_t __haystack_len,
172                   void const *__needle, size_t __needle_len)
173                  _GL_ATTRIBUTE_PURE
174                  _GL_ARG_NONNULL ((1, 3)));
175_GL_CXXALIAS_RPL (memmem, void *,
176                  (void const *__haystack, size_t __haystack_len,
177                   void const *__needle, size_t __needle_len));
178# else
179#  if ! @HAVE_DECL_MEMMEM@
180_GL_FUNCDECL_SYS (memmem, void *,
181                  (void const *__haystack, size_t __haystack_len,
182                   void const *__needle, size_t __needle_len)
183                  _GL_ATTRIBUTE_PURE
184                  _GL_ARG_NONNULL ((1, 3)));
185#  endif
186_GL_CXXALIAS_SYS (memmem, void *,
187                  (void const *__haystack, size_t __haystack_len,
188                   void const *__needle, size_t __needle_len));
189# endif
190_GL_CXXALIASWARN (memmem);
191#elif defined GNULIB_POSIXCHECK
192# undef memmem
193# if HAVE_RAW_DECL_MEMMEM
194_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
195                 "use gnulib module memmem-simple for portability, "
196                 "and module memmem for speed" );
197# endif
198#endif
199
200/* Copy N bytes of SRC to DEST, return pointer to bytes after the
201   last written byte.  */
202#if @GNULIB_MEMPCPY@
203# if ! @HAVE_MEMPCPY@
204_GL_FUNCDECL_SYS (mempcpy, void *,
205                  (void *restrict __dest, void const *restrict __src,
206                   size_t __n)
207                  _GL_ARG_NONNULL ((1, 2)));
208# endif
209_GL_CXXALIAS_SYS (mempcpy, void *,
210                  (void *restrict __dest, void const *restrict __src,
211                   size_t __n));
212_GL_CXXALIASWARN (mempcpy);
213#elif defined GNULIB_POSIXCHECK
214# undef mempcpy
215# if HAVE_RAW_DECL_MEMPCPY
216_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
217                 "use gnulib module mempcpy for portability");
218# endif
219#endif
220
221/* Search backwards through a block for a byte (specified as an int).  */
222#if @GNULIB_MEMRCHR@
223# if ! @HAVE_DECL_MEMRCHR@
224_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
225                                   _GL_ATTRIBUTE_PURE
226                                   _GL_ARG_NONNULL ((1)));
227# endif
228  /* On some systems, this function is defined as an overloaded function:
229       extern "C++" { const void * std::memrchr (const void *, int, size_t); }
230       extern "C++" { void * std::memrchr (void *, int, size_t); }  */
231_GL_CXXALIAS_SYS_CAST2 (memrchr,
232                        void *, (void const *, int, size_t),
233                        void const *, (void const *, int, size_t));
234# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
235     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
236_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
237_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
238# else
239_GL_CXXALIASWARN (memrchr);
240# endif
241#elif defined GNULIB_POSIXCHECK
242# undef memrchr
243# if HAVE_RAW_DECL_MEMRCHR
244_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
245                 "use gnulib module memrchr for portability");
246# endif
247#endif
248
249/* Find the first occurrence of C in S.  More efficient than
250   memchr(S,C,N), at the expense of undefined behavior if C does not
251   occur within N bytes.  */
252#if @GNULIB_RAWMEMCHR@
253# if ! @HAVE_RAWMEMCHR@
254_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
255                                     _GL_ATTRIBUTE_PURE
256                                     _GL_ARG_NONNULL ((1)));
257# endif
258  /* On some systems, this function is defined as an overloaded function:
259       extern "C++" { const void * std::rawmemchr (const void *, int); }
260       extern "C++" { void * std::rawmemchr (void *, int); }  */
261_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
262                        void *, (void const *__s, int __c_in),
263                        void const *, (void const *__s, int __c_in));
264# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
265     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
266_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
267_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
268# else
269_GL_CXXALIASWARN (rawmemchr);
270# endif
271#elif defined GNULIB_POSIXCHECK
272# undef rawmemchr
273# if HAVE_RAW_DECL_RAWMEMCHR
274_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
275                 "use gnulib module rawmemchr for portability");
276# endif
277#endif
278
279/* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
280#if @GNULIB_STPCPY@
281# if ! @HAVE_STPCPY@
282_GL_FUNCDECL_SYS (stpcpy, char *,
283                  (char *restrict __dst, char const *restrict __src)
284                  _GL_ARG_NONNULL ((1, 2)));
285# endif
286_GL_CXXALIAS_SYS (stpcpy, char *,
287                  (char *restrict __dst, char const *restrict __src));
288_GL_CXXALIASWARN (stpcpy);
289#elif defined GNULIB_POSIXCHECK
290# undef stpcpy
291# if HAVE_RAW_DECL_STPCPY
292_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
293                 "use gnulib module stpcpy for portability");
294# endif
295#endif
296
297/* Copy no more than N bytes of SRC to DST, returning a pointer past the
298   last non-NUL byte written into DST.  */
299#if @GNULIB_STPNCPY@
300# if @REPLACE_STPNCPY@
301#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
302#   undef stpncpy
303#   define stpncpy rpl_stpncpy
304#  endif
305_GL_FUNCDECL_RPL (stpncpy, char *,
306                  (char *restrict __dst, char const *restrict __src,
307                   size_t __n)
308                  _GL_ARG_NONNULL ((1, 2)));
309_GL_CXXALIAS_RPL (stpncpy, char *,
310                  (char *restrict __dst, char const *restrict __src,
311                   size_t __n));
312# else
313#  if ! @HAVE_STPNCPY@
314_GL_FUNCDECL_SYS (stpncpy, char *,
315                  (char *restrict __dst, char const *restrict __src,
316                   size_t __n)
317                  _GL_ARG_NONNULL ((1, 2)));
318#  endif
319_GL_CXXALIAS_SYS (stpncpy, char *,
320                  (char *restrict __dst, char const *restrict __src,
321                   size_t __n));
322# endif
323_GL_CXXALIASWARN (stpncpy);
324#elif defined GNULIB_POSIXCHECK
325# undef stpncpy
326# if HAVE_RAW_DECL_STPNCPY
327_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
328                 "use gnulib module stpncpy for portability");
329# endif
330#endif
331
332#if defined GNULIB_POSIXCHECK
333/* strchr() does not work with multibyte strings if the locale encoding is
334   GB18030 and the character to be searched is a digit.  */
335# undef strchr
336/* Assume strchr is always declared.  */
337_GL_WARN_ON_USE_CXX (strchr, const char *, (const char *, int),
338                     "strchr cannot work correctly on character strings "
339                     "in some multibyte locales - "
340                     "use mbschr if you care about internationalization");
341#endif
342
343/* Find the first occurrence of C in S or the final NUL byte.  */
344#if @GNULIB_STRCHRNUL@
345# if @REPLACE_STRCHRNUL@
346#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
347#   define strchrnul rpl_strchrnul
348#  endif
349_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
350                                     _GL_ATTRIBUTE_PURE
351                                     _GL_ARG_NONNULL ((1)));
352_GL_CXXALIAS_RPL (strchrnul, char *,
353                  (const char *str, int ch));
354# else
355#  if ! @HAVE_STRCHRNUL@
356_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
357                                     _GL_ATTRIBUTE_PURE
358                                     _GL_ARG_NONNULL ((1)));
359#  endif
360  /* On some systems, this function is defined as an overloaded function:
361       extern "C++" { const char * std::strchrnul (const char *, int); }
362       extern "C++" { char * std::strchrnul (char *, int); }  */
363_GL_CXXALIAS_SYS_CAST2 (strchrnul,
364                        char *, (char const *__s, int __c_in),
365                        char const *, (char const *__s, int __c_in));
366# endif
367# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
368     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
369_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
370_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
371# else
372_GL_CXXALIASWARN (strchrnul);
373# endif
374#elif defined GNULIB_POSIXCHECK
375# undef strchrnul
376# if HAVE_RAW_DECL_STRCHRNUL
377_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
378                 "use gnulib module strchrnul for portability");
379# endif
380#endif
381
382/* Duplicate S, returning an identical malloc'd string.  */
383#if @GNULIB_STRDUP@
384# if @REPLACE_STRDUP@
385#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
386#   undef strdup
387#   define strdup rpl_strdup
388#  endif
389_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
390_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
391# else
392#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
393    /* strdup exists as a function and as a macro.  Get rid of the macro.  */
394#   undef strdup
395#  endif
396#  if !(@HAVE_DECL_STRDUP@ || defined strdup)
397_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
398#  endif
399_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
400# endif
401_GL_CXXALIASWARN (strdup);
402#elif defined GNULIB_POSIXCHECK
403# undef strdup
404# if HAVE_RAW_DECL_STRDUP
405_GL_WARN_ON_USE (strdup, "strdup is unportable - "
406                 "use gnulib module strdup for portability");
407# endif
408#endif
409
410/* Append no more than N characters from SRC onto DEST.  */
411#if @GNULIB_STRNCAT@
412# if @REPLACE_STRNCAT@
413#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
414#   undef strncat
415#   define strncat rpl_strncat
416#  endif
417_GL_FUNCDECL_RPL (strncat, char *,
418                  (char *restrict dest, const char *restrict src, size_t n)
419                  _GL_ARG_NONNULL ((1, 2)));
420_GL_CXXALIAS_RPL (strncat, char *,
421                  (char *restrict dest, const char *restrict src, size_t n));
422# else
423_GL_CXXALIAS_SYS (strncat, char *,
424                  (char *restrict dest, const char *restrict src, size_t n));
425# endif
426# if __GLIBC__ >= 2
427_GL_CXXALIASWARN (strncat);
428# endif
429#elif defined GNULIB_POSIXCHECK
430# undef strncat
431# if HAVE_RAW_DECL_STRNCAT
432_GL_WARN_ON_USE (strncat, "strncat is unportable - "
433                 "use gnulib module strncat for portability");
434# endif
435#endif
436
437/* Return a newly allocated copy of at most N bytes of STRING.  */
438#if @GNULIB_STRNDUP@
439# if @REPLACE_STRNDUP@
440#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
441#   undef strndup
442#   define strndup rpl_strndup
443#  endif
444_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n)
445                                   _GL_ARG_NONNULL ((1)));
446_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
447# else
448#  if ! @HAVE_DECL_STRNDUP@
449_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n)
450                                   _GL_ARG_NONNULL ((1)));
451#  endif
452_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
453# endif
454_GL_CXXALIASWARN (strndup);
455#elif defined GNULIB_POSIXCHECK
456# undef strndup
457# if HAVE_RAW_DECL_STRNDUP
458_GL_WARN_ON_USE (strndup, "strndup is unportable - "
459                 "use gnulib module strndup for portability");
460# endif
461#endif
462
463/* Find the length (number of bytes) of STRING, but scan at most
464   MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
465   return MAXLEN.  */
466#if @GNULIB_STRNLEN@
467# if @REPLACE_STRNLEN@
468#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
469#   undef strnlen
470#   define strnlen rpl_strnlen
471#  endif
472_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
473                                   _GL_ATTRIBUTE_PURE
474                                   _GL_ARG_NONNULL ((1)));
475_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
476# else
477#  if ! @HAVE_DECL_STRNLEN@
478_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
479                                   _GL_ATTRIBUTE_PURE
480                                   _GL_ARG_NONNULL ((1)));
481#  endif
482_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen));
483# endif
484_GL_CXXALIASWARN (strnlen);
485#elif defined GNULIB_POSIXCHECK
486# undef strnlen
487# if HAVE_RAW_DECL_STRNLEN
488_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
489                 "use gnulib module strnlen for portability");
490# endif
491#endif
492
493#if defined GNULIB_POSIXCHECK
494/* strcspn() assumes the second argument is a list of single-byte characters.
495   Even in this simple case, it does not work with multibyte strings if the
496   locale encoding is GB18030 and one of the characters to be searched is a
497   digit.  */
498# undef strcspn
499/* Assume strcspn is always declared.  */
500_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
501                 "in multibyte locales - "
502                 "use mbscspn if you care about internationalization");
503#endif
504
505/* Find the first occurrence in S of any character in ACCEPT.  */
506#if @GNULIB_STRPBRK@
507# if ! @HAVE_STRPBRK@
508_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
509                                   _GL_ATTRIBUTE_PURE
510                                   _GL_ARG_NONNULL ((1, 2)));
511# endif
512  /* On some systems, this function is defined as an overloaded function:
513       extern "C" { const char * strpbrk (const char *, const char *); }
514       extern "C++" { char * strpbrk (char *, const char *); }  */
515_GL_CXXALIAS_SYS_CAST2 (strpbrk,
516                        char *, (char const *__s, char const *__accept),
517                        const char *, (char const *__s, char const *__accept));
518# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
519     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
520_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
521_GL_CXXALIASWARN1 (strpbrk, char const *,
522                   (char const *__s, char const *__accept));
523# elif __GLIBC__ >= 2
524_GL_CXXALIASWARN (strpbrk);
525# endif
526# if defined GNULIB_POSIXCHECK
527/* strpbrk() assumes the second argument is a list of single-byte characters.
528   Even in this simple case, it does not work with multibyte strings if the
529   locale encoding is GB18030 and one of the characters to be searched is a
530   digit.  */
531#  undef strpbrk
532_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *),
533                     "strpbrk cannot work correctly on character strings "
534                     "in multibyte locales - "
535                     "use mbspbrk if you care about internationalization");
536# endif
537#elif defined GNULIB_POSIXCHECK
538# undef strpbrk
539# if HAVE_RAW_DECL_STRPBRK
540_GL_WARN_ON_USE_CXX (strpbrk, const char *, (const char *, const char *),
541                     "strpbrk is unportable - "
542                     "use gnulib module strpbrk for portability");
543# endif
544#endif
545
546#if defined GNULIB_POSIXCHECK
547/* strspn() assumes the second argument is a list of single-byte characters.
548   Even in this simple case, it cannot work with multibyte strings.  */
549# undef strspn
550/* Assume strspn is always declared.  */
551_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
552                 "in multibyte locales - "
553                 "use mbsspn if you care about internationalization");
554#endif
555
556#if defined GNULIB_POSIXCHECK
557/* strrchr() does not work with multibyte strings if the locale encoding is
558   GB18030 and the character to be searched is a digit.  */
559# undef strrchr
560/* Assume strrchr is always declared.  */
561_GL_WARN_ON_USE_CXX (strrchr, const char *, (const char *, int),
562                     "strrchr cannot work correctly on character strings "
563                     "in some multibyte locales - "
564                     "use mbsrchr if you care about internationalization");
565#endif
566
567/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
568   If one is found, overwrite it with a NUL, and advance *STRINGP
569   to point to the next char after it.  Otherwise, set *STRINGP to NULL.
570   If *STRINGP was already NULL, nothing happens.
571   Return the old value of *STRINGP.
572
573   This is a variant of strtok() that is multithread-safe and supports
574   empty fields.
575
576   Caveat: It modifies the original string.
577   Caveat: These functions cannot be used on constant strings.
578   Caveat: The identity of the delimiting character is lost.
579   Caveat: It doesn't work with multibyte strings unless all of the delimiter
580           characters are ASCII characters < 0x30.
581
582   See also strtok_r().  */
583#if @GNULIB_STRSEP@
584# if ! @HAVE_STRSEP@
585_GL_FUNCDECL_SYS (strsep, char *,
586                  (char **restrict __stringp, char const *restrict __delim)
587                  _GL_ARG_NONNULL ((1, 2)));
588# endif
589_GL_CXXALIAS_SYS (strsep, char *,
590                  (char **restrict __stringp, char const *restrict __delim));
591_GL_CXXALIASWARN (strsep);
592# if defined GNULIB_POSIXCHECK
593#  undef strsep
594_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
595                 "in multibyte locales - "
596                 "use mbssep if you care about internationalization");
597# endif
598#elif defined GNULIB_POSIXCHECK
599# undef strsep
600# if HAVE_RAW_DECL_STRSEP
601_GL_WARN_ON_USE (strsep, "strsep is unportable - "
602                 "use gnulib module strsep for portability");
603# endif
604#endif
605
606#if @GNULIB_STRSTR@
607# if @REPLACE_STRSTR@
608#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
609#   define strstr rpl_strstr
610#  endif
611_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
612                                  _GL_ATTRIBUTE_PURE
613                                  _GL_ARG_NONNULL ((1, 2)));
614_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
615# else
616  /* On some systems, this function is defined as an overloaded function:
617       extern "C++" { const char * strstr (const char *, const char *); }
618       extern "C++" { char * strstr (char *, const char *); }  */
619_GL_CXXALIAS_SYS_CAST2 (strstr,
620                        char *, (const char *haystack, const char *needle),
621                        const char *, (const char *haystack, const char *needle));
622# endif
623# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
624     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
625_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
626_GL_CXXALIASWARN1 (strstr, const char *,
627                   (const char *haystack, const char *needle));
628# elif __GLIBC__ >= 2
629_GL_CXXALIASWARN (strstr);
630# endif
631#elif defined GNULIB_POSIXCHECK
632/* strstr() does not work with multibyte strings if the locale encoding is
633   different from UTF-8:
634   POSIX says that it operates on "strings", and "string" in POSIX is defined
635   as a sequence of bytes, not of characters.  */
636# undef strstr
637/* Assume strstr is always declared.  */
638_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
639                 "work correctly on character strings in most "
640                 "multibyte locales - "
641                 "use mbsstr if you care about internationalization, "
642                 "or use strstr if you care about speed");
643#endif
644
645/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
646   comparison.  */
647#if @GNULIB_STRCASESTR@
648# if @REPLACE_STRCASESTR@
649#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
650#   define strcasestr rpl_strcasestr
651#  endif
652_GL_FUNCDECL_RPL (strcasestr, char *,
653                  (const char *haystack, const char *needle)
654                  _GL_ATTRIBUTE_PURE
655                  _GL_ARG_NONNULL ((1, 2)));
656_GL_CXXALIAS_RPL (strcasestr, char *,
657                  (const char *haystack, const char *needle));
658# else
659#  if ! @HAVE_STRCASESTR@
660_GL_FUNCDECL_SYS (strcasestr, char *,
661                  (const char *haystack, const char *needle)
662                  _GL_ATTRIBUTE_PURE
663                  _GL_ARG_NONNULL ((1, 2)));
664#  endif
665  /* On some systems, this function is defined as an overloaded function:
666       extern "C++" { const char * strcasestr (const char *, const char *); }
667       extern "C++" { char * strcasestr (char *, const char *); }  */
668_GL_CXXALIAS_SYS_CAST2 (strcasestr,
669                        char *, (const char *haystack, const char *needle),
670                        const char *, (const char *haystack, const char *needle));
671# endif
672# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
673     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
674_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
675_GL_CXXALIASWARN1 (strcasestr, const char *,
676                   (const char *haystack, const char *needle));
677# else
678_GL_CXXALIASWARN (strcasestr);
679# endif
680#elif defined GNULIB_POSIXCHECK
681/* strcasestr() does not work with multibyte strings:
682   It is a glibc extension, and glibc implements it only for unibyte
683   locales.  */
684# undef strcasestr
685# if HAVE_RAW_DECL_STRCASESTR
686_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
687                 "strings in multibyte locales - "
688                 "use mbscasestr if you care about "
689                 "internationalization, or use c-strcasestr if you want "
690                 "a locale independent function");
691# endif
692#endif
693
694/* Parse S into tokens separated by characters in DELIM.
695   If S is NULL, the saved pointer in SAVE_PTR is used as
696   the next starting point.  For example:
697        char s[] = "-abc-=-def";
698        char *sp;
699        x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
700        x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
701        x = strtok_r(NULL, "=", &sp);   // x = NULL
702                // s = "abc\0-def\0"
703
704   This is a variant of strtok() that is multithread-safe.
705
706   For the POSIX documentation for this function, see:
707   https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html
708
709   Caveat: It modifies the original string.
710   Caveat: These functions cannot be used on constant strings.
711   Caveat: The identity of the delimiting character is lost.
712   Caveat: It doesn't work with multibyte strings unless all of the delimiter
713           characters are ASCII characters < 0x30.
714
715   See also strsep().  */
716#if @GNULIB_STRTOK_R@
717# if @REPLACE_STRTOK_R@
718#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
719#   undef strtok_r
720#   define strtok_r rpl_strtok_r
721#  endif
722_GL_FUNCDECL_RPL (strtok_r, char *,
723                  (char *restrict s, char const *restrict delim,
724                   char **restrict save_ptr)
725                  _GL_ARG_NONNULL ((2, 3)));
726_GL_CXXALIAS_RPL (strtok_r, char *,
727                  (char *restrict s, char const *restrict delim,
728                   char **restrict save_ptr));
729# else
730#  if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
731#   undef strtok_r
732#  endif
733#  if ! @HAVE_DECL_STRTOK_R@
734_GL_FUNCDECL_SYS (strtok_r, char *,
735                  (char *restrict s, char const *restrict delim,
736                   char **restrict save_ptr)
737                  _GL_ARG_NONNULL ((2, 3)));
738#  endif
739_GL_CXXALIAS_SYS (strtok_r, char *,
740                  (char *restrict s, char const *restrict delim,
741                   char **restrict save_ptr));
742# endif
743_GL_CXXALIASWARN (strtok_r);
744# if defined GNULIB_POSIXCHECK
745_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
746                 "strings in multibyte locales - "
747                 "use mbstok_r if you care about internationalization");
748# endif
749#elif defined GNULIB_POSIXCHECK
750# undef strtok_r
751# if HAVE_RAW_DECL_STRTOK_R
752_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
753                 "use gnulib module strtok_r for portability");
754# endif
755#endif
756
757
758/* The following functions are not specified by POSIX.  They are gnulib
759   extensions.  */
760
761#if @GNULIB_MBSLEN@
762/* Return the number of multibyte characters in the character string STRING.
763   This considers multibyte characters, unlike strlen, which counts bytes.  */
764# ifdef __MirBSD__  /* MirBSD defines mbslen as a macro.  Override it.  */
765#  undef mbslen
766# endif
767# if @HAVE_MBSLEN@  /* AIX, OSF/1, MirBSD define mbslen already in libc.  */
768#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
769#   define mbslen rpl_mbslen
770#  endif
771_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
772                                  _GL_ATTRIBUTE_PURE
773                                  _GL_ARG_NONNULL ((1)));
774_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
775# else
776_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
777                                  _GL_ATTRIBUTE_PURE
778                                  _GL_ARG_NONNULL ((1)));
779_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
780# endif
781_GL_CXXALIASWARN (mbslen);
782#endif
783
784#if @GNULIB_MBSNLEN@
785/* Return the number of multibyte characters in the character string starting
786   at STRING and ending at STRING + LEN.  */
787_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
788     _GL_ATTRIBUTE_PURE
789     _GL_ARG_NONNULL ((1));
790#endif
791
792#if @GNULIB_MBSCHR@
793/* Locate the first single-byte character C in the character string STRING,
794   and return a pointer to it.  Return NULL if C is not found in STRING.
795   Unlike strchr(), this function works correctly in multibyte locales with
796   encodings such as GB18030.  */
797# if defined __hpux
798#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
799#   define mbschr rpl_mbschr /* avoid collision with HP-UX function */
800#  endif
801_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
802                                  _GL_ATTRIBUTE_PURE
803                                  _GL_ARG_NONNULL ((1)));
804_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
805# else
806_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
807                                  _GL_ATTRIBUTE_PURE
808                                  _GL_ARG_NONNULL ((1)));
809_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
810# endif
811_GL_CXXALIASWARN (mbschr);
812#endif
813
814#if @GNULIB_MBSRCHR@
815/* Locate the last single-byte character C in the character string STRING,
816   and return a pointer to it.  Return NULL if C is not found in STRING.
817   Unlike strrchr(), this function works correctly in multibyte locales with
818   encodings such as GB18030.  */
819# if defined __hpux || defined __INTERIX
820#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
821#   define mbsrchr rpl_mbsrchr /* avoid collision with system function */
822#  endif
823_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
824                                   _GL_ATTRIBUTE_PURE
825                                   _GL_ARG_NONNULL ((1)));
826_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
827# else
828_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
829                                   _GL_ATTRIBUTE_PURE
830                                   _GL_ARG_NONNULL ((1)));
831_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
832# endif
833_GL_CXXALIASWARN (mbsrchr);
834#endif
835
836#if @GNULIB_MBSSTR@
837/* Find the first occurrence of the character string NEEDLE in the character
838   string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
839   Unlike strstr(), this function works correctly in multibyte locales with
840   encodings different from UTF-8.  */
841_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
842     _GL_ATTRIBUTE_PURE
843     _GL_ARG_NONNULL ((1, 2));
844#endif
845
846#if @GNULIB_MBSCASECMP@
847/* Compare the character strings S1 and S2, ignoring case, returning less than,
848   equal to or greater than zero if S1 is lexicographically less than, equal to
849   or greater than S2.
850   Note: This function may, in multibyte locales, return 0 for strings of
851   different lengths!
852   Unlike strcasecmp(), this function works correctly in multibyte locales.  */
853_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
854     _GL_ATTRIBUTE_PURE
855     _GL_ARG_NONNULL ((1, 2));
856#endif
857
858#if @GNULIB_MBSNCASECMP@
859/* Compare the initial segment of the character string S1 consisting of at most
860   N characters with the initial segment of the character string S2 consisting
861   of at most N characters, ignoring case, returning less than, equal to or
862   greater than zero if the initial segment of S1 is lexicographically less
863   than, equal to or greater than the initial segment of S2.
864   Note: This function may, in multibyte locales, return 0 for initial segments
865   of different lengths!
866   Unlike strncasecmp(), this function works correctly in multibyte locales.
867   But beware that N is not a byte count but a character count!  */
868_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
869     _GL_ATTRIBUTE_PURE
870     _GL_ARG_NONNULL ((1, 2));
871#endif
872
873#if @GNULIB_MBSPCASECMP@
874/* Compare the initial segment of the character string STRING consisting of
875   at most mbslen (PREFIX) characters with the character string PREFIX,
876   ignoring case.  If the two match, return a pointer to the first byte
877   after this prefix in STRING.  Otherwise, return NULL.
878   Note: This function may, in multibyte locales, return non-NULL if STRING
879   is of smaller length than PREFIX!
880   Unlike strncasecmp(), this function works correctly in multibyte
881   locales.  */
882_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
883     _GL_ATTRIBUTE_PURE
884     _GL_ARG_NONNULL ((1, 2));
885#endif
886
887#if @GNULIB_MBSCASESTR@
888/* Find the first occurrence of the character string NEEDLE in the character
889   string HAYSTACK, using case-insensitive comparison.
890   Note: This function may, in multibyte locales, return success even if
891   strlen (haystack) < strlen (needle) !
892   Unlike strcasestr(), this function works correctly in multibyte locales.  */
893_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
894     _GL_ATTRIBUTE_PURE
895     _GL_ARG_NONNULL ((1, 2));
896#endif
897
898#if @GNULIB_MBSCSPN@
899/* Find the first occurrence in the character string STRING of any character
900   in the character string ACCEPT.  Return the number of bytes from the
901   beginning of the string to this occurrence, or to the end of the string
902   if none exists.
903   Unlike strcspn(), this function works correctly in multibyte locales.  */
904_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
905     _GL_ATTRIBUTE_PURE
906     _GL_ARG_NONNULL ((1, 2));
907#endif
908
909#if @GNULIB_MBSPBRK@
910/* Find the first occurrence in the character string STRING of any character
911   in the character string ACCEPT.  Return the pointer to it, or NULL if none
912   exists.
913   Unlike strpbrk(), this function works correctly in multibyte locales.  */
914# if defined __hpux
915#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
916#   define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
917#  endif
918_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
919                                   _GL_ATTRIBUTE_PURE
920                                   _GL_ARG_NONNULL ((1, 2)));
921_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
922# else
923_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
924                                   _GL_ATTRIBUTE_PURE
925                                   _GL_ARG_NONNULL ((1, 2)));
926_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
927# endif
928_GL_CXXALIASWARN (mbspbrk);
929#endif
930
931#if @GNULIB_MBSSPN@
932/* Find the first occurrence in the character string STRING of any character
933   not in the character string REJECT.  Return the number of bytes from the
934   beginning of the string to this occurrence, or to the end of the string
935   if none exists.
936   Unlike strspn(), this function works correctly in multibyte locales.  */
937_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
938     _GL_ATTRIBUTE_PURE
939     _GL_ARG_NONNULL ((1, 2));
940#endif
941
942#if @GNULIB_MBSSEP@
943/* Search the next delimiter (multibyte character listed in the character
944   string DELIM) starting at the character string *STRINGP.
945   If one is found, overwrite it with a NUL, and advance *STRINGP to point
946   to the next multibyte character after it.  Otherwise, set *STRINGP to NULL.
947   If *STRINGP was already NULL, nothing happens.
948   Return the old value of *STRINGP.
949
950   This is a variant of mbstok_r() that supports empty fields.
951
952   Caveat: It modifies the original string.
953   Caveat: These functions cannot be used on constant strings.
954   Caveat: The identity of the delimiting character is lost.
955
956   See also mbstok_r().  */
957_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
958     _GL_ARG_NONNULL ((1, 2));
959#endif
960
961#if @GNULIB_MBSTOK_R@
962/* Parse the character string STRING into tokens separated by characters in
963   the character string DELIM.
964   If STRING is NULL, the saved pointer in SAVE_PTR is used as
965   the next starting point.  For example:
966        char s[] = "-abc-=-def";
967        char *sp;
968        x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
969        x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
970        x = mbstok_r(NULL, "=", &sp);   // x = NULL
971                // s = "abc\0-def\0"
972
973   Caveat: It modifies the original string.
974   Caveat: These functions cannot be used on constant strings.
975   Caveat: The identity of the delimiting character is lost.
976
977   See also mbssep().  */
978_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
979                              char **save_ptr)
980     _GL_ARG_NONNULL ((2, 3));
981#endif
982
983/* Map any int, typically from errno, into an error message.  */
984#if @GNULIB_STRERROR@
985# if @REPLACE_STRERROR@
986#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
987#   undef strerror
988#   define strerror rpl_strerror
989#  endif
990_GL_FUNCDECL_RPL (strerror, char *, (int));
991_GL_CXXALIAS_RPL (strerror, char *, (int));
992# else
993_GL_CXXALIAS_SYS (strerror, char *, (int));
994# endif
995# if __GLIBC__ >= 2
996_GL_CXXALIASWARN (strerror);
997# endif
998#elif defined GNULIB_POSIXCHECK
999# undef strerror
1000/* Assume strerror is always declared.  */
1001_GL_WARN_ON_USE (strerror, "strerror is unportable - "
1002                 "use gnulib module strerror to guarantee non-NULL result");
1003#endif
1004
1005/* Map any int, typically from errno, into an error message.  Multithread-safe.
1006   Uses the POSIX declaration, not the glibc declaration.  */
1007#if @GNULIB_STRERROR_R@
1008# if @REPLACE_STRERROR_R@
1009#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1010#   undef strerror_r
1011#   define strerror_r rpl_strerror_r
1012#  endif
1013_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
1014                                   _GL_ARG_NONNULL ((2)));
1015_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
1016# else
1017#  if !@HAVE_DECL_STRERROR_R@
1018_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
1019                                   _GL_ARG_NONNULL ((2)));
1020#  endif
1021_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
1022# endif
1023# if @HAVE_DECL_STRERROR_R@
1024_GL_CXXALIASWARN (strerror_r);
1025# endif
1026#elif defined GNULIB_POSIXCHECK
1027# undef strerror_r
1028# if HAVE_RAW_DECL_STRERROR_R
1029_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
1030                 "use gnulib module strerror_r-posix for portability");
1031# endif
1032#endif
1033
1034#if @GNULIB_STRSIGNAL@
1035# if @REPLACE_STRSIGNAL@
1036#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1037#   define strsignal rpl_strsignal
1038#  endif
1039_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
1040_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
1041# else
1042#  if ! @HAVE_DECL_STRSIGNAL@
1043_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
1044#  endif
1045/* Need to cast, because on Cygwin 1.5.x systems, the return type is
1046   'const char *'.  */
1047_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
1048# endif
1049_GL_CXXALIASWARN (strsignal);
1050#elif defined GNULIB_POSIXCHECK
1051# undef strsignal
1052# if HAVE_RAW_DECL_STRSIGNAL
1053_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
1054                 "use gnulib module strsignal for portability");
1055# endif
1056#endif
1057
1058#if @GNULIB_STRVERSCMP@
1059# if !@HAVE_STRVERSCMP@
1060_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
1061                                   _GL_ATTRIBUTE_PURE
1062                                   _GL_ARG_NONNULL ((1, 2)));
1063# endif
1064_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
1065_GL_CXXALIASWARN (strverscmp);
1066#elif defined GNULIB_POSIXCHECK
1067# undef strverscmp
1068# if HAVE_RAW_DECL_STRVERSCMP
1069_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
1070                 "use gnulib module strverscmp for portability");
1071# endif
1072#endif
1073
1074
1075#endif /* _@GUARD_PREFIX@_STRING_H */
1076#endif /* _@GUARD_PREFIX@_STRING_H */
1077#endif
1078