wchar.in.h 33 KB

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