string.in.h 38 KB

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