wchar.in.h 31 KB

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