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