wchar.in.h 32 KB

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