wchar.in.h 34 KB

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