wchar.in.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
  2. Copyright (C) 2007-2014 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 Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, 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 Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  13. /* Written by Eric Blake. */
  14. /*
  15. * ISO C 99 <wchar.h> for platforms that have issues.
  16. * <http://www.opengroup.org/susv3xbd/wchar.h.html>
  17. *
  18. * For now, this just ensures proper prerequisite inclusion order and
  19. * the declaration of wcwidth().
  20. */
  21. #if __GNUC__ >= 3
  22. @PRAGMA_SYSTEM_HEADER@
  23. #endif
  24. @PRAGMA_COLUMNS@
  25. #if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
  26. /* Special invocation convention:
  27. - Inside glibc and uClibc header files.
  28. - On HP-UX 11.00 we have a sequence of nested includes
  29. <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
  30. once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
  31. and once directly. In both situations 'wint_t' is not yet defined,
  32. therefore we cannot provide the function overrides; instead include only
  33. the system's <wchar.h>.
  34. - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
  35. the latter includes <wchar.h>. But here, we have no way to detect whether
  36. <wctype.h> is completely included or is still being included. */
  37. #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
  38. #else
  39. /* Normal invocation convention. */
  40. #ifndef _@GUARD_PREFIX@_WCHAR_H
  41. #define _GL_ALREADY_INCLUDING_WCHAR_H
  42. #if @HAVE_FEATURES_H@
  43. # include <features.h> /* for __GLIBC__ */
  44. #endif
  45. /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
  46. <wchar.h>.
  47. BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
  48. included before <wchar.h>.
  49. In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
  50. by <stddef.h>.
  51. But avoid namespace pollution on glibc systems. */
  52. #if !(defined __GLIBC__ && !defined __UCLIBC__)
  53. # include <stddef.h>
  54. #endif
  55. #ifndef __GLIBC__
  56. # include <stdio.h>
  57. # include <time.h>
  58. #endif
  59. /* Include the original <wchar.h> if it exists.
  60. Some builds of uClibc lack it. */
  61. /* The include_next requires a split double-inclusion guard. */
  62. #if @HAVE_WCHAR_H@
  63. # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
  64. #endif
  65. #undef _GL_ALREADY_INCLUDING_WCHAR_H
  66. #ifndef _@GUARD_PREFIX@_WCHAR_H
  67. #define _@GUARD_PREFIX@_WCHAR_H
  68. /* The __attribute__ feature is available in gcc versions 2.5 and later.
  69. The attribute __pure__ was added in gcc 2.96. */
  70. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
  71. # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
  72. #else
  73. # define _GL_ATTRIBUTE_PURE /* empty */
  74. #endif
  75. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  76. /* The definition of _GL_ARG_NONNULL is copied here. */
  77. /* The definition of _GL_WARN_ON_USE is copied here. */
  78. /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
  79. #if !@HAVE_WINT_T@ && !defined wint_t
  80. # define wint_t int
  81. # ifndef WEOF
  82. # define WEOF -1
  83. # endif
  84. #else
  85. /* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
  86. This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
  87. "unchanged by default argument promotions". Override it. */
  88. # if defined _MSC_VER
  89. # if !GNULIB_defined_wint_t
  90. # include <crtdefs.h>
  91. typedef unsigned int rpl_wint_t;
  92. # undef wint_t
  93. # define wint_t rpl_wint_t
  94. # define GNULIB_defined_wint_t 1
  95. # endif
  96. # endif
  97. # ifndef WEOF
  98. # define WEOF ((wint_t) -1)
  99. # endif
  100. #endif
  101. /* Override mbstate_t if it is too small.
  102. On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
  103. implementing mbrtowc for encodings like UTF-8. */
  104. #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
  105. # if !GNULIB_defined_mbstate_t
  106. typedef int rpl_mbstate_t;
  107. # undef mbstate_t
  108. # define mbstate_t rpl_mbstate_t
  109. # define GNULIB_defined_mbstate_t 1
  110. # endif
  111. #endif
  112. /* Convert a single-byte character to a wide character. */
  113. #if @GNULIB_BTOWC@
  114. # if @REPLACE_BTOWC@
  115. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  116. # undef btowc
  117. # define btowc rpl_btowc
  118. # endif
  119. _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
  120. _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
  121. # else
  122. # if !@HAVE_BTOWC@
  123. _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
  124. # endif
  125. _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
  126. # endif
  127. _GL_CXXALIASWARN (btowc);
  128. #elif defined GNULIB_POSIXCHECK
  129. # undef btowc
  130. # if HAVE_RAW_DECL_BTOWC
  131. _GL_WARN_ON_USE (btowc, "btowc is unportable - "
  132. "use gnulib module btowc for portability");
  133. # endif
  134. #endif
  135. /* Convert a wide character to a single-byte character. */
  136. #if @GNULIB_WCTOB@
  137. # if @REPLACE_WCTOB@
  138. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  139. # undef wctob
  140. # define wctob rpl_wctob
  141. # endif
  142. _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
  143. _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
  144. # else
  145. # if !defined wctob && !@HAVE_DECL_WCTOB@
  146. /* wctob is provided by gnulib, or wctob exists but is not declared. */
  147. _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
  148. # endif
  149. _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
  150. # endif
  151. _GL_CXXALIASWARN (wctob);
  152. #elif defined GNULIB_POSIXCHECK
  153. # undef wctob
  154. # if HAVE_RAW_DECL_WCTOB
  155. _GL_WARN_ON_USE (wctob, "wctob is unportable - "
  156. "use gnulib module wctob for portability");
  157. # endif
  158. #endif
  159. /* Test whether *PS is in the initial state. */
  160. #if @GNULIB_MBSINIT@
  161. # if @REPLACE_MBSINIT@
  162. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  163. # undef mbsinit
  164. # define mbsinit rpl_mbsinit
  165. # endif
  166. _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
  167. _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
  168. # else
  169. # if !@HAVE_MBSINIT@
  170. _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
  171. # endif
  172. _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
  173. # endif
  174. _GL_CXXALIASWARN (mbsinit);
  175. #elif defined GNULIB_POSIXCHECK
  176. # undef mbsinit
  177. # if HAVE_RAW_DECL_MBSINIT
  178. _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
  179. "use gnulib module mbsinit for portability");
  180. # endif
  181. #endif
  182. /* Convert a multibyte character to a wide character. */
  183. #if @GNULIB_MBRTOWC@
  184. # if @REPLACE_MBRTOWC@
  185. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  186. # undef mbrtowc
  187. # define mbrtowc rpl_mbrtowc
  188. # endif
  189. _GL_FUNCDECL_RPL (mbrtowc, size_t,
  190. (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
  191. _GL_CXXALIAS_RPL (mbrtowc, size_t,
  192. (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
  193. # else
  194. # if !@HAVE_MBRTOWC@
  195. _GL_FUNCDECL_SYS (mbrtowc, size_t,
  196. (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
  197. # endif
  198. _GL_CXXALIAS_SYS (mbrtowc, size_t,
  199. (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
  200. # endif
  201. _GL_CXXALIASWARN (mbrtowc);
  202. #elif defined GNULIB_POSIXCHECK
  203. # undef mbrtowc
  204. # if HAVE_RAW_DECL_MBRTOWC
  205. _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
  206. "use gnulib module mbrtowc for portability");
  207. # endif
  208. #endif
  209. /* Recognize a multibyte character. */
  210. #if @GNULIB_MBRLEN@
  211. # if @REPLACE_MBRLEN@
  212. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  213. # undef mbrlen
  214. # define mbrlen rpl_mbrlen
  215. # endif
  216. _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
  217. _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
  218. # else
  219. # if !@HAVE_MBRLEN@
  220. _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
  221. # endif
  222. _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
  223. # endif
  224. _GL_CXXALIASWARN (mbrlen);
  225. #elif defined GNULIB_POSIXCHECK
  226. # undef mbrlen
  227. # if HAVE_RAW_DECL_MBRLEN
  228. _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
  229. "use gnulib module mbrlen for portability");
  230. # endif
  231. #endif
  232. /* Convert a string to a wide string. */
  233. #if @GNULIB_MBSRTOWCS@
  234. # if @REPLACE_MBSRTOWCS@
  235. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  236. # undef mbsrtowcs
  237. # define mbsrtowcs rpl_mbsrtowcs
  238. # endif
  239. _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
  240. (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
  241. _GL_ARG_NONNULL ((2)));
  242. _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
  243. (wchar_t *dest, const char **srcp, size_t len,
  244. mbstate_t *ps));
  245. # else
  246. # if !@HAVE_MBSRTOWCS@
  247. _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
  248. (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
  249. _GL_ARG_NONNULL ((2)));
  250. # endif
  251. _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
  252. (wchar_t *dest, const char **srcp, size_t len,
  253. mbstate_t *ps));
  254. # endif
  255. _GL_CXXALIASWARN (mbsrtowcs);
  256. #elif defined GNULIB_POSIXCHECK
  257. # undef mbsrtowcs
  258. # if HAVE_RAW_DECL_MBSRTOWCS
  259. _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
  260. "use gnulib module mbsrtowcs for portability");
  261. # endif
  262. #endif
  263. /* Convert a string to a wide string. */
  264. #if @GNULIB_MBSNRTOWCS@
  265. # if @REPLACE_MBSNRTOWCS@
  266. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  267. # undef mbsnrtowcs
  268. # define mbsnrtowcs rpl_mbsnrtowcs
  269. # endif
  270. _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
  271. (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
  272. mbstate_t *ps)
  273. _GL_ARG_NONNULL ((2)));
  274. _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
  275. (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
  276. mbstate_t *ps));
  277. # else
  278. # if !@HAVE_MBSNRTOWCS@
  279. _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
  280. (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
  281. mbstate_t *ps)
  282. _GL_ARG_NONNULL ((2)));
  283. # endif
  284. _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
  285. (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
  286. mbstate_t *ps));
  287. # endif
  288. _GL_CXXALIASWARN (mbsnrtowcs);
  289. #elif defined GNULIB_POSIXCHECK
  290. # undef mbsnrtowcs
  291. # if HAVE_RAW_DECL_MBSNRTOWCS
  292. _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
  293. "use gnulib module mbsnrtowcs for portability");
  294. # endif
  295. #endif
  296. /* Convert a wide character to a multibyte character. */
  297. #if @GNULIB_WCRTOMB@
  298. # if @REPLACE_WCRTOMB@
  299. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  300. # undef wcrtomb
  301. # define wcrtomb rpl_wcrtomb
  302. # endif
  303. _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
  304. _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
  305. # else
  306. # if !@HAVE_WCRTOMB@
  307. _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
  308. # endif
  309. _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
  310. # endif
  311. _GL_CXXALIASWARN (wcrtomb);
  312. #elif defined GNULIB_POSIXCHECK
  313. # undef wcrtomb
  314. # if HAVE_RAW_DECL_WCRTOMB
  315. _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
  316. "use gnulib module wcrtomb for portability");
  317. # endif
  318. #endif
  319. /* Convert a wide string to a string. */
  320. #if @GNULIB_WCSRTOMBS@
  321. # if @REPLACE_WCSRTOMBS@
  322. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  323. # undef wcsrtombs
  324. # define wcsrtombs rpl_wcsrtombs
  325. # endif
  326. _GL_FUNCDECL_RPL (wcsrtombs, size_t,
  327. (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
  328. _GL_ARG_NONNULL ((2)));
  329. _GL_CXXALIAS_RPL (wcsrtombs, size_t,
  330. (char *dest, const wchar_t **srcp, size_t len,
  331. mbstate_t *ps));
  332. # else
  333. # if !@HAVE_WCSRTOMBS@
  334. _GL_FUNCDECL_SYS (wcsrtombs, size_t,
  335. (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
  336. _GL_ARG_NONNULL ((2)));
  337. # endif
  338. _GL_CXXALIAS_SYS (wcsrtombs, size_t,
  339. (char *dest, const wchar_t **srcp, size_t len,
  340. mbstate_t *ps));
  341. # endif
  342. _GL_CXXALIASWARN (wcsrtombs);
  343. #elif defined GNULIB_POSIXCHECK
  344. # undef wcsrtombs
  345. # if HAVE_RAW_DECL_WCSRTOMBS
  346. _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
  347. "use gnulib module wcsrtombs for portability");
  348. # endif
  349. #endif
  350. /* Convert a wide string to a string. */
  351. #if @GNULIB_WCSNRTOMBS@
  352. # if @REPLACE_WCSNRTOMBS@
  353. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  354. # undef wcsnrtombs
  355. # define wcsnrtombs rpl_wcsnrtombs
  356. # endif
  357. _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
  358. (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
  359. mbstate_t *ps)
  360. _GL_ARG_NONNULL ((2)));
  361. _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
  362. (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
  363. mbstate_t *ps));
  364. # else
  365. # if !@HAVE_WCSNRTOMBS@
  366. _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
  367. (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
  368. mbstate_t *ps)
  369. _GL_ARG_NONNULL ((2)));
  370. # endif
  371. _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
  372. (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
  373. mbstate_t *ps));
  374. # endif
  375. _GL_CXXALIASWARN (wcsnrtombs);
  376. #elif defined GNULIB_POSIXCHECK
  377. # undef wcsnrtombs
  378. # if HAVE_RAW_DECL_WCSNRTOMBS
  379. _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
  380. "use gnulib module wcsnrtombs for portability");
  381. # endif
  382. #endif
  383. /* Return the number of screen columns needed for WC. */
  384. #if @GNULIB_WCWIDTH@
  385. # if @REPLACE_WCWIDTH@
  386. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  387. # undef wcwidth
  388. # define wcwidth rpl_wcwidth
  389. # endif
  390. _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
  391. _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
  392. # else
  393. # if !@HAVE_DECL_WCWIDTH@
  394. /* wcwidth exists but is not declared. */
  395. _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
  396. # endif
  397. _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
  398. # endif
  399. _GL_CXXALIASWARN (wcwidth);
  400. #elif defined GNULIB_POSIXCHECK
  401. # undef wcwidth
  402. # if HAVE_RAW_DECL_WCWIDTH
  403. _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
  404. "use gnulib module wcwidth for portability");
  405. # endif
  406. #endif
  407. /* Search N wide characters of S for C. */
  408. #if @GNULIB_WMEMCHR@
  409. # if !@HAVE_WMEMCHR@
  410. _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
  411. _GL_ATTRIBUTE_PURE);
  412. # endif
  413. /* On some systems, this function is defined as an overloaded function:
  414. extern "C++" {
  415. const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
  416. wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
  417. } */
  418. _GL_CXXALIAS_SYS_CAST2 (wmemchr,
  419. wchar_t *, (const wchar_t *, wchar_t, size_t),
  420. const wchar_t *, (const wchar_t *, wchar_t, size_t));
  421. # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
  422. && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  423. _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
  424. _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
  425. (const wchar_t *s, wchar_t c, size_t n));
  426. # else
  427. _GL_CXXALIASWARN (wmemchr);
  428. # endif
  429. #elif defined GNULIB_POSIXCHECK
  430. # undef wmemchr
  431. # if HAVE_RAW_DECL_WMEMCHR
  432. _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
  433. "use gnulib module wmemchr for portability");
  434. # endif
  435. #endif
  436. /* Compare N wide characters of S1 and S2. */
  437. #if @GNULIB_WMEMCMP@
  438. # if !@HAVE_WMEMCMP@
  439. _GL_FUNCDECL_SYS (wmemcmp, int,
  440. (const wchar_t *s1, const wchar_t *s2, size_t n)
  441. _GL_ATTRIBUTE_PURE);
  442. # endif
  443. _GL_CXXALIAS_SYS (wmemcmp, int,
  444. (const wchar_t *s1, const wchar_t *s2, size_t n));
  445. _GL_CXXALIASWARN (wmemcmp);
  446. #elif defined GNULIB_POSIXCHECK
  447. # undef wmemcmp
  448. # if HAVE_RAW_DECL_WMEMCMP
  449. _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
  450. "use gnulib module wmemcmp for portability");
  451. # endif
  452. #endif
  453. /* Copy N wide characters of SRC to DEST. */
  454. #if @GNULIB_WMEMCPY@
  455. # if !@HAVE_WMEMCPY@
  456. _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
  457. (wchar_t *dest, const wchar_t *src, size_t n));
  458. # endif
  459. _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
  460. (wchar_t *dest, const wchar_t *src, size_t n));
  461. _GL_CXXALIASWARN (wmemcpy);
  462. #elif defined GNULIB_POSIXCHECK
  463. # undef wmemcpy
  464. # if HAVE_RAW_DECL_WMEMCPY
  465. _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
  466. "use gnulib module wmemcpy for portability");
  467. # endif
  468. #endif
  469. /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
  470. overlapping memory areas. */
  471. #if @GNULIB_WMEMMOVE@
  472. # if !@HAVE_WMEMMOVE@
  473. _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
  474. (wchar_t *dest, const wchar_t *src, size_t n));
  475. # endif
  476. _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
  477. (wchar_t *dest, const wchar_t *src, size_t n));
  478. _GL_CXXALIASWARN (wmemmove);
  479. #elif defined GNULIB_POSIXCHECK
  480. # undef wmemmove
  481. # if HAVE_RAW_DECL_WMEMMOVE
  482. _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
  483. "use gnulib module wmemmove for portability");
  484. # endif
  485. #endif
  486. /* Set N wide characters of S to C. */
  487. #if @GNULIB_WMEMSET@
  488. # if !@HAVE_WMEMSET@
  489. _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
  490. # endif
  491. _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
  492. _GL_CXXALIASWARN (wmemset);
  493. #elif defined GNULIB_POSIXCHECK
  494. # undef wmemset
  495. # if HAVE_RAW_DECL_WMEMSET
  496. _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
  497. "use gnulib module wmemset for portability");
  498. # endif
  499. #endif
  500. /* Return the number of wide characters in S. */
  501. #if @GNULIB_WCSLEN@
  502. # if !@HAVE_WCSLEN@
  503. _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
  504. # endif
  505. _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
  506. _GL_CXXALIASWARN (wcslen);
  507. #elif defined GNULIB_POSIXCHECK
  508. # undef wcslen
  509. # if HAVE_RAW_DECL_WCSLEN
  510. _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
  511. "use gnulib module wcslen for portability");
  512. # endif
  513. #endif
  514. /* Return the number of wide characters in S, but at most MAXLEN. */
  515. #if @GNULIB_WCSNLEN@
  516. # if !@HAVE_WCSNLEN@
  517. _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
  518. _GL_ATTRIBUTE_PURE);
  519. # endif
  520. _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
  521. _GL_CXXALIASWARN (wcsnlen);
  522. #elif defined GNULIB_POSIXCHECK
  523. # undef wcsnlen
  524. # if HAVE_RAW_DECL_WCSNLEN
  525. _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
  526. "use gnulib module wcsnlen for portability");
  527. # endif
  528. #endif
  529. /* Copy SRC to DEST. */
  530. #if @GNULIB_WCSCPY@
  531. # if !@HAVE_WCSCPY@
  532. _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
  533. # endif
  534. _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
  535. _GL_CXXALIASWARN (wcscpy);
  536. #elif defined GNULIB_POSIXCHECK
  537. # undef wcscpy
  538. # if HAVE_RAW_DECL_WCSCPY
  539. _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
  540. "use gnulib module wcscpy for portability");
  541. # endif
  542. #endif
  543. /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
  544. #if @GNULIB_WCPCPY@
  545. # if !@HAVE_WCPCPY@
  546. _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
  547. # endif
  548. _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
  549. _GL_CXXALIASWARN (wcpcpy);
  550. #elif defined GNULIB_POSIXCHECK
  551. # undef wcpcpy
  552. # if HAVE_RAW_DECL_WCPCPY
  553. _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
  554. "use gnulib module wcpcpy for portability");
  555. # endif
  556. #endif
  557. /* Copy no more than N wide characters of SRC to DEST. */
  558. #if @GNULIB_WCSNCPY@
  559. # if !@HAVE_WCSNCPY@
  560. _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
  561. (wchar_t *dest, const wchar_t *src, size_t n));
  562. # endif
  563. _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
  564. (wchar_t *dest, const wchar_t *src, size_t n));
  565. _GL_CXXALIASWARN (wcsncpy);
  566. #elif defined GNULIB_POSIXCHECK
  567. # undef wcsncpy
  568. # if HAVE_RAW_DECL_WCSNCPY
  569. _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
  570. "use gnulib module wcsncpy for portability");
  571. # endif
  572. #endif
  573. /* Copy no more than N characters of SRC to DEST, returning the address of
  574. the last character written into DEST. */
  575. #if @GNULIB_WCPNCPY@
  576. # if !@HAVE_WCPNCPY@
  577. _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
  578. (wchar_t *dest, const wchar_t *src, size_t n));
  579. # endif
  580. _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
  581. (wchar_t *dest, const wchar_t *src, size_t n));
  582. _GL_CXXALIASWARN (wcpncpy);
  583. #elif defined GNULIB_POSIXCHECK
  584. # undef wcpncpy
  585. # if HAVE_RAW_DECL_WCPNCPY
  586. _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
  587. "use gnulib module wcpncpy for portability");
  588. # endif
  589. #endif
  590. /* Append SRC onto DEST. */
  591. #if @GNULIB_WCSCAT@
  592. # if !@HAVE_WCSCAT@
  593. _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
  594. # endif
  595. _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
  596. _GL_CXXALIASWARN (wcscat);
  597. #elif defined GNULIB_POSIXCHECK
  598. # undef wcscat
  599. # if HAVE_RAW_DECL_WCSCAT
  600. _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
  601. "use gnulib module wcscat for portability");
  602. # endif
  603. #endif
  604. /* Append no more than N wide characters of SRC onto DEST. */
  605. #if @GNULIB_WCSNCAT@
  606. # if !@HAVE_WCSNCAT@
  607. _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
  608. (wchar_t *dest, const wchar_t *src, size_t n));
  609. # endif
  610. _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
  611. (wchar_t *dest, const wchar_t *src, size_t n));
  612. _GL_CXXALIASWARN (wcsncat);
  613. #elif defined GNULIB_POSIXCHECK
  614. # undef wcsncat
  615. # if HAVE_RAW_DECL_WCSNCAT
  616. _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
  617. "use gnulib module wcsncat for portability");
  618. # endif
  619. #endif
  620. /* Compare S1 and S2. */
  621. #if @GNULIB_WCSCMP@
  622. # if !@HAVE_WCSCMP@
  623. _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
  624. _GL_ATTRIBUTE_PURE);
  625. # endif
  626. _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
  627. _GL_CXXALIASWARN (wcscmp);
  628. #elif defined GNULIB_POSIXCHECK
  629. # undef wcscmp
  630. # if HAVE_RAW_DECL_WCSCMP
  631. _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
  632. "use gnulib module wcscmp for portability");
  633. # endif
  634. #endif
  635. /* Compare no more than N wide characters of S1 and S2. */
  636. #if @GNULIB_WCSNCMP@
  637. # if !@HAVE_WCSNCMP@
  638. _GL_FUNCDECL_SYS (wcsncmp, int,
  639. (const wchar_t *s1, const wchar_t *s2, size_t n)
  640. _GL_ATTRIBUTE_PURE);
  641. # endif
  642. _GL_CXXALIAS_SYS (wcsncmp, int,
  643. (const wchar_t *s1, const wchar_t *s2, size_t n));
  644. _GL_CXXALIASWARN (wcsncmp);
  645. #elif defined GNULIB_POSIXCHECK
  646. # undef wcsncmp
  647. # if HAVE_RAW_DECL_WCSNCMP
  648. _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
  649. "use gnulib module wcsncmp for portability");
  650. # endif
  651. #endif
  652. /* Compare S1 and S2, ignoring case. */
  653. #if @GNULIB_WCSCASECMP@
  654. # if !@HAVE_WCSCASECMP@
  655. _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
  656. _GL_ATTRIBUTE_PURE);
  657. # endif
  658. _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
  659. _GL_CXXALIASWARN (wcscasecmp);
  660. #elif defined GNULIB_POSIXCHECK
  661. # undef wcscasecmp
  662. # if HAVE_RAW_DECL_WCSCASECMP
  663. _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
  664. "use gnulib module wcscasecmp for portability");
  665. # endif
  666. #endif
  667. /* Compare no more than N chars of S1 and S2, ignoring case. */
  668. #if @GNULIB_WCSNCASECMP@
  669. # if !@HAVE_WCSNCASECMP@
  670. _GL_FUNCDECL_SYS (wcsncasecmp, int,
  671. (const wchar_t *s1, const wchar_t *s2, size_t n)
  672. _GL_ATTRIBUTE_PURE);
  673. # endif
  674. _GL_CXXALIAS_SYS (wcsncasecmp, int,
  675. (const wchar_t *s1, const wchar_t *s2, size_t n));
  676. _GL_CXXALIASWARN (wcsncasecmp);
  677. #elif defined GNULIB_POSIXCHECK
  678. # undef wcsncasecmp
  679. # if HAVE_RAW_DECL_WCSNCASECMP
  680. _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
  681. "use gnulib module wcsncasecmp for portability");
  682. # endif
  683. #endif
  684. /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
  685. category of the current locale. */
  686. #if @GNULIB_WCSCOLL@
  687. # if !@HAVE_WCSCOLL@
  688. _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
  689. # endif
  690. _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
  691. _GL_CXXALIASWARN (wcscoll);
  692. #elif defined GNULIB_POSIXCHECK
  693. # undef wcscoll
  694. # if HAVE_RAW_DECL_WCSCOLL
  695. _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
  696. "use gnulib module wcscoll for portability");
  697. # endif
  698. #endif
  699. /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
  700. to two transformed strings the result is the as applying 'wcscoll' to the
  701. original strings. */
  702. #if @GNULIB_WCSXFRM@
  703. # if !@HAVE_WCSXFRM@
  704. _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
  705. # endif
  706. _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
  707. _GL_CXXALIASWARN (wcsxfrm);
  708. #elif defined GNULIB_POSIXCHECK
  709. # undef wcsxfrm
  710. # if HAVE_RAW_DECL_WCSXFRM
  711. _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
  712. "use gnulib module wcsxfrm for portability");
  713. # endif
  714. #endif
  715. /* Duplicate S, returning an identical malloc'd string. */
  716. #if @GNULIB_WCSDUP@
  717. # if !@HAVE_WCSDUP@
  718. _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
  719. # endif
  720. _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
  721. _GL_CXXALIASWARN (wcsdup);
  722. #elif defined GNULIB_POSIXCHECK
  723. # undef wcsdup
  724. # if HAVE_RAW_DECL_WCSDUP
  725. _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
  726. "use gnulib module wcsdup for portability");
  727. # endif
  728. #endif
  729. /* Find the first occurrence of WC in WCS. */
  730. #if @GNULIB_WCSCHR@
  731. # if !@HAVE_WCSCHR@
  732. _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
  733. _GL_ATTRIBUTE_PURE);
  734. # endif
  735. /* On some systems, this function is defined as an overloaded function:
  736. extern "C++" {
  737. const wchar_t * std::wcschr (const wchar_t *, wchar_t);
  738. wchar_t * std::wcschr (wchar_t *, wchar_t);
  739. } */
  740. _GL_CXXALIAS_SYS_CAST2 (wcschr,
  741. wchar_t *, (const wchar_t *, wchar_t),
  742. const wchar_t *, (const wchar_t *, wchar_t));
  743. # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
  744. && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  745. _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
  746. _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
  747. # else
  748. _GL_CXXALIASWARN (wcschr);
  749. # endif
  750. #elif defined GNULIB_POSIXCHECK
  751. # undef wcschr
  752. # if HAVE_RAW_DECL_WCSCHR
  753. _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
  754. "use gnulib module wcschr for portability");
  755. # endif
  756. #endif
  757. /* Find the last occurrence of WC in WCS. */
  758. #if @GNULIB_WCSRCHR@
  759. # if !@HAVE_WCSRCHR@
  760. _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
  761. _GL_ATTRIBUTE_PURE);
  762. # endif
  763. /* On some systems, this function is defined as an overloaded function:
  764. extern "C++" {
  765. const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
  766. wchar_t * std::wcsrchr (wchar_t *, wchar_t);
  767. } */
  768. _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
  769. wchar_t *, (const wchar_t *, wchar_t),
  770. const wchar_t *, (const wchar_t *, wchar_t));
  771. # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
  772. && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  773. _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
  774. _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
  775. # else
  776. _GL_CXXALIASWARN (wcsrchr);
  777. # endif
  778. #elif defined GNULIB_POSIXCHECK
  779. # undef wcsrchr
  780. # if HAVE_RAW_DECL_WCSRCHR
  781. _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
  782. "use gnulib module wcsrchr for portability");
  783. # endif
  784. #endif
  785. /* Return the length of the initial segmet of WCS which consists entirely
  786. of wide characters not in REJECT. */
  787. #if @GNULIB_WCSCSPN@
  788. # if !@HAVE_WCSCSPN@
  789. _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
  790. _GL_ATTRIBUTE_PURE);
  791. # endif
  792. _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
  793. _GL_CXXALIASWARN (wcscspn);
  794. #elif defined GNULIB_POSIXCHECK
  795. # undef wcscspn
  796. # if HAVE_RAW_DECL_WCSCSPN
  797. _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
  798. "use gnulib module wcscspn for portability");
  799. # endif
  800. #endif
  801. /* Return the length of the initial segmet of WCS which consists entirely
  802. of wide characters in ACCEPT. */
  803. #if @GNULIB_WCSSPN@
  804. # if !@HAVE_WCSSPN@
  805. _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
  806. _GL_ATTRIBUTE_PURE);
  807. # endif
  808. _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
  809. _GL_CXXALIASWARN (wcsspn);
  810. #elif defined GNULIB_POSIXCHECK
  811. # undef wcsspn
  812. # if HAVE_RAW_DECL_WCSSPN
  813. _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
  814. "use gnulib module wcsspn for portability");
  815. # endif
  816. #endif
  817. /* Find the first occurrence in WCS of any character in ACCEPT. */
  818. #if @GNULIB_WCSPBRK@
  819. # if !@HAVE_WCSPBRK@
  820. _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
  821. (const wchar_t *wcs, const wchar_t *accept)
  822. _GL_ATTRIBUTE_PURE);
  823. # endif
  824. /* On some systems, this function is defined as an overloaded function:
  825. extern "C++" {
  826. const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
  827. wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
  828. } */
  829. _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
  830. wchar_t *, (const wchar_t *, const wchar_t *),
  831. const wchar_t *, (const wchar_t *, const wchar_t *));
  832. # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
  833. && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  834. _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
  835. (wchar_t *wcs, const wchar_t *accept));
  836. _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
  837. (const wchar_t *wcs, const wchar_t *accept));
  838. # else
  839. _GL_CXXALIASWARN (wcspbrk);
  840. # endif
  841. #elif defined GNULIB_POSIXCHECK
  842. # undef wcspbrk
  843. # if HAVE_RAW_DECL_WCSPBRK
  844. _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
  845. "use gnulib module wcspbrk for portability");
  846. # endif
  847. #endif
  848. /* Find the first occurrence of NEEDLE in HAYSTACK. */
  849. #if @GNULIB_WCSSTR@
  850. # if !@HAVE_WCSSTR@
  851. _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
  852. (const wchar_t *haystack, const wchar_t *needle)
  853. _GL_ATTRIBUTE_PURE);
  854. # endif
  855. /* On some systems, this function is defined as an overloaded function:
  856. extern "C++" {
  857. const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
  858. wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
  859. } */
  860. _GL_CXXALIAS_SYS_CAST2 (wcsstr,
  861. wchar_t *, (const wchar_t *, const wchar_t *),
  862. const wchar_t *, (const wchar_t *, const wchar_t *));
  863. # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
  864. && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  865. _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
  866. (wchar_t *haystack, const wchar_t *needle));
  867. _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
  868. (const wchar_t *haystack, const wchar_t *needle));
  869. # else
  870. _GL_CXXALIASWARN (wcsstr);
  871. # endif
  872. #elif defined GNULIB_POSIXCHECK
  873. # undef wcsstr
  874. # if HAVE_RAW_DECL_WCSSTR
  875. _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
  876. "use gnulib module wcsstr for portability");
  877. # endif
  878. #endif
  879. /* Divide WCS into tokens separated by characters in DELIM. */
  880. #if @GNULIB_WCSTOK@
  881. # if !@HAVE_WCSTOK@
  882. _GL_FUNCDECL_SYS (wcstok, wchar_t *,
  883. (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
  884. # endif
  885. _GL_CXXALIAS_SYS (wcstok, wchar_t *,
  886. (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
  887. _GL_CXXALIASWARN (wcstok);
  888. #elif defined GNULIB_POSIXCHECK
  889. # undef wcstok
  890. # if HAVE_RAW_DECL_WCSTOK
  891. _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
  892. "use gnulib module wcstok for portability");
  893. # endif
  894. #endif
  895. /* Determine number of column positions required for first N wide
  896. characters (or fewer if S ends before this) in S. */
  897. #if @GNULIB_WCSWIDTH@
  898. # if @REPLACE_WCSWIDTH@
  899. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  900. # undef wcswidth
  901. # define wcswidth rpl_wcswidth
  902. # endif
  903. _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
  904. _GL_ATTRIBUTE_PURE);
  905. _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
  906. # else
  907. # if !@HAVE_WCSWIDTH@
  908. _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
  909. _GL_ATTRIBUTE_PURE);
  910. # endif
  911. _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
  912. # endif
  913. _GL_CXXALIASWARN (wcswidth);
  914. #elif defined GNULIB_POSIXCHECK
  915. # undef wcswidth
  916. # if HAVE_RAW_DECL_WCSWIDTH
  917. _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
  918. "use gnulib module wcswidth for portability");
  919. # endif
  920. #endif
  921. #endif /* _@GUARD_PREFIX@_WCHAR_H */
  922. #endif /* _@GUARD_PREFIX@_WCHAR_H */
  923. #endif