root/maint/gnulib/lib/wchar.in.h

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
   2 
   3    Copyright (C) 2007-2021 Free Software Foundation, Inc.
   4 
   5    This file is free software: you can redistribute it and/or modify
   6    it under the terms of the GNU Lesser General Public License as
   7    published by the Free Software Foundation; either version 2.1 of the
   8    License, or (at your option) any later version.
   9 
  10    This file 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 Lesser General Public License for more details.
  14 
  15    You should have received a copy of the GNU Lesser General Public License
  16    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
  17 
  18 /* Written by Eric Blake.  */
  19 
  20 /*
  21  * ISO C 99 <wchar.h> for platforms that have issues.
  22  * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/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__)                                          \
  35      || (defined __hpux                                                 \
  36          && ((defined _INTTYPES_INCLUDED                                \
  37               && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H)     \
  38              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
  39      || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
  40      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
  41 /* Special invocation convention:
  42    - Inside glibc and uClibc header files, but not MinGW.
  43    - On HP-UX 11.00 we have a sequence of nested includes
  44      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
  45      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
  46      and once directly.  In both situations 'wint_t' is not yet defined,
  47      therefore we cannot provide the function overrides; instead include only
  48      the system's <wchar.h>.
  49    - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
  50      <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
  51    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
  52      the latter includes <wchar.h>.  But here, we have no way to detect whether
  53      <wctype.h> is completely included or is still being included.  */
  54 
  55 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
  56 
  57 #else
  58 /* Normal invocation convention.  */
  59 
  60 #ifndef _@GUARD_PREFIX@_WCHAR_H
  61 
  62 #define _GL_ALREADY_INCLUDING_WCHAR_H
  63 
  64 #if @HAVE_FEATURES_H@
  65 # include <features.h> /* for __GLIBC__ */
  66 #endif
  67 
  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 
  75 /* Include the original <wchar.h> if it exists.
  76    Some builds of uClibc lack it.  */
  77 /* The include_next requires a split double-inclusion guard.  */
  78 #if @HAVE_WCHAR_H@
  79 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
  80 #endif
  81 
  82 #undef _GL_ALREADY_INCLUDING_WCHAR_H
  83 
  84 #ifndef _@GUARD_PREFIX@_WCHAR_H
  85 #define _@GUARD_PREFIX@_WCHAR_H
  86 
  87 /* The __attribute__ feature is available in gcc versions 2.5 and later.
  88    The attribute __pure__ was added in gcc 2.96.  */
  89 #ifndef _GL_ATTRIBUTE_PURE
  90 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
  91 #  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
  92 # else
  93 #  define _GL_ATTRIBUTE_PURE /* empty */
  94 # endif
  95 #endif
  96 
  97 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
  98 
  99 /* The definition of _GL_ARG_NONNULL is copied here.  */
 100 
 101 /* The definition of _GL_WARN_ON_USE is copied here.  */
 102 
 103 
 104 /* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
 105 #if !@HAVE_WINT_T@ && !defined wint_t
 106 # define wint_t int
 107 # ifndef WEOF
 108 #  define WEOF -1
 109 # endif
 110 #else
 111 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
 112    <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
 113    wint_t must be "unchanged by default argument promotions".  Override it.  */
 114 # if @GNULIBHEADERS_OVERRIDE_WINT_T@
 115 #  if !GNULIB_defined_wint_t
 116 #   if @HAVE_CRTDEFS_H@
 117 #    include <crtdefs.h>
 118 #   else
 119 #    include <stddef.h>
 120 #   endif
 121 typedef unsigned int rpl_wint_t;
 122 #   undef wint_t
 123 #   define wint_t rpl_wint_t
 124 #   define GNULIB_defined_wint_t 1
 125 #  endif
 126 # endif
 127 # ifndef WEOF
 128 #  define WEOF ((wint_t) -1)
 129 # endif
 130 #endif
 131 
 132 
 133 /* Override mbstate_t if it is too small.
 134    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
 135    implementing mbrtowc for encodings like UTF-8.
 136    On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
 137    large enough and overriding it would cause problems in C++ mode.  */
 138 #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
 139 # if !GNULIB_defined_mbstate_t
 140 #  if !(defined _AIX || defined _MSC_VER)
 141 typedef int rpl_mbstate_t;
 142 #   undef mbstate_t
 143 #   define mbstate_t rpl_mbstate_t
 144 #  endif
 145 #  define GNULIB_defined_mbstate_t 1
 146 # endif
 147 #endif
 148 
 149 /* Declare 'free' if needed for _GL_ATTRIBUTE_DEALLOC_FREE.  */
 150 _GL_EXTERN_C void free (void *);
 151 #if @GNULIB_FREE_POSIX@
 152 # if (@REPLACE_FREE@ && !defined free \
 153       && !(defined __cplusplus && defined GNULIB_NAMESPACE))
 154 #  define free rpl_free
 155 _GL_EXTERN_C void free (void *);
 156 # endif
 157 #endif
 158 
 159 /* Convert a single-byte character to a wide character.  */
 160 #if @GNULIB_BTOWC@
 161 # if @REPLACE_BTOWC@
 162 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 163 #   undef btowc
 164 #   define btowc rpl_btowc
 165 #  endif
 166 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 167 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
 168 # else
 169 #  if !@HAVE_BTOWC@
 170 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 171 #  endif
 172 /* Need to cast, because on mingw, the return type is 'unsigned short'.  */
 173 _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
 174 # endif
 175 # if __GLIBC__ >= 2
 176 _GL_CXXALIASWARN (btowc);
 177 # endif
 178 #elif defined GNULIB_POSIXCHECK
 179 # undef btowc
 180 # if HAVE_RAW_DECL_BTOWC
 181 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
 182                  "use gnulib module btowc for portability");
 183 # endif
 184 #endif
 185 
 186 
 187 /* Convert a wide character to a single-byte character.  */
 188 #if @GNULIB_WCTOB@
 189 # if @REPLACE_WCTOB@
 190 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 191 #   undef wctob
 192 #   define wctob rpl_wctob
 193 #  endif
 194 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 195 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
 196 # else
 197 #  if !defined wctob && !@HAVE_DECL_WCTOB@
 198 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
 199 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 200 #  endif
 201 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
 202 # endif
 203 # if __GLIBC__ >= 2
 204 _GL_CXXALIASWARN (wctob);
 205 # endif
 206 #elif defined GNULIB_POSIXCHECK
 207 # undef wctob
 208 # if HAVE_RAW_DECL_WCTOB
 209 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
 210                  "use gnulib module wctob for portability");
 211 # endif
 212 #endif
 213 
 214 
 215 /* Test whether *PS is in the initial state.  */
 216 #if @GNULIB_MBSINIT@
 217 # if @REPLACE_MBSINIT@
 218 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 219 #   undef mbsinit
 220 #   define mbsinit rpl_mbsinit
 221 #  endif
 222 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
 223 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
 224 # else
 225 #  if !@HAVE_MBSINIT@
 226 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
 227 #  endif
 228 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
 229 # endif
 230 # if __GLIBC__ >= 2
 231 _GL_CXXALIASWARN (mbsinit);
 232 # endif
 233 #elif defined GNULIB_POSIXCHECK
 234 # undef mbsinit
 235 # if HAVE_RAW_DECL_MBSINIT
 236 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
 237                  "use gnulib module mbsinit for portability");
 238 # endif
 239 #endif
 240 
 241 
 242 /* Convert a multibyte character to a wide character.  */
 243 #if @GNULIB_MBRTOWC@
 244 # if @REPLACE_MBRTOWC@
 245 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 246 #   undef mbrtowc
 247 #   define mbrtowc rpl_mbrtowc
 248 #  endif
 249 _GL_FUNCDECL_RPL (mbrtowc, size_t,
 250                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
 251                    mbstate_t *restrict ps));
 252 _GL_CXXALIAS_RPL (mbrtowc, size_t,
 253                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
 254                    mbstate_t *restrict ps));
 255 # else
 256 #  if !@HAVE_MBRTOWC@
 257 _GL_FUNCDECL_SYS (mbrtowc, size_t,
 258                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
 259                    mbstate_t *restrict ps));
 260 #  endif
 261 _GL_CXXALIAS_SYS (mbrtowc, size_t,
 262                   (wchar_t *restrict pwc, const char *restrict s, size_t n,
 263                    mbstate_t *restrict ps));
 264 # endif
 265 # if __GLIBC__ >= 2
 266 _GL_CXXALIASWARN (mbrtowc);
 267 # endif
 268 #elif defined GNULIB_POSIXCHECK
 269 # undef mbrtowc
 270 # if HAVE_RAW_DECL_MBRTOWC
 271 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
 272                  "use gnulib module mbrtowc for portability");
 273 # endif
 274 #endif
 275 
 276 
 277 /* Recognize a multibyte character.  */
 278 #if @GNULIB_MBRLEN@
 279 # if @REPLACE_MBRLEN@
 280 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 281 #   undef mbrlen
 282 #   define mbrlen rpl_mbrlen
 283 #  endif
 284 _GL_FUNCDECL_RPL (mbrlen, size_t,
 285                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
 286 _GL_CXXALIAS_RPL (mbrlen, size_t,
 287                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
 288 # else
 289 #  if !@HAVE_MBRLEN@
 290 _GL_FUNCDECL_SYS (mbrlen, size_t,
 291                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
 292 #  endif
 293 _GL_CXXALIAS_SYS (mbrlen, size_t,
 294                   (const char *restrict s, size_t n, mbstate_t *restrict ps));
 295 # endif
 296 # if __GLIBC__ >= 2
 297 _GL_CXXALIASWARN (mbrlen);
 298 # endif
 299 #elif defined GNULIB_POSIXCHECK
 300 # undef mbrlen
 301 # if HAVE_RAW_DECL_MBRLEN
 302 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
 303                  "use gnulib module mbrlen for portability");
 304 # endif
 305 #endif
 306 
 307 
 308 /* Convert a string to a wide string.  */
 309 #if @GNULIB_MBSRTOWCS@
 310 # if @REPLACE_MBSRTOWCS@
 311 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 312 #   undef mbsrtowcs
 313 #   define mbsrtowcs rpl_mbsrtowcs
 314 #  endif
 315 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
 316                   (wchar_t *restrict dest,
 317                    const char **restrict srcp, size_t len,
 318                    mbstate_t *restrict ps)
 319                   _GL_ARG_NONNULL ((2)));
 320 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
 321                   (wchar_t *restrict dest,
 322                    const char **restrict srcp, size_t len,
 323                    mbstate_t *restrict ps));
 324 # else
 325 #  if !@HAVE_MBSRTOWCS@
 326 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
 327                   (wchar_t *restrict dest,
 328                    const char **restrict srcp, size_t len,
 329                    mbstate_t *restrict ps)
 330                   _GL_ARG_NONNULL ((2)));
 331 #  endif
 332 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
 333                   (wchar_t *restrict dest,
 334                    const char **restrict srcp, size_t len,
 335                    mbstate_t *restrict ps));
 336 # endif
 337 # if __GLIBC__ >= 2
 338 _GL_CXXALIASWARN (mbsrtowcs);
 339 # endif
 340 #elif defined GNULIB_POSIXCHECK
 341 # undef mbsrtowcs
 342 # if HAVE_RAW_DECL_MBSRTOWCS
 343 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
 344                  "use gnulib module mbsrtowcs for portability");
 345 # endif
 346 #endif
 347 
 348 
 349 /* Convert a string to a wide string.  */
 350 #if @GNULIB_MBSNRTOWCS@
 351 # if @REPLACE_MBSNRTOWCS@
 352 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 353 #   undef mbsnrtowcs
 354 #   define mbsnrtowcs rpl_mbsnrtowcs
 355 #  endif
 356 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
 357                   (wchar_t *restrict dest,
 358                    const char **restrict srcp, size_t srclen, size_t len,
 359                    mbstate_t *restrict ps)
 360                   _GL_ARG_NONNULL ((2)));
 361 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
 362                   (wchar_t *restrict dest,
 363                    const char **restrict srcp, size_t srclen, size_t len,
 364                    mbstate_t *restrict ps));
 365 # else
 366 #  if !@HAVE_MBSNRTOWCS@
 367 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
 368                   (wchar_t *restrict dest,
 369                    const char **restrict srcp, size_t srclen, size_t len,
 370                    mbstate_t *restrict ps)
 371                   _GL_ARG_NONNULL ((2)));
 372 #  endif
 373 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
 374                   (wchar_t *restrict dest,
 375                    const char **restrict srcp, size_t srclen, size_t len,
 376                    mbstate_t *restrict ps));
 377 # endif
 378 _GL_CXXALIASWARN (mbsnrtowcs);
 379 #elif defined GNULIB_POSIXCHECK
 380 # undef mbsnrtowcs
 381 # if HAVE_RAW_DECL_MBSNRTOWCS
 382 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
 383                  "use gnulib module mbsnrtowcs for portability");
 384 # endif
 385 #endif
 386 
 387 
 388 /* Convert a wide character to a multibyte character.  */
 389 #if @GNULIB_WCRTOMB@
 390 # if @REPLACE_WCRTOMB@
 391 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 392 #   undef wcrtomb
 393 #   define wcrtomb rpl_wcrtomb
 394 #  endif
 395 _GL_FUNCDECL_RPL (wcrtomb, size_t,
 396                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 397 _GL_CXXALIAS_RPL (wcrtomb, size_t,
 398                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 399 # else
 400 #  if !@HAVE_WCRTOMB@
 401 _GL_FUNCDECL_SYS (wcrtomb, size_t,
 402                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 403 #  endif
 404 _GL_CXXALIAS_SYS (wcrtomb, size_t,
 405                   (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 406 # endif
 407 # if __GLIBC__ >= 2
 408 _GL_CXXALIASWARN (wcrtomb);
 409 # endif
 410 #elif defined GNULIB_POSIXCHECK
 411 # undef wcrtomb
 412 # if HAVE_RAW_DECL_WCRTOMB
 413 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
 414                  "use gnulib module wcrtomb for portability");
 415 # endif
 416 #endif
 417 
 418 
 419 /* Convert a wide string to a string.  */
 420 #if @GNULIB_WCSRTOMBS@
 421 # if @REPLACE_WCSRTOMBS@
 422 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 423 #   undef wcsrtombs
 424 #   define wcsrtombs rpl_wcsrtombs
 425 #  endif
 426 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
 427                   (char *restrict dest, const wchar_t **restrict srcp,
 428                    size_t len,
 429                    mbstate_t *restrict ps)
 430                   _GL_ARG_NONNULL ((2)));
 431 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
 432                   (char *restrict dest, const wchar_t **restrict srcp,
 433                    size_t len,
 434                    mbstate_t *restrict ps));
 435 # else
 436 #  if !@HAVE_WCSRTOMBS@
 437 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
 438                   (char *restrict dest, const wchar_t **restrict srcp,
 439                    size_t len,
 440                    mbstate_t *restrict ps)
 441                   _GL_ARG_NONNULL ((2)));
 442 #  endif
 443 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
 444                   (char *restrict dest, const wchar_t **restrict srcp,
 445                    size_t len,
 446                    mbstate_t *restrict ps));
 447 # endif
 448 # if __GLIBC__ >= 2
 449 _GL_CXXALIASWARN (wcsrtombs);
 450 # endif
 451 #elif defined GNULIB_POSIXCHECK
 452 # undef wcsrtombs
 453 # if HAVE_RAW_DECL_WCSRTOMBS
 454 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
 455                  "use gnulib module wcsrtombs for portability");
 456 # endif
 457 #endif
 458 
 459 
 460 /* Convert a wide string to a string.  */
 461 #if @GNULIB_WCSNRTOMBS@
 462 # if @REPLACE_WCSNRTOMBS@
 463 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 464 #   undef wcsnrtombs
 465 #   define wcsnrtombs rpl_wcsnrtombs
 466 #  endif
 467 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
 468                   (char *restrict dest,
 469                    const wchar_t **restrict srcp, size_t srclen,
 470                    size_t len,
 471                    mbstate_t *restrict ps)
 472                   _GL_ARG_NONNULL ((2)));
 473 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
 474                   (char *restrict dest,
 475                    const wchar_t **restrict srcp, size_t srclen,
 476                    size_t len,
 477                    mbstate_t *restrict ps));
 478 # else
 479 #  if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
 480 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
 481                   (char *restrict dest,
 482                    const wchar_t **restrict srcp, size_t srclen,
 483                    size_t len,
 484                    mbstate_t *restrict ps)
 485                   _GL_ARG_NONNULL ((2)));
 486 #  endif
 487 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
 488                   (char *restrict dest,
 489                    const wchar_t **restrict srcp, size_t srclen,
 490                    size_t len,
 491                    mbstate_t *restrict ps));
 492 # endif
 493 # if __GLIBC__ >= 2
 494 _GL_CXXALIASWARN (wcsnrtombs);
 495 # endif
 496 #elif defined GNULIB_POSIXCHECK
 497 # undef wcsnrtombs
 498 # if HAVE_RAW_DECL_WCSNRTOMBS
 499 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 500                  "use gnulib module wcsnrtombs for portability");
 501 # endif
 502 #endif
 503 
 504 
 505 /* Return the number of screen columns needed for WC.  */
 506 #if @GNULIB_WCWIDTH@
 507 # if @REPLACE_WCWIDTH@
 508 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 509 #   undef wcwidth
 510 #   define wcwidth rpl_wcwidth
 511 #  endif
 512 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 513 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 514 # else
 515 #  if !@HAVE_DECL_WCWIDTH@
 516 /* wcwidth exists but is not declared.  */
 517 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 518 #  endif
 519 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 520 # endif
 521 # if __GLIBC__ >= 2
 522 _GL_CXXALIASWARN (wcwidth);
 523 # endif
 524 #elif defined GNULIB_POSIXCHECK
 525 # undef wcwidth
 526 # if HAVE_RAW_DECL_WCWIDTH
 527 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
 528                  "use gnulib module wcwidth for portability");
 529 # endif
 530 #endif
 531 
 532 
 533 /* Search N wide characters of S for C.  */
 534 #if @GNULIB_WMEMCHR@
 535 # if !@HAVE_WMEMCHR@
 536 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
 537                                       _GL_ATTRIBUTE_PURE);
 538 # endif
 539   /* On some systems, this function is defined as an overloaded function:
 540        extern "C++" {
 541          const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
 542          wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
 543        }  */
 544 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
 545                         wchar_t *, (const wchar_t *, wchar_t, size_t),
 546                         const wchar_t *, (const wchar_t *, wchar_t, size_t));
 547 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
 548      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 549 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 550 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
 551                    (const wchar_t *s, wchar_t c, size_t n));
 552 # elif __GLIBC__ >= 2
 553 _GL_CXXALIASWARN (wmemchr);
 554 # endif
 555 #elif defined GNULIB_POSIXCHECK
 556 # undef wmemchr
 557 # if HAVE_RAW_DECL_WMEMCHR
 558 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
 559                  "use gnulib module wmemchr for portability");
 560 # endif
 561 #endif
 562 
 563 
 564 /* Compare N wide characters of S1 and S2.  */
 565 #if @GNULIB_WMEMCMP@
 566 # if !@HAVE_WMEMCMP@
 567 _GL_FUNCDECL_SYS (wmemcmp, int,
 568                   (const wchar_t *s1, const wchar_t *s2, size_t n)
 569                   _GL_ATTRIBUTE_PURE);
 570 # endif
 571 _GL_CXXALIAS_SYS (wmemcmp, int,
 572                   (const wchar_t *s1, const wchar_t *s2, size_t n));
 573 # if __GLIBC__ >= 2
 574 _GL_CXXALIASWARN (wmemcmp);
 575 # endif
 576 #elif defined GNULIB_POSIXCHECK
 577 # undef wmemcmp
 578 # if HAVE_RAW_DECL_WMEMCMP
 579 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
 580                  "use gnulib module wmemcmp for portability");
 581 # endif
 582 #endif
 583 
 584 
 585 /* Copy N wide characters of SRC to DEST.  */
 586 #if @GNULIB_WMEMCPY@
 587 # if !@HAVE_WMEMCPY@
 588 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
 589                   (wchar_t *restrict dest,
 590                    const wchar_t *restrict src, size_t n));
 591 # endif
 592 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
 593                   (wchar_t *restrict dest,
 594                    const wchar_t *restrict src, size_t n));
 595 # if __GLIBC__ >= 2
 596 _GL_CXXALIASWARN (wmemcpy);
 597 # endif
 598 #elif defined GNULIB_POSIXCHECK
 599 # undef wmemcpy
 600 # if HAVE_RAW_DECL_WMEMCPY
 601 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
 602                  "use gnulib module wmemcpy for portability");
 603 # endif
 604 #endif
 605 
 606 
 607 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
 608    overlapping memory areas.  */
 609 #if @GNULIB_WMEMMOVE@
 610 # if !@HAVE_WMEMMOVE@
 611 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
 612                   (wchar_t *dest, const wchar_t *src, size_t n));
 613 # endif
 614 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
 615                   (wchar_t *dest, const wchar_t *src, size_t n));
 616 # if __GLIBC__ >= 2
 617 _GL_CXXALIASWARN (wmemmove);
 618 # endif
 619 #elif defined GNULIB_POSIXCHECK
 620 # undef wmemmove
 621 # if HAVE_RAW_DECL_WMEMMOVE
 622 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
 623                  "use gnulib module wmemmove for portability");
 624 # endif
 625 #endif
 626 
 627 
 628 /* Copy N wide characters of SRC to DEST.
 629    Return pointer to wide characters after the last written wide character.  */
 630 #if @GNULIB_WMEMPCPY@
 631 # if !@HAVE_WMEMPCPY@
 632 _GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
 633                   (wchar_t *restrict dest,
 634                    const wchar_t *restrict src, size_t n));
 635 # endif
 636 _GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
 637                   (wchar_t *restrict dest,
 638                    const wchar_t *restrict src, size_t n));
 639 # if __GLIBC__ >= 2
 640 _GL_CXXALIASWARN (wmempcpy);
 641 # endif
 642 #elif defined GNULIB_POSIXCHECK
 643 # undef wmempcpy
 644 # if HAVE_RAW_DECL_WMEMPCPY
 645 _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
 646                  "use gnulib module wmempcpy for portability");
 647 # endif
 648 #endif
 649 
 650 
 651 /* Set N wide characters of S to C.  */
 652 #if @GNULIB_WMEMSET@
 653 # if !@HAVE_WMEMSET@
 654 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 655 # endif
 656 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 657 # if __GLIBC__ >= 2
 658 _GL_CXXALIASWARN (wmemset);
 659 # endif
 660 #elif defined GNULIB_POSIXCHECK
 661 # undef wmemset
 662 # if HAVE_RAW_DECL_WMEMSET
 663 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
 664                  "use gnulib module wmemset for portability");
 665 # endif
 666 #endif
 667 
 668 
 669 /* Return the number of wide characters in S.  */
 670 #if @GNULIB_WCSLEN@
 671 # if !@HAVE_WCSLEN@
 672 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
 673 # endif
 674 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
 675 # if __GLIBC__ >= 2
 676 _GL_CXXALIASWARN (wcslen);
 677 # endif
 678 #elif defined GNULIB_POSIXCHECK
 679 # undef wcslen
 680 # if HAVE_RAW_DECL_WCSLEN
 681 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
 682                  "use gnulib module wcslen for portability");
 683 # endif
 684 #endif
 685 
 686 
 687 /* Return the number of wide characters in S, but at most MAXLEN.  */
 688 #if @GNULIB_WCSNLEN@
 689 # if !@HAVE_WCSNLEN@
 690 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
 691                                    _GL_ATTRIBUTE_PURE);
 692 # endif
 693 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
 694 _GL_CXXALIASWARN (wcsnlen);
 695 #elif defined GNULIB_POSIXCHECK
 696 # undef wcsnlen
 697 # if HAVE_RAW_DECL_WCSNLEN
 698 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
 699                  "use gnulib module wcsnlen for portability");
 700 # endif
 701 #endif
 702 
 703 
 704 /* Copy SRC to DEST.  */
 705 #if @GNULIB_WCSCPY@
 706 # if !@HAVE_WCSCPY@
 707 _GL_FUNCDECL_SYS (wcscpy, wchar_t *,
 708                   (wchar_t *restrict dest, const wchar_t *restrict src));
 709 # endif
 710 _GL_CXXALIAS_SYS (wcscpy, wchar_t *,
 711                   (wchar_t *restrict dest, const wchar_t *restrict src));
 712 # if __GLIBC__ >= 2
 713 _GL_CXXALIASWARN (wcscpy);
 714 # endif
 715 #elif defined GNULIB_POSIXCHECK
 716 # undef wcscpy
 717 # if HAVE_RAW_DECL_WCSCPY
 718 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
 719                  "use gnulib module wcscpy for portability");
 720 # endif
 721 #endif
 722 
 723 
 724 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
 725 #if @GNULIB_WCPCPY@
 726 # if !@HAVE_WCPCPY@
 727 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
 728                   (wchar_t *restrict dest, const wchar_t *restrict src));
 729 # endif
 730 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
 731                   (wchar_t *restrict dest, const wchar_t *restrict src));
 732 _GL_CXXALIASWARN (wcpcpy);
 733 #elif defined GNULIB_POSIXCHECK
 734 # undef wcpcpy
 735 # if HAVE_RAW_DECL_WCPCPY
 736 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
 737                  "use gnulib module wcpcpy for portability");
 738 # endif
 739 #endif
 740 
 741 
 742 /* Copy no more than N wide characters of SRC to DEST.  */
 743 #if @GNULIB_WCSNCPY@
 744 # if !@HAVE_WCSNCPY@
 745 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
 746                   (wchar_t *restrict dest,
 747                    const wchar_t *restrict src, size_t n));
 748 # endif
 749 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
 750                   (wchar_t *restrict dest,
 751                    const wchar_t *restrict src, size_t n));
 752 # if __GLIBC__ >= 2
 753 _GL_CXXALIASWARN (wcsncpy);
 754 # endif
 755 #elif defined GNULIB_POSIXCHECK
 756 # undef wcsncpy
 757 # if HAVE_RAW_DECL_WCSNCPY
 758 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
 759                  "use gnulib module wcsncpy for portability");
 760 # endif
 761 #endif
 762 
 763 
 764 /* Copy no more than N characters of SRC to DEST, returning the address of
 765    the last character written into DEST.  */
 766 #if @GNULIB_WCPNCPY@
 767 # if !@HAVE_WCPNCPY@
 768 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
 769                   (wchar_t *restrict dest,
 770                    const wchar_t *restrict src, size_t n));
 771 # endif
 772 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
 773                   (wchar_t *restrict dest,
 774                    const wchar_t *restrict src, size_t n));
 775 _GL_CXXALIASWARN (wcpncpy);
 776 #elif defined GNULIB_POSIXCHECK
 777 # undef wcpncpy
 778 # if HAVE_RAW_DECL_WCPNCPY
 779 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
 780                  "use gnulib module wcpncpy for portability");
 781 # endif
 782 #endif
 783 
 784 
 785 /* Append SRC onto DEST.  */
 786 #if @GNULIB_WCSCAT@
 787 # if !@HAVE_WCSCAT@
 788 _GL_FUNCDECL_SYS (wcscat, wchar_t *,
 789                   (wchar_t *restrict dest, const wchar_t *restrict src));
 790 # endif
 791 _GL_CXXALIAS_SYS (wcscat, wchar_t *,
 792                   (wchar_t *restrict dest, const wchar_t *restrict src));
 793 # if __GLIBC__ >= 2
 794 _GL_CXXALIASWARN (wcscat);
 795 # endif
 796 #elif defined GNULIB_POSIXCHECK
 797 # undef wcscat
 798 # if HAVE_RAW_DECL_WCSCAT
 799 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
 800                  "use gnulib module wcscat for portability");
 801 # endif
 802 #endif
 803 
 804 
 805 /* Append no more than N wide characters of SRC onto DEST.  */
 806 #if @GNULIB_WCSNCAT@
 807 # if !@HAVE_WCSNCAT@
 808 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
 809                   (wchar_t *restrict dest, const wchar_t *restrict src,
 810                    size_t n));
 811 # endif
 812 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
 813                   (wchar_t *restrict dest, const wchar_t *restrict src,
 814                    size_t n));
 815 # if __GLIBC__ >= 2
 816 _GL_CXXALIASWARN (wcsncat);
 817 # endif
 818 #elif defined GNULIB_POSIXCHECK
 819 # undef wcsncat
 820 # if HAVE_RAW_DECL_WCSNCAT
 821 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
 822                  "use gnulib module wcsncat for portability");
 823 # endif
 824 #endif
 825 
 826 
 827 /* Compare S1 and S2.  */
 828 #if @GNULIB_WCSCMP@
 829 # if !@HAVE_WCSCMP@
 830 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
 831                                _GL_ATTRIBUTE_PURE);
 832 # endif
 833 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
 834 # if __GLIBC__ >= 2
 835 _GL_CXXALIASWARN (wcscmp);
 836 # endif
 837 #elif defined GNULIB_POSIXCHECK
 838 # undef wcscmp
 839 # if HAVE_RAW_DECL_WCSCMP
 840 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
 841                  "use gnulib module wcscmp for portability");
 842 # endif
 843 #endif
 844 
 845 
 846 /* Compare no more than N wide characters of S1 and S2.  */
 847 #if @GNULIB_WCSNCMP@
 848 # if !@HAVE_WCSNCMP@
 849 _GL_FUNCDECL_SYS (wcsncmp, int,
 850                   (const wchar_t *s1, const wchar_t *s2, size_t n)
 851                   _GL_ATTRIBUTE_PURE);
 852 # endif
 853 _GL_CXXALIAS_SYS (wcsncmp, int,
 854                   (const wchar_t *s1, const wchar_t *s2, size_t n));
 855 # if __GLIBC__ >= 2
 856 _GL_CXXALIASWARN (wcsncmp);
 857 # endif
 858 #elif defined GNULIB_POSIXCHECK
 859 # undef wcsncmp
 860 # if HAVE_RAW_DECL_WCSNCMP
 861 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
 862                  "use gnulib module wcsncmp for portability");
 863 # endif
 864 #endif
 865 
 866 
 867 /* Compare S1 and S2, ignoring case.  */
 868 #if @GNULIB_WCSCASECMP@
 869 # if !@HAVE_WCSCASECMP@
 870 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
 871                                    _GL_ATTRIBUTE_PURE);
 872 # endif
 873 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
 874 _GL_CXXALIASWARN (wcscasecmp);
 875 #elif defined GNULIB_POSIXCHECK
 876 # undef wcscasecmp
 877 # if HAVE_RAW_DECL_WCSCASECMP
 878 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
 879                  "use gnulib module wcscasecmp for portability");
 880 # endif
 881 #endif
 882 
 883 
 884 /* Compare no more than N chars of S1 and S2, ignoring case.  */
 885 #if @GNULIB_WCSNCASECMP@
 886 # if !@HAVE_WCSNCASECMP@
 887 _GL_FUNCDECL_SYS (wcsncasecmp, int,
 888                   (const wchar_t *s1, const wchar_t *s2, size_t n)
 889                   _GL_ATTRIBUTE_PURE);
 890 # endif
 891 _GL_CXXALIAS_SYS (wcsncasecmp, int,
 892                   (const wchar_t *s1, const wchar_t *s2, size_t n));
 893 _GL_CXXALIASWARN (wcsncasecmp);
 894 #elif defined GNULIB_POSIXCHECK
 895 # undef wcsncasecmp
 896 # if HAVE_RAW_DECL_WCSNCASECMP
 897 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
 898                  "use gnulib module wcsncasecmp for portability");
 899 # endif
 900 #endif
 901 
 902 
 903 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
 904    category of the current locale.  */
 905 #if @GNULIB_WCSCOLL@
 906 # if !@HAVE_WCSCOLL@
 907 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
 908 # endif
 909 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
 910 # if __GLIBC__ >= 2
 911 _GL_CXXALIASWARN (wcscoll);
 912 # endif
 913 #elif defined GNULIB_POSIXCHECK
 914 # undef wcscoll
 915 # if HAVE_RAW_DECL_WCSCOLL
 916 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
 917                  "use gnulib module wcscoll for portability");
 918 # endif
 919 #endif
 920 
 921 
 922 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
 923    to two transformed strings the result is the as applying 'wcscoll' to the
 924    original strings.  */
 925 #if @GNULIB_WCSXFRM@
 926 # if !@HAVE_WCSXFRM@
 927 _GL_FUNCDECL_SYS (wcsxfrm, size_t,
 928                   (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
 929 # endif
 930 _GL_CXXALIAS_SYS (wcsxfrm, size_t,
 931                   (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
 932 # if __GLIBC__ >= 2
 933 _GL_CXXALIASWARN (wcsxfrm);
 934 # endif
 935 #elif defined GNULIB_POSIXCHECK
 936 # undef wcsxfrm
 937 # if HAVE_RAW_DECL_WCSXFRM
 938 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
 939                  "use gnulib module wcsxfrm for portability");
 940 # endif
 941 #endif
 942 
 943 
 944 /* Duplicate S, returning an identical malloc'd string.  */
 945 #if @GNULIB_WCSDUP@
 946 # if defined _WIN32 && !defined __CYGWIN__
 947 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 948 #   undef wcsdup
 949 #   define wcsdup _wcsdup
 950 #  endif
 951 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
 952 # else
 953 #  if !@HAVE_WCSDUP@ || __GNUC__ >= 11
 954 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
 955                   (const wchar_t *s)
 956                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 957 #  endif
 958 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
 959 # endif
 960 _GL_CXXALIASWARN (wcsdup);
 961 #else
 962 # if __GNUC__ >= 11 && !defined wcsdup
 963 /* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free.  */
 964 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
 965                   (const wchar_t *s)
 966                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 967 # endif
 968 # if defined GNULIB_POSIXCHECK
 969 #  undef wcsdup
 970 #  if HAVE_RAW_DECL_WCSDUP
 971 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
 972                  "use gnulib module wcsdup for portability");
 973 #  endif
 974 # elif @GNULIB_MDA_WCSDUP@
 975 /* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
 976    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
 977    platforms by defining GNULIB_NAMESPACE::wcsdup always.  */
 978 #  if defined _WIN32 && !defined __CYGWIN__
 979 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 980 #    undef wcsdup
 981 #    define wcsdup _wcsdup
 982 #   endif
 983 _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
 984 #  else
 985 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
 986                   (const wchar_t *s)
 987                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 988 #   if @HAVE_DECL_WCSDUP@
 989 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
 990 #   endif
 991 #  endif
 992 #  if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
 993 _GL_CXXALIASWARN (wcsdup);
 994 #  endif
 995 # endif
 996 #endif
 997 
 998 
 999 /* Find the first occurrence of WC in WCS.  */
1000 #if @GNULIB_WCSCHR@
1001 # if !@HAVE_WCSCHR@
1002 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1003                                      _GL_ATTRIBUTE_PURE);
1004 # endif
1005   /* On some systems, this function is defined as an overloaded function:
1006        extern "C++" {
1007          const wchar_t * std::wcschr (const wchar_t *, wchar_t);
1008          wchar_t * std::wcschr (wchar_t *, wchar_t);
1009        }  */
1010 _GL_CXXALIAS_SYS_CAST2 (wcschr,
1011                         wchar_t *, (const wchar_t *, wchar_t),
1012                         const wchar_t *, (const wchar_t *, wchar_t));
1013 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1014      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1015 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1016 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1017 # elif __GLIBC__ >= 2
1018 _GL_CXXALIASWARN (wcschr);
1019 # endif
1020 #elif defined GNULIB_POSIXCHECK
1021 # undef wcschr
1022 # if HAVE_RAW_DECL_WCSCHR
1023 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
1024                  "use gnulib module wcschr for portability");
1025 # endif
1026 #endif
1027 
1028 
1029 /* Find the last occurrence of WC in WCS.  */
1030 #if @GNULIB_WCSRCHR@
1031 # if !@HAVE_WCSRCHR@
1032 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
1033                                       _GL_ATTRIBUTE_PURE);
1034 # endif
1035   /* On some systems, this function is defined as an overloaded function:
1036        extern "C++" {
1037          const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
1038          wchar_t * std::wcsrchr (wchar_t *, wchar_t);
1039        }  */
1040 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
1041                         wchar_t *, (const wchar_t *, wchar_t),
1042                         const wchar_t *, (const wchar_t *, wchar_t));
1043 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1044      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1045 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
1046 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
1047 # elif __GLIBC__ >= 2
1048 _GL_CXXALIASWARN (wcsrchr);
1049 # endif
1050 #elif defined GNULIB_POSIXCHECK
1051 # undef wcsrchr
1052 # if HAVE_RAW_DECL_WCSRCHR
1053 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
1054                  "use gnulib module wcsrchr for portability");
1055 # endif
1056 #endif
1057 
1058 
1059 /* Return the length of the initial segmet of WCS which consists entirely
1060    of wide characters not in REJECT.  */
1061 #if @GNULIB_WCSCSPN@
1062 # if !@HAVE_WCSCSPN@
1063 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
1064                                    _GL_ATTRIBUTE_PURE);
1065 # endif
1066 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
1067 # if __GLIBC__ >= 2
1068 _GL_CXXALIASWARN (wcscspn);
1069 # endif
1070 #elif defined GNULIB_POSIXCHECK
1071 # undef wcscspn
1072 # if HAVE_RAW_DECL_WCSCSPN
1073 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
1074                  "use gnulib module wcscspn for portability");
1075 # endif
1076 #endif
1077 
1078 
1079 /* Return the length of the initial segmet of WCS which consists entirely
1080    of wide characters in ACCEPT.  */
1081 #if @GNULIB_WCSSPN@
1082 # if !@HAVE_WCSSPN@
1083 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
1084                                   _GL_ATTRIBUTE_PURE);
1085 # endif
1086 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
1087 # if __GLIBC__ >= 2
1088 _GL_CXXALIASWARN (wcsspn);
1089 # endif
1090 #elif defined GNULIB_POSIXCHECK
1091 # undef wcsspn
1092 # if HAVE_RAW_DECL_WCSSPN
1093 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
1094                  "use gnulib module wcsspn for portability");
1095 # endif
1096 #endif
1097 
1098 
1099 /* Find the first occurrence in WCS of any character in ACCEPT.  */
1100 #if @GNULIB_WCSPBRK@
1101 # if !@HAVE_WCSPBRK@
1102 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
1103                   (const wchar_t *wcs, const wchar_t *accept)
1104                   _GL_ATTRIBUTE_PURE);
1105 # endif
1106   /* On some systems, this function is defined as an overloaded function:
1107        extern "C++" {
1108          const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
1109          wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
1110        }  */
1111 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
1112                         wchar_t *, (const wchar_t *, const wchar_t *),
1113                         const wchar_t *, (const wchar_t *, const wchar_t *));
1114 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1115      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1116 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
1117                    (wchar_t *wcs, const wchar_t *accept));
1118 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
1119                    (const wchar_t *wcs, const wchar_t *accept));
1120 # elif __GLIBC__ >= 2
1121 _GL_CXXALIASWARN (wcspbrk);
1122 # endif
1123 #elif defined GNULIB_POSIXCHECK
1124 # undef wcspbrk
1125 # if HAVE_RAW_DECL_WCSPBRK
1126 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
1127                  "use gnulib module wcspbrk for portability");
1128 # endif
1129 #endif
1130 
1131 
1132 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
1133 #if @GNULIB_WCSSTR@
1134 # if !@HAVE_WCSSTR@
1135 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
1136                   (const wchar_t *restrict haystack,
1137                    const wchar_t *restrict needle)
1138                   _GL_ATTRIBUTE_PURE);
1139 # endif
1140   /* On some systems, this function is defined as an overloaded function:
1141        extern "C++" {
1142          const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
1143          wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
1144        }  */
1145 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
1146                         wchar_t *,
1147                         (const wchar_t *restrict, const wchar_t *restrict),
1148                         const wchar_t *,
1149                         (const wchar_t *restrict, const wchar_t *restrict));
1150 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
1151      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
1152 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
1153                    (wchar_t *restrict haystack,
1154                     const wchar_t *restrict needle));
1155 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
1156                    (const wchar_t *restrict haystack,
1157                     const wchar_t *restrict needle));
1158 # elif __GLIBC__ >= 2
1159 _GL_CXXALIASWARN (wcsstr);
1160 # endif
1161 #elif defined GNULIB_POSIXCHECK
1162 # undef wcsstr
1163 # if HAVE_RAW_DECL_WCSSTR
1164 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
1165                  "use gnulib module wcsstr for portability");
1166 # endif
1167 #endif
1168 
1169 
1170 /* Divide WCS into tokens separated by characters in DELIM.  */
1171 #if @GNULIB_WCSTOK@
1172 # if @REPLACE_WCSTOK@
1173 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1174 #   undef wcstok
1175 #   define wcstok rpl_wcstok
1176 #  endif
1177 _GL_FUNCDECL_RPL (wcstok, wchar_t *,
1178                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1179                    wchar_t **restrict ptr));
1180 _GL_CXXALIAS_RPL (wcstok, wchar_t *,
1181                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1182                    wchar_t **restrict ptr));
1183 # else
1184 #  if !@HAVE_WCSTOK@
1185 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
1186                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1187                    wchar_t **restrict ptr));
1188 #  endif
1189 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
1190                   (wchar_t *restrict wcs, const wchar_t *restrict delim,
1191                    wchar_t **restrict ptr));
1192 # endif
1193 # if __GLIBC__ >= 2
1194 _GL_CXXALIASWARN (wcstok);
1195 # endif
1196 #elif defined GNULIB_POSIXCHECK
1197 # undef wcstok
1198 # if HAVE_RAW_DECL_WCSTOK
1199 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
1200                  "use gnulib module wcstok for portability");
1201 # endif
1202 #endif
1203 
1204 
1205 /* Determine number of column positions required for first N wide
1206    characters (or fewer if S ends before this) in S.  */
1207 #if @GNULIB_WCSWIDTH@
1208 # if @REPLACE_WCSWIDTH@
1209 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1210 #   undef wcswidth
1211 #   define wcswidth rpl_wcswidth
1212 #  endif
1213 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
1214                                  _GL_ATTRIBUTE_PURE);
1215 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
1216 # else
1217 #  if !@HAVE_WCSWIDTH@
1218 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
1219                                  _GL_ATTRIBUTE_PURE);
1220 #  endif
1221 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
1222 # endif
1223 # if __GLIBC__ >= 2
1224 _GL_CXXALIASWARN (wcswidth);
1225 # endif
1226 #elif defined GNULIB_POSIXCHECK
1227 # undef wcswidth
1228 # if HAVE_RAW_DECL_WCSWIDTH
1229 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
1230                  "use gnulib module wcswidth for portability");
1231 # endif
1232 #endif
1233 
1234 
1235 /* Convert *TP to a date and time wide string.  See
1236    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>.  */
1237 #if @GNULIB_WCSFTIME@
1238 # if @REPLACE_WCSFTIME@
1239 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1240 #   undef wcsftime
1241 #   define wcsftime rpl_wcsftime
1242 #  endif
1243 _GL_FUNCDECL_RPL (wcsftime, size_t,
1244                   (wchar_t *restrict __buf, size_t __bufsize,
1245                    const wchar_t *restrict __fmt,
1246                    const struct tm *restrict __tp)
1247                   _GL_ARG_NONNULL ((1, 3, 4)));
1248 _GL_CXXALIAS_RPL (wcsftime, size_t,
1249                   (wchar_t *restrict __buf, size_t __bufsize,
1250                    const wchar_t *restrict __fmt,
1251                    const struct tm *restrict __tp));
1252 # else
1253 #  if !@HAVE_WCSFTIME@
1254 _GL_FUNCDECL_SYS (wcsftime, size_t,
1255                   (wchar_t *restrict __buf, size_t __bufsize,
1256                    const wchar_t *restrict __fmt,
1257                    const struct tm *restrict __tp)
1258                   _GL_ARG_NONNULL ((1, 3, 4)));
1259 #  endif
1260 _GL_CXXALIAS_SYS (wcsftime, size_t,
1261                   (wchar_t *restrict __buf, size_t __bufsize,
1262                    const wchar_t *restrict __fmt,
1263                    const struct tm *restrict __tp));
1264 # endif
1265 # if __GLIBC__ >= 2
1266 _GL_CXXALIASWARN (wcsftime);
1267 # endif
1268 #elif defined GNULIB_POSIXCHECK
1269 # undef wcsftime
1270 # if HAVE_RAW_DECL_WCSFTIME
1271 _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
1272                  "use gnulib module wcsftime for portability");
1273 # endif
1274 #endif
1275 
1276 
1277 #endif /* _@GUARD_PREFIX@_WCHAR_H */
1278 #endif /* _@GUARD_PREFIX@_WCHAR_H */
1279 #endif

/* [previous][next][first][last][top][bottom][index][help] */