From 13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:53:53 +0100 Subject: Update/gnulib 2026 03 (#2247) * Sync with the 202601-stable Gnulib code (4a3650d887) * Ignore more deps stuff in gnulib * Remove autogenerated gnulib files * Ignore more gnulib generated headers --- .gitignore | 11 +- gl/Makefile.am | 70 +- gl/_Noreturn.h | 2 +- gl/af_alg.c | 188 +-- gl/af_alg.h | 2 +- gl/alloca.in.h | 2 +- gl/arg-nonnull.h | 2 +- gl/arpa_inet.c | 5 +- gl/arpa_inet.in.h | 4 +- gl/asnprintf.c | 6 +- gl/asprintf.c | 6 +- gl/assert.in.h | 2 +- gl/attribute.h | 108 +- gl/base64.c | 60 +- gl/base64.h | 2 +- gl/basename-lgpl.c | 11 +- gl/basename-lgpl.h | 2 +- gl/basename.c | 2 +- gl/btowc.c | 2 +- gl/byteswap.c | 5 +- gl/byteswap.in.h | 2 +- gl/c++defs.h | 18 +- gl/c-ctype.c | 5 +- gl/c-ctype.h | 2 +- gl/c32is-impl.h | 4 +- gl/c32isalnum.c | 2 +- gl/c32isalpha.c | 2 +- gl/c32isblank.c | 2 +- gl/c32iscntrl.c | 2 +- gl/c32isdigit.c | 2 +- gl/c32isgraph.c | 2 +- gl/c32islower.c | 2 +- gl/c32isprint.c | 2 +- gl/c32ispunct.c | 2 +- gl/c32isspace.c | 2 +- gl/c32isupper.c | 2 +- gl/c32isxdigit.c | 2 +- gl/c32to-impl.h | 4 +- gl/c32tolower.c | 2 +- gl/c32width.c | 4 +- gl/calloc.c | 4 +- gl/cdefs.h | 2 +- gl/cloexec.c | 2 +- gl/cloexec.h | 2 +- gl/close.c | 2 +- gl/dirname-lgpl.c | 7 +- gl/dirname.c | 2 +- gl/dirname.h | 2 +- gl/dup2.c | 68 +- gl/dynarray.h | 2 +- gl/errno.in.h | 20 +- gl/error.c | 4 +- gl/error.in.h | 2 +- gl/exitfail.c | 2 +- gl/exitfail.h | 2 +- gl/fcntl.c | 185 +-- gl/fcntl.in.h | 59 +- gl/fd-hook.c | 2 +- gl/fd-hook.h | 2 +- gl/fflush.c | 4 +- gl/float+.h | 2 +- gl/float.c | 7 +- gl/float.in.h | 91 +- gl/floor.c | 2 +- gl/floorf.c | 2 +- gl/fopen.c | 47 +- gl/fpurge.c | 4 +- gl/freading.c | 6 +- gl/freading.h | 2 +- gl/free.c | 8 +- gl/fseek.c | 2 +- gl/fseeko.c | 6 +- gl/fseterr.c | 14 +- gl/fseterr.h | 2 +- gl/fstat.c | 11 +- gl/fsusage.c | 21 +- gl/fsusage.h | 2 +- gl/ftell.c | 2 +- gl/ftello.c | 6 +- gl/gai_strerror.c | 7 +- gl/getaddrinfo.c | 91 +- gl/getdelim.c | 111 +- gl/getdtablesize.c | 13 +- gl/gethostname.c | 6 +- gl/getline.c | 2 +- gl/getloadavg.c | 226 ++- gl/getopt-cdefs.in.h | 2 +- gl/getopt-core.h | 2 +- gl/getopt-ext.h | 2 +- gl/getopt-pfx-core.h | 2 +- gl/getopt-pfx-ext.h | 2 +- gl/getopt.c | 65 +- gl/getopt.in.h | 2 +- gl/getopt1.c | 7 +- gl/getopt_int.h | 2 +- gl/getprogname.c | 66 +- gl/getprogname.h | 2 +- gl/gettext.h | 8 +- gl/gl_openssl.h | 4 +- gl/glthread/lock.c | 68 +- gl/glthread/lock.h | 4 +- gl/glthread/once.c | 2 +- gl/glthread/once.h | 2 +- gl/glthread/threadlib.c | 2 +- gl/hard-locale.c | 4 +- gl/hard-locale.h | 2 +- gl/ialloc.c | 5 +- gl/ialloc.h | 2 +- gl/idpriv-droptemp.c | 10 +- gl/idpriv.h | 2 +- gl/idx.h | 2 +- gl/inet_ntop.c | 44 +- gl/inet_pton.c | 229 ++- gl/intprops-internal.h | 14 +- gl/intprops.h | 6 +- gl/inttypes.in.h | 6 +- gl/iswblank.c | 2 +- gl/iswctype-impl.h | 2 +- gl/iswctype.c | 2 +- gl/iswdigit.c | 2 +- gl/iswpunct.c | 2 +- gl/iswxdigit.c | 2 +- gl/itold.c | 2 +- gl/langinfo.in.h | 14 +- gl/lc-charset-dispatch.c | 2 +- gl/lc-charset-dispatch.h | 2 +- gl/libc-config.h | 2 +- gl/limits.in.h | 8 +- gl/localcharset.c | 63 +- gl/localcharset.h | 44 +- gl/locale.in.h | 8 +- gl/localeconv.c | 2 +- gl/lseek.c | 2 +- gl/lstat.c | 11 +- gl/m4/00gnulib.m4 | 2 +- gl/m4/__inline.m4 | 2 +- gl/m4/absolute-header.m4 | 2 +- gl/m4/af_alg.m4 | 2 +- gl/m4/alloca.m4 | 2 +- gl/m4/arpa_inet_h.m4 | 2 +- gl/m4/assert_h.m4 | 9 +- gl/m4/base64.m4 | 2 +- gl/m4/btowc.m4 | 47 +- gl/m4/build-to-host.m4 | 2 +- gl/m4/builtin-expect.m4 | 2 +- gl/m4/byteswap.m4 | 2 +- gl/m4/c-bool.m4 | 2 +- gl/m4/c32rtomb.m4 | 2 +- gl/m4/calloc.m4 | 2 +- gl/m4/close.m4 | 2 +- gl/m4/codeset.m4 | 2 +- gl/m4/double-slash-root.m4 | 2 +- gl/m4/dup2.m4 | 2 +- gl/m4/environ.m4 | 2 +- gl/m4/errno_h.m4 | 59 +- gl/m4/error.m4 | 2 +- gl/m4/error_h.m4 | 2 +- gl/m4/exponentd.m4 | 2 +- gl/m4/extensions-aix.m4 | 2 +- gl/m4/extensions.m4 | 2 +- gl/m4/extern-inline.m4 | 16 +- gl/m4/fclose.m4 | 2 +- gl/m4/fcntl-o.m4 | 2 +- gl/m4/fcntl.m4 | 2 +- gl/m4/fcntl_h.m4 | 8 +- gl/m4/fflush.m4 | 2 +- gl/m4/float_h.m4 | 7 +- gl/m4/floorf.m4 | 2 +- gl/m4/fopen.m4 | 2 +- gl/m4/fpurge.m4 | 2 +- gl/m4/freading.m4 | 2 +- gl/m4/free.m4 | 6 +- gl/m4/fseek.m4 | 2 +- gl/m4/fseeko.m4 | 2 +- gl/m4/fseterr.m4 | 2 +- gl/m4/fstat.m4 | 2 +- gl/m4/fstypename.m4 | 2 +- gl/m4/fsusage.m4 | 45 +- gl/m4/ftell.m4 | 2 +- gl/m4/ftello.m4 | 2 +- gl/m4/getaddrinfo.m4 | 28 +- gl/m4/getdelim.m4 | 51 +- gl/m4/getdtablesize.m4 | 2 +- gl/m4/gethostname.m4 | 2 +- gl/m4/getline.m4 | 51 +- gl/m4/getloadavg.m4 | 7 +- gl/m4/getopt.m4 | 13 +- gl/m4/getprogname.m4 | 10 +- gl/m4/gettext_h.m4 | 21 + gl/m4/gl-openssl.m4 | 17 +- gl/m4/gnulib-cache.m4 | 2 +- gl/m4/gnulib-common.m4 | 117 +- gl/m4/gnulib-comp.m4 | 71 +- gl/m4/gnulib-i18n.m4 | 2 +- gl/m4/gnulib-tool.m4 | 2 +- gl/m4/hostent.m4 | 2 +- gl/m4/idpriv.m4 | 2 +- gl/m4/include_next.m4 | 2 +- gl/m4/inet_ntop.m4 | 7 +- gl/m4/inet_pton.m4 | 7 +- gl/m4/intmax_t.m4 | 2 +- gl/m4/inttypes.m4 | 2 +- gl/m4/inttypes_h.m4 | 2 +- gl/m4/iswblank.m4 | 2 +- gl/m4/iswctype.m4 | 2 +- gl/m4/iswdigit.m4 | 2 +- gl/m4/iswpunct.m4 | 2 +- gl/m4/iswxdigit.m4 | 2 +- gl/m4/langinfo_h.m4 | 33 +- gl/m4/largefile.m4 | 7 +- gl/m4/libunistring-base.m4 | 2 +- gl/m4/limits-h.m4 | 2 +- gl/m4/localcharset.m4 | 2 +- gl/m4/locale-en.m4 | 4 +- gl/m4/locale-fr.m4 | 8 +- gl/m4/locale-ja.m4 | 8 +- gl/m4/locale-zh.m4 | 2 +- gl/m4/locale_h.m4 | 8 +- gl/m4/localeconv.m4 | 2 +- gl/m4/lock.m4 | 8 +- gl/m4/lseek.m4 | 2 +- gl/m4/lstat.m4 | 2 +- gl/m4/malloc.m4 | 58 +- gl/m4/malloca.m4 | 2 +- gl/m4/math_h.m4 | 37 +- gl/m4/mbchar.m4 | 2 +- gl/m4/mbiter.m4 | 2 +- gl/m4/mbrtoc32.m4 | 2 +- gl/m4/mbrtowc.m4 | 73 +- gl/m4/mbsinit.m4 | 2 +- gl/m4/mbstate_t.m4 | 2 +- gl/m4/mbtowc.m4 | 2 +- gl/m4/memchr.m4 | 35 +- gl/m4/minmax.m4 | 2 +- gl/m4/mktime.m4 | 26 +- gl/m4/mmap-anon.m4 | 21 +- gl/m4/mode_t.m4 | 2 +- gl/m4/mountlist.m4 | 15 +- gl/m4/msvc-inval.m4 | 2 +- gl/m4/msvc-nothrow.m4 | 2 +- gl/m4/multiarch.m4 | 2 +- gl/m4/musl.m4 | 2 +- gl/m4/netdb_h.m4 | 2 +- gl/m4/netinet_in_h.m4 | 2 +- gl/m4/nl_langinfo.m4 | 31 +- gl/m4/nocrash.m4 | 2 +- gl/m4/off64_t.m4 | 2 +- gl/m4/off_t.m4 | 2 +- gl/m4/once.m4 | 2 +- gl/m4/open-cloexec.m4 | 2 +- gl/m4/open-slash.m4 | 2 +- gl/m4/open.m4 | 2 +- gl/m4/pathmax.m4 | 2 +- gl/m4/pid_t.m4 | 2 +- gl/m4/printf.m4 | 35 +- gl/m4/pthread-once.m4 | 2 +- gl/m4/pthread-spin.m4 | 2 +- gl/m4/pthread_h.m4 | 2 +- gl/m4/pthread_rwlock_rdlock.m4 | 4 +- gl/m4/realloc.m4 | 4 +- gl/m4/reallocarray.m4 | 2 +- gl/m4/regex.m4 | 2 +- gl/m4/sched_h.m4 | 2 +- gl/m4/servent.m4 | 2 +- gl/m4/setenv.m4 | 6 +- gl/m4/setlocale_null.m4 | 12 +- gl/m4/sha256.m4 | 2 +- gl/m4/size_max.m4 | 2 +- gl/m4/snprintf.m4 | 2 +- gl/m4/socketlib.m4 | 2 +- gl/m4/sockets.m4 | 2 +- gl/m4/socklen.m4 | 6 +- gl/m4/sockpfaf.m4 | 2 +- gl/m4/ssize_t.m4 | 2 +- gl/m4/stat-time.m4 | 2 +- gl/m4/stat.m4 | 2 +- gl/m4/std-gnu11.m4 | 4 +- gl/m4/stdalign.m4 | 10 +- gl/m4/stdckdint_h.m4 | 2 +- gl/m4/stddef_h.m4 | 6 +- gl/m4/stdint.m4 | 10 +- gl/m4/stdint_h.m4 | 2 +- gl/m4/stdio_h.m4 | 2 +- gl/m4/stdlib_h.m4 | 6 +- gl/m4/strcasecmp.m4 | 2 +- gl/m4/strcasestr.m4 | 6 +- gl/m4/strerror.m4 | 2 +- gl/m4/string_h.m4 | 7 +- gl/m4/stringeq.m4 | 25 + gl/m4/strings_h.m4 | 2 +- gl/m4/strncasecmp.m4 | 2 +- gl/m4/strncpy.m4 | 2 +- gl/m4/strsep.m4 | 2 +- gl/m4/strstr.m4 | 6 +- gl/m4/sys_cdefs_h.m4 | 2 +- gl/m4/sys_socket_h.m4 | 15 +- gl/m4/sys_stat_h.m4 | 4 +- gl/m4/sys_types_h.m4 | 2 +- gl/m4/sys_uio_h.m4 | 2 +- gl/m4/threadlib.m4 | 45 +- gl/m4/time_h.m4 | 2 +- gl/m4/time_r.m4 | 2 +- gl/m4/timegm.m4 | 2 +- gl/m4/uchar_h.m4 | 2 +- gl/m4/ungetc.m4 | 2 +- gl/m4/unicase_h.m4 | 2 +- gl/m4/unictype_h.m4 | 2 +- gl/m4/uninorm_h.m4 | 2 +- gl/m4/unistd_h.m4 | 2 +- gl/m4/unitypes_h.m4 | 2 +- gl/m4/unlocked-io.m4 | 5 +- gl/m4/vararrays.m4 | 2 +- gl/m4/vasnprintf.m4 | 2 +- gl/m4/vasprintf.m4 | 2 +- gl/m4/visibility.m4 | 2 +- gl/m4/vsnprintf.m4 | 2 +- gl/m4/warn-on-use.m4 | 2 +- gl/m4/wchar_h.m4 | 10 +- gl/m4/wcrtomb.m4 | 10 +- gl/m4/wctype.m4 | 2 +- gl/m4/wctype_h.m4 | 2 +- gl/m4/wcwidth.m4 | 6 +- gl/m4/wint_t.m4 | 2 +- gl/m4/xalloc.m4 | 2 +- gl/m4/xsize.m4 | 2 +- gl/m4/zzgnulib.m4 | 2 +- gl/malloc.c | 2 +- gl/malloc/dynarray-skeleton.c | 2 +- gl/malloc/dynarray.h | 2 +- gl/malloc/dynarray_at_failure.c | 2 +- gl/malloc/dynarray_emplace_enlarge.c | 2 +- gl/malloc/dynarray_finalize.c | 2 +- gl/malloc/dynarray_resize.c | 2 +- gl/malloc/dynarray_resize_clear.c | 2 +- gl/malloca.c | 2 +- gl/malloca.h | 2 +- gl/math.c | 2 +- gl/math.in.h | 269 ++-- gl/mbchar.c | 5 +- gl/mbchar.h | 17 +- gl/mbiterf.c | 5 +- gl/mbiterf.h | 4 +- gl/mbrtoc32.c | 6 +- gl/mbrtowc-impl-utf8.h | 2 +- gl/mbrtowc-impl.h | 29 +- gl/mbrtowc.c | 11 +- gl/mbsinit.c | 2 +- gl/mbsnlen.c | 2 +- gl/mbszero.c | 2 +- gl/mbtowc-impl.h | 9 +- gl/mbtowc-lock.c | 2 +- gl/mbtowc-lock.h | 17 +- gl/mbtowc.c | 2 +- gl/memchr.c | 174 ++- gl/memchr.valgrind | 2 +- gl/minmax.h | 6 +- gl/mktime-internal.h | 2 +- gl/mktime.c | 8 +- gl/mountlist.c | 399 +++--- gl/mountlist.h | 2 +- gl/msvc-inval.c | 2 +- gl/msvc-inval.h | 6 +- gl/msvc-nothrow.c | 2 +- gl/msvc-nothrow.h | 2 +- gl/netdb.in.h | 10 +- gl/netinet_in.in.h | 2 +- gl/nl_langinfo-lock.c | 2 +- gl/nl_langinfo.c | 35 +- gl/open.c | 12 +- gl/pathmax.h | 2 +- gl/printf-args.c | 2 +- gl/printf-args.h | 2 +- gl/printf-parse.c | 16 +- gl/printf-parse.h | 2 +- gl/pthread-once.c | 2 +- gl/pthread.h | 2571 ---------------------------------- gl/pthread.in.h | 53 +- gl/realloc.c | 6 +- gl/reallocarray.c | 2 +- gl/regcomp.c | 2 +- gl/regex.c | 3 +- gl/regex.h | 2 +- gl/regex_internal.c | 2 +- gl/regex_internal.h | 20 +- gl/regexec.c | 2 +- gl/sched.h | 631 --------- gl/sched.in.h | 5 +- gl/setenv.c | 22 +- gl/setlocale-lock.c | 2 +- gl/setlocale_null-unlocked.c | 10 +- gl/setlocale_null.c | 15 +- gl/setlocale_null.h | 2 +- gl/sha256-stream.c | 7 +- gl/sha256.c | 19 +- gl/sha256.h | 2 +- gl/size_max.h | 2 +- gl/snprintf.c | 6 +- gl/sockets.c | 21 +- gl/sockets.h | 2 +- gl/stat-time.c | 5 +- gl/stat-time.h | 5 +- gl/stat-w32.c | 7 +- gl/stat-w32.h | 2 +- gl/stat.c | 16 +- gl/stdckdint.in.h | 2 +- gl/stddef.in.h | 6 +- gl/stdint.in.h | 19 +- gl/stdio-consolesafe.c | 11 +- gl/stdio-impl.h | 2 +- gl/stdio-read.c | 13 +- gl/stdio-write.c | 13 +- gl/stdio.in.h | 84 +- gl/stdlib.c | 2 +- gl/stdlib.in.h | 84 +- gl/str-two-way.h | 283 ++-- gl/strcasecmp.c | 35 +- gl/strcasestr.c | 41 +- gl/streq.h | 4 +- gl/strerror-override.c | 2 +- gl/strerror-override.h | 2 +- gl/strerror.c | 5 +- gl/string.c | 19 + gl/string.in.h | 80 +- gl/strings.in.h | 7 +- gl/stripslash.c | 8 +- gl/strncasecmp.c | 35 +- gl/strncpy.c | 4 +- gl/strsep.c | 5 +- gl/strstr.c | 32 +- gl/sys-limits.h | 6 +- gl/sys_socket.c | 2 +- gl/sys_socket.in.h | 20 +- gl/sys_stat.in.h | 21 +- gl/sys_types.in.h | 2 +- gl/sys_uio.in.h | 2 +- gl/time.in.h | 27 +- gl/time_r.c | 2 +- gl/timegm.c | 2 +- gl/uchar.h | 1456 ------------------- gl/uchar.in.h | 5 +- gl/unicase.h | 472 ------- gl/unicase.in.h | 2 +- gl/unicase/simple-mapping.h | 2 +- gl/unicase/tolower.c | 2 +- gl/unicase/tolower.h | 30 +- gl/unictype.h | 1148 --------------- gl/unictype.in.h | 5 +- gl/unictype/bitmap.h | 2 +- gl/unictype/ctype_alnum.c | 2 +- gl/unictype/ctype_alnum.h | 102 +- gl/unictype/ctype_alpha.c | 2 +- gl/unictype/ctype_alpha.h | 102 +- gl/unictype/ctype_blank.c | 2 +- gl/unictype/ctype_blank.h | 4 +- gl/unictype/ctype_cntrl.c | 2 +- gl/unictype/ctype_cntrl.h | 4 +- gl/unictype/ctype_digit.c | 2 +- gl/unictype/ctype_digit.h | 4 +- gl/unictype/ctype_graph.c | 2 +- gl/unictype/ctype_graph.h | 134 +- gl/unictype/ctype_lower.c | 2 +- gl/unictype/ctype_lower.h | 8 +- gl/unictype/ctype_print.c | 2 +- gl/unictype/ctype_print.h | 134 +- gl/unictype/ctype_punct.c | 2 +- gl/unictype/ctype_punct.h | 50 +- gl/unictype/ctype_space.c | 2 +- gl/unictype/ctype_space.h | 4 +- gl/unictype/ctype_upper.c | 2 +- gl/unictype/ctype_upper.h | 8 +- gl/unictype/ctype_xdigit.c | 2 +- gl/unictype/ctype_xdigit.h | 4 +- gl/uninorm.h | 256 ---- gl/uninorm.in.h | 2 +- gl/unistd.c | 2 +- gl/unistd.in.h | 97 +- gl/unitypes.h | 72 - gl/unitypes.in.h | 2 +- gl/uniwidth.h | 73 - gl/uniwidth.in.h | 2 +- gl/uniwidth/cjk.h | 2 +- gl/uniwidth/width.c | 6 +- gl/uniwidth/width0.h | 23 +- gl/uniwidth/width2.h | 4 +- gl/unlocked-io.h | 9 +- gl/unsetenv.c | 11 +- gl/vasnprintf.c | 674 ++++----- gl/vasnprintf.h | 2 +- gl/vasprintf.c | 2 +- gl/verify.h | 2 +- gl/vsnprintf.c | 2 +- gl/vsnzprintf.c | 9 +- gl/w32sock.h | 2 +- gl/warn-on-use.h | 2 +- gl/wchar.in.h | 72 +- gl/wcrtomb.c | 6 +- gl/wctype-h.c | 2 +- gl/wctype-impl.h | 26 +- gl/wctype.c | 2 +- gl/wctype.in.h | 28 +- gl/wcwidth.c | 2 +- gl/windows-initguard.h | 2 +- gl/windows-mutex.c | 2 +- gl/windows-mutex.h | 2 +- gl/windows-once.c | 2 +- gl/windows-once.h | 2 +- gl/windows-recmutex.c | 2 +- gl/windows-recmutex.h | 2 +- gl/windows-rwlock.c | 24 +- gl/windows-rwlock.h | 2 +- gl/xalloc-die.c | 4 +- gl/xalloc-oversized.h | 2 +- gl/xalloc.h | 2 +- gl/xmalloc.c | 18 +- gl/xsize.c | 5 +- gl/xsize.h | 2 +- 516 files changed, 3347 insertions(+), 11098 deletions(-) create mode 100644 gl/m4/gettext_h.m4 create mode 100644 gl/m4/stringeq.m4 delete mode 100644 gl/pthread.h delete mode 100644 gl/sched.h create mode 100644 gl/string.c delete mode 100644 gl/uchar.h delete mode 100644 gl/unicase.h delete mode 100644 gl/unictype.h delete mode 100644 gl/uninorm.h delete mode 100644 gl/unitypes.h delete mode 100644 gl/uniwidth.h diff --git a/.gitignore b/.gitignore index d0115b05..4d49c220 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ NP-VERSION-FILE # /gl/ /gl/.deps +/gl/*/.deps /gl/alloca.h /gl/arpa /gl/arpa_inet.h @@ -93,9 +94,17 @@ NP-VERSION-FILE /gl/wctype.h /gl/inttypes.h /gl/limits.h +/gl/pthread.h +/gl/sched.h +/gl/uchar.h +/gl/unicase.h +/gl/unictype.h +/gl/uninorm.h +/gl/unitypes.h +/gl/uniwidth.h +/gl/stdckdint.h /gl/malloc/dynarray-skeleton.gl.h /gl/malloc/dynarray.gl.h -/gl/stdckdint.h # /lib/ /lib/.deps diff --git a/gl/Makefile.am b/gl/Makefile.am index f462fdb7..6f50b0c5 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2025 Free Software Foundation, Inc. +# Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,6 +59,7 @@ AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects SUBDIRS = +TESTS_ENVIRONMENT = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = @@ -449,12 +450,6 @@ errno.h: errno.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ - -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ - -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ - -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ - -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ - -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ - -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ $(srcdir)/errno.in.h > $@-t $(AM_V_at)mv $@-t $@ else @@ -533,10 +528,12 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_NONBLOCKING''@/$(GL_GNULIB_NONBLOCKING)/g' \ -e 's/@''GNULIB_OPEN''@/$(GL_GNULIB_OPEN)/g' \ -e 's/@''GNULIB_OPENAT''@/$(GL_GNULIB_OPENAT)/g' \ + -e 's/@''GNULIB_OPENAT2''@/$(GL_GNULIB_OPENAT2)/g' \ -e 's/@''GNULIB_MDA_CREAT''@/$(GL_GNULIB_MDA_CREAT)/g' \ -e 's/@''GNULIB_MDA_OPEN''@/$(GL_GNULIB_MDA_OPEN)/g' \ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''HAVE_OPENAT2''@|$(HAVE_OPENAT2)|g' \ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ @@ -1055,11 +1052,9 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ - -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ABALTMON''@|$(HAVE_LANGINFO_ABALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ - -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -1284,8 +1279,11 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_ILOGBF''@/$(GL_GNULIB_ILOGBF)/g' \ -e 's/@''GNULIB_ILOGBL''@/$(GL_GNULIB_ILOGBL)/g' \ -e 's/@''GNULIB_ISFINITE''@/$(GL_GNULIB_ISFINITE)/g' \ + -e 's/@''GNULIB_ISFINITE_NO_CXX''@/$(GL_GNULIB_ISFINITE_NO_CXX)/g' \ -e 's/@''GNULIB_ISINF''@/$(GL_GNULIB_ISINF)/g' \ + -e 's/@''GNULIB_ISINF_NO_CXX''@/$(GL_GNULIB_ISINF_NO_CXX)/g' \ -e 's/@''GNULIB_ISNAN''@/$(GL_GNULIB_ISNAN)/g' \ + -e 's/@''GNULIB_ISNAN_NO_CXX''@/$(GL_GNULIB_ISNAN_NO_CXX)/g' \ -e 's/@''GNULIB_ISNANF''@/$(GL_GNULIB_ISNANF)/g' \ -e 's/@''GNULIB_ISNAND''@/$(GL_GNULIB_ISNAND)/g' \ -e 's/@''GNULIB_ISNANL''@/$(GL_GNULIB_ISNANL)/g' \ @@ -1330,6 +1328,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_SETPAYLOADSIGF''@/$(GL_GNULIB_SETPAYLOADSIGF)/g' \ -e 's/@''GNULIB_SETPAYLOADSIGL''@/$(GL_GNULIB_SETPAYLOADSIGL)/g' \ -e 's/@''GNULIB_SIGNBIT''@/$(GL_GNULIB_SIGNBIT)/g' \ + -e 's/@''GNULIB_SIGNBIT_NO_CXX''@/$(GL_GNULIB_SIGNBIT_NO_CXX)/g' \ -e 's/@''GNULIB_SINF''@/$(GL_GNULIB_SINF)/g' \ -e 's/@''GNULIB_SINL''@/$(GL_GNULIB_SINL)/g' \ -e 's/@''GNULIB_SINHF''@/$(GL_GNULIB_SINHF)/g' \ @@ -1366,14 +1365,19 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \ -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \ -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \ + -e 's|@''HAVE_COPYSIGNF''@|$(HAVE_COPYSIGNF)|g' \ -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \ -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \ -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \ -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \ -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \ -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \ + -e 's|@''HAVE_EXP2''@|$(HAVE_EXP2)|g' \ + -e 's|@''HAVE_EXP2F''@|$(HAVE_EXP2F)|g' \ + -e 's|@''HAVE_EXP2L''@|$(HAVE_EXP2L)|g' \ -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \ -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \ + -e 's|@''HAVE_EXPM1L''@|$(HAVE_EXPM1L)|g' \ -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \ -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \ -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \ @@ -1401,6 +1405,9 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \ -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \ -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \ + -e 's|@''HAVE_LOG2''@|$(HAVE_LOG2)|g' \ + -e 's|@''HAVE_LOG2F''@|$(HAVE_LOG2F)|g' \ + -e 's|@''HAVE_LOG2L''@|$(HAVE_LOG2L)|g' \ -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \ -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \ -e 's|@''HAVE_LOGP1''@|$(HAVE_LOGP1)|g' \ @@ -1411,8 +1418,13 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \ -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \ -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \ + -e 's|@''HAVE_REMAINDERL''@|$(HAVE_REMAINDERL)|g' \ -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \ + -e 's|@''HAVE_RINTF''@|$(HAVE_RINTF)|g' \ -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \ + -e 's|@''HAVE_ROUND''@|$(HAVE_ROUND)|g' \ + -e 's|@''HAVE_ROUNDF''@|$(HAVE_ROUNDF)|g' \ + -e 's|@''HAVE_ROUNDL''@|$(HAVE_ROUNDL)|g' \ -e 's|@''HAVE_SETPAYLOAD''@|$(HAVE_SETPAYLOAD)|g' \ -e 's|@''HAVE_SETPAYLOADF''@|$(HAVE_SETPAYLOADF)|g' \ -e 's|@''HAVE_SETPAYLOADL''@|$(HAVE_SETPAYLOADL)|g' \ @@ -1438,33 +1450,17 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ - -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \ - -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \ -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \ -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \ - -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \ -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ - -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \ - -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \ - -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \ - -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \ -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \ -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \ -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \ - -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \ - -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \ - -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \ -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \ - -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \ - -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \ - -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \ - -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \ - -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \ - -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \ -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ @@ -2395,9 +2391,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(AM_V_at)mv $@-t3 $@ MOSTLYCLEANFILES += stdio.h stdio.h-t1 stdio.h-t2 stdio.h-t3 -if GL_COND_OBJ_STDIO_CONSOLESAFE -libgnu_a_SOURCES += stdio-consolesafe.c -endif if GL_COND_OBJ_STDIO_READ libgnu_a_SOURCES += stdio-read.c endif @@ -2409,6 +2402,14 @@ EXTRA_DIST += stdio.in.h ## end gnulib module stdio-h +## begin gnulib module stdio-windows + +if GL_COND_OBJ_STDIO_CONSOLESAFE +libgnu_a_SOURCES += stdio-consolesafe.c +endif + +## end gnulib module stdio-windows + ## begin gnulib module stdlib-h BUILT_SOURCES += stdlib.h @@ -2503,7 +2504,6 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ - -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ @@ -2521,6 +2521,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_SYS_PROCESS_H''@|$(HAVE_SYS_PROCESS_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ < $@-t1 > $@-t2 @@ -2674,6 +2675,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \ -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \ -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRINGEQ''@/$(GL_GNULIB_STRINGEQ)/g' \ -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \ -e 's/@''GNULIB_STRNCPY''@/$(GL_GNULIB_STRNCPY)/g' \ -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \ @@ -2702,6 +2704,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_DECL_MEMEQ''@|$(HAVE_DECL_MEMEQ)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -2711,6 +2714,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STREQ''@|$(HAVE_DECL_STREQ)|g' \ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ @@ -2760,6 +2764,12 @@ EXTRA_DIST += string.in.h ## end gnulib module string-h +## begin gnulib module stringeq + +libgnu_a_SOURCES += string.c + +## end gnulib module stringeq + ## begin gnulib module strings-h BUILT_SOURCES += strings.h @@ -3918,7 +3928,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ - -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_WCTOB''@|$(HAVE_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ < $@-t1 > $@-t2 diff --git a/gl/_Noreturn.h b/gl/_Noreturn.h index d42f15ee..0bab051e 100644 --- a/gl/_Noreturn.h +++ b/gl/_Noreturn.h @@ -1,5 +1,5 @@ /* A C macro for declaring that a function does not return. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published diff --git a/gl/af_alg.c b/gl/af_alg.c index cfa96954..91f3df15 100644 --- a/gl/af_alg.c +++ b/gl/af_alg.c @@ -1,5 +1,5 @@ /* af_alg.c - Compute message digests from file streams and buffers. - Copyright (C) 2018-2025 Free Software Foundation, Inc. + Copyright (C) 2018-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -112,100 +112,102 @@ afalg_stream (FILE *stream, const char *alg, read-write loop work around an empty-input bug noted below. */ int fd = fileno (stream); int result; - struct stat st; - off_t off = ftello (stream); - if (0 <= off && fstat (fd, &st) == 0 - && (S_ISREG (st.st_mode) || S_TYPEISSHM (&st) || S_TYPEISTMO (&st)) - && off < st.st_size && st.st_size - off < SYS_BUFSIZE_MAX) - { - /* Make sure the offset of fileno (stream) reflects how many bytes - have been read from stream before this function got invoked. - Note: fflush on an input stream after ungetc does not work as expected - on some platforms. Therefore this situation is not supported here. */ - if (fflush (stream)) - result = -EIO; - else - { - off_t nbytes = st.st_size - off; - if (sendfile (ofd, fd, &off, nbytes) == nbytes) - { - if (read (ofd, resblock, hashlen) == hashlen) - { - /* The input buffers of stream are no longer valid. */ - if (lseek (fd, off, SEEK_SET) != (off_t)-1) - result = 0; - else - /* The file position of fd has not changed. */ + { + struct stat st; + off_t off = ftello (stream); + if (0 <= off && fstat (fd, &st) == 0 + && (S_ISREG (st.st_mode) || S_TYPEISSHM (&st) || S_TYPEISTMO (&st)) + && off < st.st_size && st.st_size - off < SYS_BUFSIZE_MAX) + { + /* Make sure the offset of fileno (stream) reflects how many bytes + have been read from stream before this function got invoked. + Note: fflush on an input stream after ungetc does not work as expected + on some platforms. Therefore this situation is not supported here. */ + if (fflush (stream)) + result = -EIO; + else + { + off_t nbytes = st.st_size - off; + if (sendfile (ofd, fd, &off, nbytes) == nbytes) + { + if (read (ofd, resblock, hashlen) == hashlen) + { + /* The input buffers of stream are no longer valid. */ + if (lseek (fd, off, SEEK_SET) != (off_t)-1) + result = 0; + else + /* The file position of fd has not changed. */ + result = -EAFNOSUPPORT; + } + else + /* The file position of fd has not changed. */ + result = -EAFNOSUPPORT; + } + else + /* The file position of fd has not changed. */ + result = -EAFNOSUPPORT; + } + } + else + { + /* sendfile not possible, do a classic read-write loop. */ + + /* Number of bytes to seek (backwards) in case of error. */ + off_t nseek = 0; + + for (;;) + { + char buf[BLOCKSIZE]; + /* When the stream is not seekable, start with a single-byte block, + so that we can use ungetc() in the case that send() fails. */ + size_t blocksize = (nseek == 0 && off < 0 ? 1 : BLOCKSIZE); + ssize_t size = fread (buf, 1, blocksize, stream); + if (size == 0) + { + /* On Linux < 4.9, the value for an empty stream is wrong (all 0). + See . + This was not fixed properly until November 2016, + see . */ + result = ferror (stream) ? -EIO : nseek == 0 ? -EAFNOSUPPORT : 0; + break; + } + nseek -= size; + if (send (ofd, buf, size, MSG_MORE) != size) + { + if (nseek == -1) + { + /* 1 byte of pushback buffer is guaranteed on stream, even + if stream is not seekable. */ + ungetc ((unsigned char) buf[0], stream); result = -EAFNOSUPPORT; - } - else - /* The file position of fd has not changed. */ - result = -EAFNOSUPPORT; - } - else - /* The file position of fd has not changed. */ - result = -EAFNOSUPPORT; - } - } - else - { - /* sendfile not possible, do a classic read-write loop. */ - - /* Number of bytes to seek (backwards) in case of error. */ - off_t nseek = 0; - - for (;;) - { - char buf[BLOCKSIZE]; - /* When the stream is not seekable, start with a single-byte block, - so that we can use ungetc() in the case that send() fails. */ - size_t blocksize = (nseek == 0 && off < 0 ? 1 : BLOCKSIZE); - ssize_t size = fread (buf, 1, blocksize, stream); - if (size == 0) - { - /* On Linux < 4.9, the value for an empty stream is wrong (all 0). - See . - This was not fixed properly until November 2016, - see . */ - result = ferror (stream) ? -EIO : nseek == 0 ? -EAFNOSUPPORT : 0; - break; - } - nseek -= size; - if (send (ofd, buf, size, MSG_MORE) != size) - { - if (nseek == -1) - { - /* 1 byte of pushback buffer is guaranteed on stream, even - if stream is not seekable. */ - ungetc ((unsigned char) buf[0], stream); + } + else if (fseeko (stream, nseek, SEEK_CUR) == 0) + /* The position of stream has been restored. */ result = -EAFNOSUPPORT; - } - else if (fseeko (stream, nseek, SEEK_CUR) == 0) - /* The position of stream has been restored. */ - result = -EAFNOSUPPORT; - else - result = -EIO; - break; - } - - /* Don't assume that EOF is sticky. See: - . */ - if (feof (stream)) - { - result = 0; - break; - } - } - - if (result == 0 && read (ofd, resblock, hashlen) != hashlen) - { - if (nseek == 0 || fseeko (stream, nseek, SEEK_CUR) == 0) - /* The position of stream has been restored. */ - result = -EAFNOSUPPORT; - else - result = -EIO; - } - } + else + result = -EIO; + break; + } + + /* Don't assume that EOF is sticky. See: + . */ + if (feof (stream)) + { + result = 0; + break; + } + } + + if (result == 0 && read (ofd, resblock, hashlen) != hashlen) + { + if (nseek == 0 || fseeko (stream, nseek, SEEK_CUR) == 0) + /* The position of stream has been restored. */ + result = -EAFNOSUPPORT; + else + result = -EIO; + } + } + } close (ofd); return result; } diff --git a/gl/af_alg.h b/gl/af_alg.h index 236659bc..1321970f 100644 --- a/gl/af_alg.h +++ b/gl/af_alg.h @@ -1,5 +1,5 @@ /* af_alg.h - Compute message digests from file streams and buffers. - Copyright (C) 2018-2025 Free Software Foundation, Inc. + Copyright (C) 2018-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/alloca.in.h b/gl/alloca.in.h index afb00caf..bb2cb881 100644 --- a/gl/alloca.in.h +++ b/gl/alloca.in.h @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2025 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/arg-nonnull.h b/gl/arg-nonnull.h index 747bb413..d370d139 100644 --- a/gl/arg-nonnull.h +++ b/gl/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published diff --git a/gl/arpa_inet.c b/gl/arpa_inet.c index fae7c241..d0ff3a31 100644 --- a/gl/arpa_inet.c +++ b/gl/arpa_inet.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2024-2025 Free Software Foundation, Inc. + Copyright (C) 2024-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define _GL_ARPA_INET_INLINE _GL_EXTERN_INLINE +#include #include diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h index d7417bfd..a9c93d07 100644 --- a/gl/arpa_inet.in.h +++ b/gl/arpa_inet.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -159,7 +159,6 @@ _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *, _GL_CXXALIASWARN (inet_ntop); # endif #elif defined GNULIB_POSIXCHECK -# undef inet_ntop # if HAVE_RAW_DECL_INET_NTOP _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - " "use gnulib module inet_ntop for portability"); @@ -190,7 +189,6 @@ _GL_CXXALIAS_SYS (inet_pton, int, _GL_CXXALIASWARN (inet_pton); # endif #elif defined GNULIB_POSIXCHECK -# undef inet_pton # if HAVE_RAW_DECL_INET_PTON _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - " "use gnulib module inet_pton for portability"); diff --git a/gl/asnprintf.c b/gl/asnprintf.c index 0488b6be..05582499 100644 --- a/gl/asnprintf.c +++ b/gl/asnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -25,10 +25,8 @@ char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) { va_list args; - char *result; - va_start (args, format); - result = vasnprintf (resultbuf, lengthp, format, args); + char *result = vasnprintf (resultbuf, lengthp, format, args); va_end (args); return result; } diff --git a/gl/asprintf.c b/gl/asprintf.c index 336700be..5da2d085 100644 --- a/gl/asprintf.c +++ b/gl/asprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2007, 2009-2025 Free Software Foundation, + Copyright (C) 1999, 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -30,10 +30,8 @@ int asprintf (char **resultp, const char *format, ...) { va_list args; - int result; - va_start (args, format); - result = vasprintf (resultp, format, args); + int result = vasprintf (resultp, format, args); va_end (args); return result; } diff --git a/gl/assert.in.h b/gl/assert.in.h index 87339abc..8a564670 100644 --- a/gl/assert.in.h +++ b/gl/assert.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/attribute.h b/gl/attribute.h index c85412d9..c50befdf 100644 --- a/gl/attribute.h +++ b/gl/attribute.h @@ -1,6 +1,6 @@ /* ATTRIBUTE_* macros for using attributes in GCC and similar compilers - Copyright 2020-2025 Free Software Foundation, Inc. + Copyright 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -89,7 +89,7 @@ _GL_ATTRIBUTE_NONNULL_IF_NONZERO, _GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE, _GL_ATTRIBUTE_RETURNS_NONNULL, - _GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNSEQUENCED. */ + _GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNSEQUENCED, _GL_UNNAMED. */ #if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif @@ -240,62 +240,68 @@ /* Applies to: functions. */ #define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE -/* It is OK for a compiler to move calls to the function and to omit - calls to the function if another call has the same arguments or the - result is not used. - This attribute is safe for a function that neither depends on - nor affects state, and always returns exactly once - +/* It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached return value, even if the state changes between calls. + It is also OK to omit a call if the result is not used. + This attribute is safe if the function does not change observable state, + returns a value determined solely by its arguments' values + without examining state, and always returns exactly once - e.g., does not raise an exception, call longjmp, or loop forever. - (This attribute is stricter than ATTRIBUTE_PURE because the - function cannot observe state. It is stricter than UNSEQUENCED - because the function must return exactly once and cannot depend on - state addressed by its arguments.) */ + (This attribute is stricter than _GL_ATTRIBUTE_PURE because the + function cannot observe state. Unlike _GL_ATTRIBUTE_UNSEQUENCED + the function must return exactly once and cannot access state + addressed by its pointer arguments or that happens to have the same + value for all calls to the function, but the function is allowed to + return a pointer to storage that can be modified later. */ /* Applies to: functions. */ #define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST -/* It is OK for a compiler to move calls to the function and to omit duplicate - calls to the function with the same arguments, so long as the state - addressed by its arguments is the same. +/* It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached value returned either directly or indirectly via + a pointer, if the state addressed by its pointer arguments is the same; + however, pointer arguments cannot alias. This attribute is safe for a function that is effectless, idempotent, - stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of + stateless, and independent; see ISO C 23 § 6.7.13.8 for a definition of these terms. - (This attribute is stricter than REPRODUCIBLE because the function - must be stateless and independent. It is looser than ATTRIBUTE_CONST - because the function need not return exactly once and can depend - on state addressed by its arguments.) + (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because + the function must be stateless and independent. Unlike + _GL_ATTRIBUTE_CONST the function need not return exactly once, and + can depend on state accessed via its pointer arguments or that + happens to have the same value for all calls to the function, but + the function cannot return a pointer to storage whose contents + change later.) See also and - . - ATTENTION! Efforts are underway to change the meaning of this attribute. - See . */ + . */ /* Applies to: functions, pointer to functions, function type. */ #define UNSEQUENCED _GL_ATTRIBUTE_UNSEQUENCED -/* It is OK for a compiler to move calls to the function and to omit - calls to the function if another call has the same arguments or the - result is not used, and if observable state is the same. - This attribute is safe for a function that does not affect observable state - and always returns exactly once. - (This attribute is looser than ATTRIBUTE_CONST because the function - can depend on observable state. It is stricter than REPRODUCIBLE - because the function must return exactly once and cannot affect - state addressed by its arguments.) */ +/* It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached return value, if observable state is the same. + It is also OK to omit a call if the return value is not used. + This attribute is safe if the function does not change observable state, + returns a value determined solely by its arguments's values + together with observable state, and always returns exactly once. + (This attribute is looser than _GL_ATTRIBUTE_CONST because the function + can depend on observable state. + Unlike _GL_ATTRIBUTE_REPRODUCIBLE the function must return exactly + once and cannot change state addressed by its arguments, but the + function can return a pointer to storage whose contents change later.) */ /* Applies to: functions. */ #define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE -/* It is OK for a compiler to move calls to the function and to omit duplicate - calls to the function with the same arguments, so long as the state - addressed by its arguments is the same and is updated in time for - the rest of the program. - This attribute is safe for a function that is effectless and idempotent; see - ISO C 23 § 6.7.12.7 for a definition of these terms. - (This attribute is looser than UNSEQUENCED because the function need - not be stateless and idempotent. It is looser than ATTRIBUTE_PURE - because the function need not return exactly once and can affect - state addressed by its arguments.) +/* It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached value returned either directly or indirectly via + a pointer, if other observable state is the same; + however, pointer arguments cannot alias. + This attribute is safe for a function that is effectless and idempotent; + see ISO C 23 § 6.7.13.8 for a definition of these terms. + (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because + the function need not be stateless or independent. + Unlike _GL_ATTRIBUTE_PURE the function need not return exactly once + and can change state addressed by its pointer arguments, but the + function cannot return a pointer to storage whose contents change later.) See also and - . - ATTENTION! Efforts are underway to change the meaning of this attribute. - See . */ + . */ /* Applies to: functions, pointer to functions, function type. */ #define REPRODUCIBLE _GL_ATTRIBUTE_REPRODUCIBLE @@ -328,4 +334,18 @@ #define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS +/* ==================== Unnamed function parameters ======================== */ + +/* Although UNNAMED is not an attribute, it is related to MAYBE_UNUSED + and so is defined here for convenience. */ + +/* UNNAMED (ID) is the "name" of an unnamed function parameter. + Each of the function's unnamed parameters should have a unique "name". + The "name" cannot be used. This ports both to C17 and earlier, which + lack unnamed parameters, and to C++ and later C, which have them. */ +/* Applies to: + - function parameters. */ +#define UNNAMED(id) _GL_UNNAMED (id) + + #endif /* _GL_ATTRIBUTE_H */ diff --git a/gl/base64.c b/gl/base64.c index 8a0edd4a..77ee371b 100644 --- a/gl/base64.c +++ b/gl/base64.c @@ -1,5 +1,5 @@ /* base64.c -- Encode binary data using printable characters. - Copyright (C) 1999-2001, 2004-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2004-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -39,10 +39,10 @@ * */ +#define BASE64_INLINE _GL_EXTERN_INLINE #include /* Get prototype. */ -#define BASE64_INLINE _GL_EXTERN_INLINE #include "base64.h" /* Get imalloc. */ @@ -372,13 +372,14 @@ static bool decode_4 (char const *restrict in, idx_t inlen, char *restrict *outp, idx_t *outleft) { - char *out = *outp; if (inlen < 2) return false; if (!isbase64 (in[0]) || !isbase64 (in[1])) return false; + char *out = *outp; + if (*outleft) { *out++ = ((base64_to_int[to_uchar (in[0])] << 2) @@ -466,7 +467,6 @@ base64_decode_ctx (struct base64_decode_context *ctx, const char *restrict in, idx_t inlen, char *restrict out, idx_t *outlen) { - idx_t outleft = *outlen; bool ignore_newlines = ctx != NULL; bool flush_ctx = false; unsigned int ctx_i = 0; @@ -477,6 +477,7 @@ base64_decode_ctx (struct base64_decode_context *ctx, flush_ctx = inlen == 0; } + idx_t outleft = *outlen; while (true) { @@ -505,35 +506,36 @@ base64_decode_ctx (struct base64_decode_context *ctx, { ++in; --inlen; - continue; } + else + { + /* Restore OUT and OUTLEFT. */ + out -= outleft_save - outleft; + outleft = outleft_save; - /* Restore OUT and OUTLEFT. */ - out -= outleft_save - outleft; - outleft = outleft_save; - - { - char const *in_end = in + inlen; - char const *non_nl; - - if (ignore_newlines) - non_nl = get_4 (ctx, &in, in_end, &inlen); - else - non_nl = in; /* Might have nl in this case. */ - - /* If the input is empty or consists solely of newlines (0 non-newlines), - then we're done. Likewise if there are fewer than 4 bytes when not - flushing context and not treating newlines as garbage. */ - if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines)) { - inlen = 0; - break; - } - if (!decode_4 (non_nl, inlen, &out, &outleft)) - break; + char const *in_end = in + inlen; + + char const *non_nl; + if (ignore_newlines) + non_nl = get_4 (ctx, &in, in_end, &inlen); + else + non_nl = in; /* Might have nl in this case. */ + + /* If the input is empty or consists solely of newlines (0 non-newlines), + then we're done. Likewise if there are fewer than 4 bytes when not + flushing context and not treating newlines as garbage. */ + if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines)) + { + inlen = 0; + break; + } + if (!decode_4 (non_nl, inlen, &out, &outleft)) + break; - inlen = in_end - in; - } + inlen = in_end - in; + } + } } *outlen -= outleft; diff --git a/gl/base64.h b/gl/base64.h index cdafdac9..35f8a30b 100644 --- a/gl/base64.h +++ b/gl/base64.h @@ -1,5 +1,5 @@ /* base64.h -- Encode binary data using printable characters. - Copyright (C) 2004-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2009-2026 Free Software Foundation, Inc. Written by Simon Josefsson. This file is free software: you can redistribute it and/or modify diff --git a/gl/basename-lgpl.c b/gl/basename-lgpl.c index 2aecb0dd..53f3bae5 100644 --- a/gl/basename-lgpl.c +++ b/gl/basename-lgpl.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2025 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -29,13 +29,11 @@ char * last_component (char const *name) { char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); - char const *p; - bool last_was_slash = false; - while (ISSLASH (*base)) base++; - for (p = base; *p; p++) + bool last_was_slash = false; + for (char const *p = base; *p; p++) { if (ISSLASH (*p)) last_was_slash = true; @@ -53,8 +51,6 @@ size_t base_len (char const *name) { size_t len; - size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); - for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) continue; @@ -62,6 +58,7 @@ base_len (char const *name) && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2]) return 2; + size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len && len == prefix_len && ISSLASH (name[prefix_len])) return prefix_len + 1; diff --git a/gl/basename-lgpl.h b/gl/basename-lgpl.h index 120bd1cf..fa43cffb 100644 --- a/gl/basename-lgpl.h +++ b/gl/basename-lgpl.h @@ -1,6 +1,6 @@ /* Extract the last component (base name) of a file name. - Copyright (C) 1998, 2001, 2003-2006, 2009-2025 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/basename.c b/gl/basename.c index 9d2852d4..3a825981 100644 --- a/gl/basename.c +++ b/gl/basename.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2025 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gl/btowc.c b/gl/btowc.c index 891347de..19b490d1 100644 --- a/gl/btowc.c +++ b/gl/btowc.c @@ -1,5 +1,5 @@ /* Convert unibyte character to wide character. - Copyright (C) 2008, 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2008, 2010-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify diff --git a/gl/byteswap.c b/gl/byteswap.c index 97f7fc9e..e01eaa9a 100644 --- a/gl/byteswap.c +++ b/gl/byteswap.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright 2024-2025 Free Software Foundation, Inc. + Copyright 2024-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define _GL_BYTESWAP_INLINE _GL_EXTERN_INLINE +#include #include diff --git a/gl/byteswap.in.h b/gl/byteswap.in.h index 6b4fbabf..b2b26af8 100644 --- a/gl/byteswap.in.h +++ b/gl/byteswap.in.h @@ -1,5 +1,5 @@ /* byteswap.h - Byte swapping - Copyright (C) 2005, 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2026 Free Software Foundation, Inc. Written by Oskar Liljeblad , 2005. This file is free software: you can redistribute it and/or modify diff --git a/gl/c++defs.h b/gl/c++defs.h index df98a5ae..cfe68cb1 100644 --- a/gl/c++defs.h +++ b/gl/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -127,6 +127,16 @@ #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters +/* _GL_FUNCDECL_SYS_NAME (func) expands to plain func if C++, and to + parenthesized func otherwise. Parenthesization is needed in C23 if + the function is like strchr and so is a qualifier-generic macro + that expands to something more complicated. */ +#ifdef __cplusplus +# define _GL_FUNCDECL_SYS_NAME(func) func +#else +# define _GL_FUNCDECL_SYS_NAME(func) (func) +#endif + /* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); declares the system function, named func, with the given prototype, consisting of return type, parameters, and attributes. @@ -139,7 +149,7 @@ _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); */ #define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters + _GL_EXTERN_C_FUNC __VA_ARGS__ rettype _GL_FUNCDECL_SYS_NAME (func) parameters /* _GL_CXXALIAS_RPL (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func @@ -310,7 +320,7 @@ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) # define _GL_CXXALIASWARN_1(func,namespace) \ _GL_CXXALIASWARN_2 (func, namespace) -/* To work around GCC bug , +/* To work around GCC bug , we enable the warning only when not optimizing. */ # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN_2(func,namespace) \ @@ -338,7 +348,7 @@ GNULIB_NAMESPACE) # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -/* To work around GCC bug , +/* To work around GCC bug , we enable the warning only when not optimizing. */ # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ diff --git a/gl/c-ctype.c b/gl/c-ctype.c index ecf2c083..cd9a205a 100644 --- a/gl/c-ctype.c +++ b/gl/c-ctype.c @@ -1,6 +1,6 @@ /* Character handling in C locale. - Copyright (C) 2003-2025 Free Software Foundation, Inc. + Copyright (C) 2003-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define C_CTYPE_INLINE _GL_EXTERN_INLINE +#include #include "c-ctype.h" diff --git a/gl/c-ctype.h b/gl/c-ctype.h index 39063142..e3448a43 100644 --- a/gl/c-ctype.h +++ b/gl/c-ctype.h @@ -5,7 +5,7 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32is-impl.h b/gl/c32is-impl.h index 8366035d..7fa79291 100644 --- a/gl/c32is-impl.h +++ b/gl/c32is-impl.h @@ -1,5 +1,5 @@ /* Test whether a 32-bit wide character belongs to a specific character class. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -43,7 +43,7 @@ FUNC (wint_t wc) /* The char32_t encoding of a multibyte character is defined by the way mbrtoc32() is defined. */ -#if GNULIB_defined_mbstate_t /* AIX, IRIX */ +#if GNULIB_defined_mbstate_t /* AIX */ /* mbrtoc32() is defined on top of mbtowc() for the non-UTF-8 locales and directly for the UTF-8 locales. */ if (wc != WEOF) diff --git a/gl/c32isalnum.c b/gl/c32isalnum.c index 7d0ebcf5..0972d5be 100644 --- a/gl/c32isalnum.c +++ b/gl/c32isalnum.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being alphanumeric. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isalpha.c b/gl/c32isalpha.c index 308fd76a..1dde246d 100644 --- a/gl/c32isalpha.c +++ b/gl/c32isalpha.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being alphabetic. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isblank.c b/gl/c32isblank.c index 1a03c2db..36f21ec1 100644 --- a/gl/c32isblank.c +++ b/gl/c32isblank.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being blank. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32iscntrl.c b/gl/c32iscntrl.c index 1d004087..dcb32705 100644 --- a/gl/c32iscntrl.c +++ b/gl/c32iscntrl.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being a control character. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isdigit.c b/gl/c32isdigit.c index 7d3bda81..96374718 100644 --- a/gl/c32isdigit.c +++ b/gl/c32isdigit.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being a digit. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isgraph.c b/gl/c32isgraph.c index 8b68ae39..f660ceba 100644 --- a/gl/c32isgraph.c +++ b/gl/c32isgraph.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being graphic. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32islower.c b/gl/c32islower.c index 1ce08cf4..98abb8a2 100644 --- a/gl/c32islower.c +++ b/gl/c32islower.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being lowercase. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isprint.c b/gl/c32isprint.c index d47ce1f8..72975751 100644 --- a/gl/c32isprint.c +++ b/gl/c32isprint.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being printable. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32ispunct.c b/gl/c32ispunct.c index 41ac3d70..1945c6c5 100644 --- a/gl/c32ispunct.c +++ b/gl/c32ispunct.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being a punctuation or symbol character. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isspace.c b/gl/c32isspace.c index 2393142b..58e2a02a 100644 --- a/gl/c32isspace.c +++ b/gl/c32isspace.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being white-space. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isupper.c b/gl/c32isupper.c index bfe4a148..29558234 100644 --- a/gl/c32isupper.c +++ b/gl/c32isupper.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being uppercase. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32isxdigit.c b/gl/c32isxdigit.c index b38d7f1f..c9262b58 100644 --- a/gl/c32isxdigit.c +++ b/gl/c32isxdigit.c @@ -1,5 +1,5 @@ /* Test 32-bit wide character for being a hexadecimal digit. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32to-impl.h b/gl/c32to-impl.h index a63a25b6..2528e51d 100644 --- a/gl/c32to-impl.h +++ b/gl/c32to-impl.h @@ -1,5 +1,5 @@ /* Case mapping of a 32-bit wide character. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -39,7 +39,7 @@ FUNC (wint_t wc) /* The char32_t encoding of a multibyte character is defined by the way mbrtoc32() is defined. */ -#if GNULIB_defined_mbstate_t /* AIX, IRIX */ +#if GNULIB_defined_mbstate_t /* AIX */ /* mbrtoc32() is defined on top of mbtowc() for the non-UTF-8 locales and directly for the UTF-8 locales. */ if (wc != WEOF) diff --git a/gl/c32tolower.c b/gl/c32tolower.c index a0b0523f..15608d88 100644 --- a/gl/c32tolower.c +++ b/gl/c32tolower.c @@ -1,5 +1,5 @@ /* Map a 32-bit wide character to lowercase. - Copyright (C) 2023-2025 Free Software Foundation, Inc. + Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/c32width.c b/gl/c32width.c index 442a432c..727c2bd3 100644 --- a/gl/c32width.c +++ b/gl/c32width.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a 32-bit wide character. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -49,7 +49,7 @@ c32width (char32_t wc) /* The char32_t encoding of a multibyte character is defined by the way mbrtoc32() is defined. */ -#if GNULIB_defined_mbstate_t /* AIX, IRIX */ +#if GNULIB_defined_mbstate_t /* AIX */ /* mbrtoc32() is defined on top of mbtowc() for the non-UTF-8 locales and directly for the UTF-8 locales. */ const char *encoding = locale_charset (); diff --git a/gl/calloc.c b/gl/calloc.c index 5258c5de..b4ca8f89 100644 --- a/gl/calloc.c +++ b/gl/calloc.c @@ -1,6 +1,6 @@ /* calloc() function that is glibc compatible. - This wrapper function is required at least on Tru64 UNIX 5.1 and mingw. - Copyright (C) 2004-2007, 2009-2025 Free Software Foundation, Inc. + This wrapper function is required at least on mingw. + Copyright (C) 2004-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/cdefs.h b/gl/cdefs.h index dce5739d..696e6542 100644 --- a/gl/cdefs.h +++ b/gl/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2025 Free Software Foundation, Inc. +/* Copyright (C) 1992-2026 Free Software Foundation, Inc. Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. diff --git a/gl/cloexec.c b/gl/cloexec.c index 8ab5591f..3d4f916b 100644 --- a/gl/cloexec.c +++ b/gl/cloexec.c @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 1991, 2004-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1991, 2004-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/cloexec.h b/gl/cloexec.h index 0eb9fa09..3716bd72 100644 --- a/gl/cloexec.h +++ b/gl/cloexec.h @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 2004, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2004, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/close.c b/gl/close.c index 3bcfc479..86ccdf9a 100644 --- a/gl/close.c +++ b/gl/close.c @@ -1,5 +1,5 @@ /* close replacement. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/dirname-lgpl.c b/gl/dirname-lgpl.c index 9e0ec565..9f772e0f 100644 --- a/gl/dirname-lgpl.c +++ b/gl/dirname-lgpl.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2025 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -32,7 +32,6 @@ size_t dir_len (char const *file) { size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); - size_t length; /* Advance prefix_length beyond important leading slashes. */ prefix_length += (prefix_length != 0 @@ -45,8 +44,10 @@ dir_len (char const *file) : 0)); /* Strip the basename and any redundant slashes before it. */ + size_t length; for (length = last_component (file) - file; - prefix_length < length; length--) + prefix_length < length; + length--) if (! ISSLASH (file[length - 1])) break; return length; diff --git a/gl/dirname.c b/gl/dirname.c index e747fcaf..a67c7593 100644 --- a/gl/dirname.c +++ b/gl/dirname.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2025 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gl/dirname.h b/gl/dirname.h index d4d03f66..8ecbb9e6 100644 --- a/gl/dirname.h +++ b/gl/dirname.h @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2025 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/dup2.c b/gl/dup2.c index 69b37196..b9a55263 100644 --- a/gl/dup2.c +++ b/gl/dup2.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -70,8 +70,6 @@ dup2_nothrow (int fd, int desired_fd) static int ms_windows_dup2 (int fd, int desired_fd) { - int result; - /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open, dup2 (fd, fd) returns 0, but all further attempts to use fd in future dup2 calls will hang. */ @@ -93,7 +91,7 @@ ms_windows_dup2 (int fd, int desired_fd) return -1; } - result = dup2_nothrow (fd, desired_fd); + int result = dup2_nothrow (fd, desired_fd); if (result == 0) result = desired_fd; @@ -110,14 +108,11 @@ ms_windows_dup2 (int fd, int desired_fd) static int klibc_dup2dirfd (int fd, int desired_fd) { - int tempfd; - int dupfd; - - tempfd = open ("NUL", O_RDONLY); - if (tempfd == -1) - return -1; + int tempfd = open ("NUL", O_RDONLY); + if (tempfd < 0) + return tempfd; - if (tempfd == desired_fd) + if (tempfd >= desired_fd) { close (tempfd); @@ -125,10 +120,32 @@ klibc_dup2dirfd (int fd, int desired_fd) if (__libc_Back_ioFHToPath (fd, path, sizeof (path))) return -1; - return open(path, O_RDONLY); + for (;;) + { + close (desired_fd); + + int dupfd = open (path, O_RDONLY); + if (dupfd < 0) + return dupfd; + + if (dupfd == desired_fd) + return dupfd; + + /* If lower FD was closed by other threads, fill again. */ + if (dupfd < desired_fd) + { + tempfd = dupfd; + break; + } + + /* desired_fd was opened by other threads. Try again. */ + /* FIXME: Closing desired_fd opened by other threads may lead to + unexpected behavior. */ + close (dupfd); + } } - dupfd = klibc_dup2dirfd (fd, desired_fd); + int dupfd = klibc_dup2dirfd (fd, desired_fd); close (tempfd); @@ -138,16 +155,16 @@ klibc_dup2dirfd (int fd, int desired_fd) static int klibc_dup2 (int fd, int desired_fd) { - int dupfd; - struct stat sbuf; - - dupfd = dup2 (fd, desired_fd); - if (dupfd == -1 && errno == ENOTSUP \ - && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + int dupfd = dup2 (fd, desired_fd); + if (dupfd < 0 && errno == ENOTSUP) { - close (desired_fd); + struct stat sbuf; + if (!fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + close (desired_fd); - return klibc_dup2dirfd (fd, desired_fd); + return klibc_dup2dirfd (fd, desired_fd); + } } return dupfd; @@ -159,8 +176,6 @@ klibc_dup2 (int fd, int desired_fd) int rpl_dup2 (int fd, int desired_fd) { - int result; - #ifdef F_GETFL /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF. On Cygwin 1.5.x, dup2 (1, 1) returns 0. @@ -176,13 +191,14 @@ rpl_dup2 (int fd, int desired_fd) return fcntl (fd, F_GETFL) == -1 ? -1 : fd; #endif - result = dup2 (fd, desired_fd); + int result = dup2 (fd, desired_fd); /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */ - if (result == -1 && errno == EMFILE) + if (result < 0 && errno == EMFILE) errno = EBADF; + #if REPLACE_FCHDIR - if (fd != desired_fd && result != -1) + if (! (result < 0 || fd == desired_fd)) result = _gl_register_dup (fd, result); #endif return result; diff --git a/gl/dynarray.h b/gl/dynarray.h index 74471ea2..a5cdf630 100644 --- a/gl/dynarray.h +++ b/gl/dynarray.h @@ -1,5 +1,5 @@ /* Type-safe arrays which grow dynamically. - Copyright 2021-2025 Free Software Foundation, Inc. + Copyright 2021-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/errno.in.h b/gl/errno.in.h index ba5dd371..784a4018 100644 --- a/gl/errno.in.h +++ b/gl/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like . - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -148,27 +148,11 @@ # endif -/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros - EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ -# if @EMULTIHOP_HIDDEN@ -# define EMULTIHOP @EMULTIHOP_VALUE@ -# define GNULIB_defined_EMULTIHOP 1 -# endif -# if @ENOLINK_HIDDEN@ -# define ENOLINK @ENOLINK_VALUE@ -# define GNULIB_defined_ENOLINK 1 -# endif -# if @EOVERFLOW_HIDDEN@ -# define EOVERFLOW @EOVERFLOW_VALUE@ -# define GNULIB_defined_EOVERFLOW 1 -# endif - - /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. Likewise, on NonStop Kernel, EDQUOT is not defined. Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, - HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. + HP-UX EWOULDBLOCK = 246. Note: When one of these systems defines some of these macros some day, binaries will have to be recompiled so that they recognizes the new diff --git a/gl/error.c b/gl/error.c index 9231c79c..e066241b 100644 --- a/gl/error.c +++ b/gl/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-2025 Free Software Foundation, Inc. + Copyright (C) 1990-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ #if !_LIBC && ENABLE_NLS # include "gettext.h" -# define _(msgid) dgettext ("gnulib", msgid) +# define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) #endif #ifdef _LIBC diff --git a/gl/error.in.h b/gl/error.in.h index 6c512ec8..3355fb3b 100644 --- a/gl/error.in.h +++ b/gl/error.in.h @@ -1,5 +1,5 @@ /* Declarations for error-reporting functions. - Copyright (C) 1995-1997, 2003, 2006, 2008-2025 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gl/exitfail.c b/gl/exitfail.c index 5b37c10b..148468b7 100644 --- a/gl/exitfail.c +++ b/gl/exitfail.c @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/exitfail.h b/gl/exitfail.h index 9d6b1528..64e2aa33 100644 --- a/gl/exitfail.h +++ b/gl/exitfail.h @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/fcntl.c b/gl/fcntl.c index ecb18e50..1c0e52d2 100644 --- a/gl/fcntl.c +++ b/gl/fcntl.c @@ -1,6 +1,6 @@ /* Provide file descriptor control. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -30,6 +30,7 @@ #ifdef __KLIBC__ # include +# include #endif #if defined _WIN32 && ! defined __CYGWIN__ @@ -55,19 +56,15 @@ dupfd (int oldfd, int newfd, int flags) { /* Mingw has no way to create an arbitrary fd. Iterate until all file descriptors less than newfd are filled up. */ - HANDLE curr_process = GetCurrentProcess (); - HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd); - unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT]; - unsigned int fds_to_close_bound = 0; - int result; - BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE; - int mode; if (newfd < 0 || getdtablesize () <= newfd) { errno = EINVAL; return -1; } + + HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd); + int mode; if (old_handle == INVALID_HANDLE_VALUE || (mode = _setmode (oldfd, O_BINARY)) == -1) { @@ -79,6 +76,11 @@ dupfd (int oldfd, int newfd, int flags) _setmode (oldfd, mode); flags |= mode; + HANDLE curr_process = GetCurrentProcess (); + BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE; + unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT]; + unsigned int fds_to_close_bound = 0; + int result; for (;;) { HANDLE new_handle; @@ -145,9 +147,8 @@ dupfd (int oldfd, int newfd, int flags) /* Close the previous fds that turned out to be too small. */ { int saved_errno = errno; - unsigned int duplicated_fd; - for (duplicated_fd = 0; + for (unsigned int duplicated_fd = 0; duplicated_fd < fds_to_close_bound * CHAR_BIT; duplicated_fd++) if ((fds_to_close[duplicated_fd / CHAR_BIT] @@ -205,8 +206,9 @@ fcntl (int fd, int action, /* arg */...) #endif { va_list arg; - int result = -1; va_start (arg, action); + + int result = -1; switch (action) { case F_DUPFD: @@ -375,12 +377,6 @@ fcntl (int fd, int action, /* arg */...) #ifdef F_NOTIFY /* Linux */ case F_NOTIFY: #endif - #ifdef F_OPLKACK /* IRIX */ - case F_OPLKACK: - #endif - #ifdef F_OPLKREG /* IRIX */ - case F_OPLKREG: - #endif #ifdef F_RDAHEAD /* macOS */ case F_RDAHEAD: #endif @@ -438,7 +434,9 @@ fcntl (int fd, int action, /* arg */...) break; } } + va_end (arg); + return result; } @@ -545,86 +543,115 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) #undef fcntl #ifdef __KLIBC__ - static int -klibc_fcntl (int fd, int action, /* arg */...) +klibc_dupdirfd (int fd, int minfd) { - va_list arg_ptr; - int arg; - struct stat sbuf; - int result; + int tempfd = open ("NUL", O_RDONLY); + if (tempfd == -1) + return -1; - va_start (arg_ptr, action); - arg = va_arg (arg_ptr, int); - result = fcntl (fd, action, arg); - /* EPERM for F_DUPFD, ENOTSUP for others */ - if (result == -1 && (errno == EPERM || errno == ENOTSUP) - && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + if (tempfd >= minfd) { - PLIBCFH pFH; - unsigned fFlags; + close (tempfd); - switch (action) - { - case F_DUPFD: - /* Find available fd */ - while (fcntl (arg, F_GETFL) != -1 || errno != EBADF) - arg++; + char path[_MAX_PATH]; + if (__libc_Back_ioFHToPath (fd, path, sizeof (path))) + return -1; - result = dup2 (fd, arg); - break; + int dupfd = open (path, O_RDONLY); + if (dupfd == -1) + return -1; - case F_GETFD: - pFH = __libc_FH (fd); - if (!pFH) - { - errno = EBADF; - break; - } + if (dupfd >= minfd) + return dupfd; - result = (pFH->fFlags & ((FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT ) - | O_NOINHERIT)) ? FD_CLOEXEC : 0; - break; + /* Lower FD was closed by other threads. Fill again. */ + tempfd = dupfd; + } - case F_SETFD: - if (arg & ~FD_CLOEXEC) - break; + int dupfd = klibc_dupdirfd (fd, minfd); - pFH = __libc_FH (fd); - if (!pFH) + close (tempfd); + + return dupfd; +} + +static int +klibc_fcntl (int fd, int action, /* arg */...) +{ + va_list arg_ptr; + va_start (arg_ptr, action); + + int arg = va_arg (arg_ptr, int); + int result = fcntl (fd, action, arg); + /* EPERM for F_DUPFD, ENOTSUP for others */ + if (result == -1 && (errno == EPERM || errno == ENOTSUP)) + { + struct stat sbuf; + if (!fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + switch (action) { - errno = EBADF; + case F_DUPFD: + result = klibc_dupdirfd (fd, arg); break; - } - fFlags = pFH->fFlags; - if (arg & FD_CLOEXEC) - fFlags |= (FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT) | O_NOINHERIT; - else - fFlags &= ~((FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT) | O_NOINHERIT); + case F_GETFD: + { + PLIBCFH pFH = __libc_FH (fd); + if (!pFH) + { + errno = EBADF; + break; + } + + result = (pFH->fFlags & ((FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT ) + | O_NOINHERIT)) ? FD_CLOEXEC : 0; + } + break; - result = __libc_FHSetFlags (pFH, fd, fFlags); - if (result < 0) - { - errno = -result; - result = -1; - } - break; + case F_SETFD: + { + if (arg & ~FD_CLOEXEC) + break; + + PLIBCFH pFH = __libc_FH (fd); + if (!pFH) + { + errno = EBADF; + break; + } + + unsigned fFlags = pFH->fFlags; + if (arg & FD_CLOEXEC) + fFlags |= (FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT) | O_NOINHERIT; + else + fFlags &= ~((FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT) | O_NOINHERIT); + + result = __libc_FHSetFlags (pFH, fd, fFlags); + if (result < 0) + { + errno = -result; + result = -1; + } + } + break; - case F_GETFL: - result = 0; - break; + case F_GETFL: + result = 0; + break; - case F_SETFL: - if (arg != 0) - break; + case F_SETFL: + if (arg != 0) + break; - result = 0; - break; + result = 0; + break; - default: - errno = EINVAL; - break; + default: + errno = EINVAL; + break; + } } } diff --git a/gl/fcntl.in.h b/gl/fcntl.in.h index c5068ed4..52727074 100644 --- a/gl/fcntl.in.h +++ b/gl/fcntl.in.h @@ -1,6 +1,6 @@ /* Like , but with non-working flags defined to 0. - Copyright (C) 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -122,7 +122,6 @@ _GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); # endif _GL_CXXALIASWARN (creat); #elif defined GNULIB_POSIXCHECK -# undef creat /* Assume creat is always declared. */ _GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - " "use gnulib module creat for portability"); @@ -165,7 +164,6 @@ _GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...)); # endif _GL_CXXALIASWARN (fcntl); #elif defined GNULIB_POSIXCHECK -# undef fcntl # if HAVE_RAW_DECL_FCNTL _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " "use gnulib module fcntl for portability"); @@ -196,7 +194,6 @@ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); _GL_CXXALIASWARN (open); # endif #elif defined GNULIB_POSIXCHECK -# undef open /* Assume open is always declared. */ _GL_WARN_ON_USE (open, "open is not always POSIX compliant - " "use gnulib module open for portability"); @@ -242,13 +239,51 @@ _GL_CXXALIAS_SYS (openat, int, # endif _GL_CXXALIASWARN (openat); #elif defined GNULIB_POSIXCHECK -# undef openat # if HAVE_RAW_DECL_OPENAT _GL_WARN_ON_USE (openat, "openat is not portable - " "use gnulib module openat for portability"); # endif #endif +#if @GNULIB_OPENAT2@ +# if !defined RESOLVE_NO_XDEV && defined __has_include +# if __has_include () +# include +# endif +# endif +# ifndef RESOLVE_NO_XDEV +struct open_how +{ +# ifdef __UINT64_TYPE__ + __UINT64_TYPE__ flags, mode, resolve; +# else + unsigned long long int flags, mode, resolve; +# endif +}; +# define RESOLVE_NO_XDEV 0x01 +# define RESOLVE_NO_MAGICLINKS 0x02 +# define RESOLVE_NO_SYMLINKS 0x04 +# define RESOLVE_BENEATH 0x08 +# define RESOLVE_IN_ROOT 0x10 +# define RESOLVE_CACHED 0x20 +# endif + +# if !@HAVE_OPENAT2@ +_GL_FUNCDECL_SYS (openat2, int, + (int fd, char const *file, struct open_how const *how, + size_t size), + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (openat2, int, + (int fd, char const *file, struct open_how const *how, + size_t size)); +_GL_CXXALIASWARN (openat2); +#elif defined GNULIB_POSIXCHECK +# if HAVE_RAW_DECL_OPENAT2 +_GL_WARN_ON_USE (openat2, "openat2 is not portable - " + "use gnulib module openat2 for portability"); +# endif +#endif /* Fix up the FD_* macros, only known to be missing on mingw. */ @@ -293,11 +328,6 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # endif #endif -#if !defined O_DIRECT && defined O_DIRECTIO -/* Tru64 spells it 'O_DIRECTIO'. */ -# define O_DIRECT O_DIRECTIO -#endif - #if !defined O_CLOEXEC && defined O_NOINHERIT /* Mingw spells it 'O_NOINHERIT'. */ # define O_CLOEXEC O_NOINHERIT @@ -460,6 +490,15 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define AT_NO_AUTOMOUNT 0 #endif +/* errno when openat+O_NOFOLLOW fails because the file is a symlink. */ +#if defined __FreeBSD__ || defined __FreeBSD_kernel__ || defined __DragonFly__ +# define _GL_OPENAT_ESYMLINK EMLINK +#elif defined __NetBSD__ +# define _GL_OPENAT_ESYMLINK EFTYPE +#else +# define _GL_OPENAT_ESYMLINK ELOOP +#endif + #endif /* _@GUARD_PREFIX@_FCNTL_H */ #endif /* _@GUARD_PREFIX@_FCNTL_H */ #endif diff --git a/gl/fd-hook.c b/gl/fd-hook.c index 4a5014eb..eef4e81e 100644 --- a/gl/fd-hook.c +++ b/gl/fd-hook.c @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This file is free software: you can redistribute it and/or modify diff --git a/gl/fd-hook.h b/gl/fd-hook.h index a960eaf3..0f029d42 100644 --- a/gl/fd-hook.h +++ b/gl/fd-hook.h @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/fflush.c b/gl/fflush.c index d8619082..862ff926 100644 --- a/gl/fflush.c +++ b/gl/fflush.c @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -65,7 +65,7 @@ clear_ungetc_buffer (FILE *fp) fp->_ungetc_count = 0; fp->_rcount = - fp->_rcount; } -# elif defined _IOERR /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* Minix, AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ /* Nothing to do. */ # else /* other implementations */ fseeko (fp, 0, SEEK_CUR); diff --git a/gl/float+.h b/gl/float+.h index 37381146..58eca376 100644 --- a/gl/float+.h +++ b/gl/float+.h @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This file is free software: you can redistribute it and/or modify diff --git a/gl/float.c b/gl/float.c index 780a0d1c..2e95957a 100644 --- a/gl/float.c +++ b/gl/float.c @@ -1,5 +1,5 @@ /* Auxiliary definitions for . - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify @@ -21,10 +21,7 @@ #include #if GNULIB_defined_long_double_union -# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__ -const union gl_long_double_union gl_LDBL_MAX = - { { DBL_MAX, DBL_MAX / 0x1p53 } }; -# elif defined __i386__ +# ifdef __i386__ const union gl_long_double_union gl_LDBL_MAX = { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } }; # endif diff --git a/gl/float.in.h b/gl/float.in.h index d75a06e7..9f735cb9 100644 --- a/gl/float.in.h +++ b/gl/float.in.h @@ -1,6 +1,6 @@ /* A correct . - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -113,69 +113,31 @@ extern const union gl_long_double_union gl_LDBL_MAX; # define LDBL_MAX_10_EXP 4932 #endif -/* On PowerPC with gcc 15 when using __ibm128 long double, the value of - LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX, and LDBL_NORM_MAX are wrong. */ +/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are + wrong. + On Linux/PowerPC with gcc 8.3, the values of LDBL_MAX and LDBL_EPSILON are + wrong. + Assume these bugs are fixed in any GCC new enough + to define __LDBL_NORM_MAX__. */ #if (defined _ARCH_PPC && LDBL_MANT_DIG == 106 \ - && defined __GNUC__) + && defined __GNUC__ && !defined __LDBL_NORM_MAX__) # undef LDBL_MIN_EXP -# define LDBL_MIN_EXP DBL_MIN_EXP +# define LDBL_MIN_EXP (-968) # undef LDBL_MIN_10_EXP -# define LDBL_MIN_10_EXP DBL_MIN_10_EXP +# define LDBL_MIN_10_EXP (-291) # undef LDBL_MIN -# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */ +# define LDBL_MIN 0x1p-969L + +/* IBM long double is tricky: it is represented as the sum of two doubles, + and the high double must equal the sum of the two parts rounded to nearest. + The maximum finite value for which this is true is + { 0x1.fffffffffffffp+1023, 0x1.ffffffffffffep+969 }, + which represents 0x1.fffffffffffff7ffffffffffff8p+1023L. + Although computations can yield representations of numbers larger than this, + these computations are considered to have overflowed and behavior is undefined. + See . */ # undef LDBL_MAX -/* LDBL_MAX is 2**1024 - 2**918, represented as: { 0x7FEFFFFF, 0xFFFFFFFF, - 0x7C9FFFFF, 0xFFFFFFFF }. - - Do not write it as a constant expression, as GCC would likely treat - that as infinity due to the vagaries of this platform's funky arithmetic. - Instead, define it through a reference to an external variable. - Like the following, but using a union to avoid type mismatches: - - const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / 0x1p53 }; - extern const long double LDBL_MAX; - - The following alternative would not work as well when GCC is optimizing: - - #define LDBL_MAX (*(long double const *) (double[]) - { DBL_MAX, DBL_MAX / 0x1p53 }) - - The following alternative would require GCC 6 or later: - - #define LDBL_MAX __builtin_pack_longdouble (DBL_MAX, DBL_MAX / 0x1p53) - - Unfortunately none of the alternatives are constant expressions. */ -# if !GNULIB_defined_long_double_union -union gl_long_double_union - { - struct { double hi; double lo; } dd; - long double ld; - }; -# define GNULIB_defined_long_double_union 1 -# endif -extern const union gl_long_double_union gl_LDBL_MAX; -# define LDBL_MAX (gl_LDBL_MAX.ld) -# undef LDBL_NORM_MAX -# define LDBL_NORM_MAX LDBL_MAX -#endif - -/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong. - On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON - are wrong. */ -#if defined __sgi && (LDBL_MANT_DIG >= 106) -# undef LDBL_MANT_DIG -# define LDBL_MANT_DIG 106 -# if defined __GNUC__ -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP DBL_MIN_EXP -# undef LDBL_MIN_10_EXP -# define LDBL_MIN_10_EXP DBL_MIN_10_EXP -# undef LDBL_MIN -# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */ -# undef LDBL_EPSILON -# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */ -# endif -#endif +# define LDBL_MAX 0x1.fffffffffffff7ffffffffffff8p+1023L /* On PowerPC platforms, 'long double' has a double-double representation. Up to ISO C 17, this was outside the scope of ISO C because it can represent @@ -187,9 +149,8 @@ extern const union gl_long_double_union gl_LDBL_MAX; numbers with mantissas of the form 1.<52 bits><52 bits> are called "unnormalized". And since LDBL_EPSILON must be normalized (per ISO C 23 § 5.2.5.3.3.(33)), it must be 2^-105. */ -#if defined __powerpc__ && LDBL_MANT_DIG == 106 # undef LDBL_EPSILON -# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */ +# define LDBL_EPSILON 0x1p-105L #endif /* ============================ ISO C11 support ============================ */ @@ -273,7 +234,7 @@ extern const union gl_long_double_union gl_LDBL_TRUE_MIN; # define FLT_NORM_MAX FLT_MAX #endif #ifndef FLT_SNAN -/* For sh, beware of . */ +/* For sh, beware of . */ # if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__ # define FLT_SNAN __builtin_nansf ("") # else @@ -297,7 +258,7 @@ extern gl_FLT_SNAN_t gl_FLT_SNAN; # define DBL_NORM_MAX DBL_MAX #endif #ifndef DBL_SNAN -/* For sh, beware of . */ +/* For sh, beware of . */ # if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__ # define DBL_SNAN __builtin_nans ("") # else @@ -322,12 +283,14 @@ extern gl_DBL_SNAN_t gl_DBL_SNAN; #ifndef LDBL_NORM_MAX # ifdef __LDBL_NORM_MAX__ # define LDBL_NORM_MAX __LDBL_NORM_MAX__ +# elif FLT_RADIX == 2 && LDBL_MAX_EXP == 1024 && LDBL_MANT_DIG == 106 +# define LDBL_NORM_MAX 0x1.ffffffffffffffffffffffffff8p+1022L # else # define LDBL_NORM_MAX LDBL_MAX # endif #endif #ifndef LDBL_SNAN -/* For sh, beware of . */ +/* For sh, beware of . */ # if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__ # define LDBL_SNAN __builtin_nansl ("") # else diff --git a/gl/floor.c b/gl/floor.c index 4d7fecae..9cecb7bb 100644 --- a/gl/floor.c +++ b/gl/floor.c @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/floorf.c b/gl/floorf.c index d210c297..34a507b9 100644 --- a/gl/floorf.c +++ b/gl/floorf.c @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/fopen.c b/gl/fopen.c index 41587d2c..93710ad0 100644 --- a/gl/fopen.c +++ b/gl/fopen.c @@ -1,5 +1,5 @@ /* Open a stream to a file. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -33,13 +33,7 @@ orig_fopen (const char *filename, const char *mode) } /* Specification. */ -#ifdef __osf__ -/* Write "stdio.h" here, not , otherwise OSF/1 5.1 DTK cc eliminates - this include because of the preliminary #include above. */ -# include "stdio.h" -#else -# include -#endif +#include #include #include @@ -51,24 +45,18 @@ orig_fopen (const char *filename, const char *mode) FILE * rpl_fopen (const char *filename, const char *mode) { - int open_direction; - int open_flags; -#if GNULIB_FOPEN_GNU - bool open_flags_gnu; -# define BUF_SIZE 80 - char fdopen_mode_buf[BUF_SIZE + 1]; -#endif - #if defined _WIN32 && ! defined __CYGWIN__ - if (strcmp (filename, "/dev/null") == 0) + if (streq (filename, "/dev/null")) filename = "NUL"; #endif /* Parse the mode. */ - open_direction = 0; - open_flags = 0; + int open_direction = 0; + int open_flags = 0; #if GNULIB_FOPEN_GNU - open_flags_gnu = false; + bool open_flags_gnu = false; +# define BUF_SIZE 80 + char fdopen_mode_buf[BUF_SIZE + 1]; #endif { const char *p = mode; @@ -169,21 +157,18 @@ rpl_fopen (const char *filename, const char *mode) size_t len = strlen (filename); if (len > 0 && filename[len - 1] == '/') { - int fd; - struct stat statbuf; - FILE *fp; - if (open_direction != O_RDONLY) { errno = EISDIR; return NULL; } - fd = open (filename, open_direction | open_flags, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + int fd = open (filename, open_direction | open_flags, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0) return NULL; + struct stat statbuf; if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) { close (fd); @@ -191,6 +176,7 @@ rpl_fopen (const char *filename, const char *mode) return NULL; } + FILE *fp; # if GNULIB_FOPEN_GNU fp = fdopen (fd, fdopen_mode_buf); # else @@ -210,15 +196,12 @@ rpl_fopen (const char *filename, const char *mode) #if GNULIB_FOPEN_GNU if (open_flags_gnu) { - int fd; - FILE *fp; - - fd = open (filename, open_direction | open_flags, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + int fd = open (filename, open_direction | open_flags, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0) return NULL; - fp = fdopen (fd, fdopen_mode_buf); + FILE *fp = fdopen (fd, fdopen_mode_buf); if (fp == NULL) { int saved_errno = errno; diff --git a/gl/fpurge.c b/gl/fpurge.c index 0b69da3f..6799b52b 100644 --- a/gl/fpurge.c +++ b/gl/fpurge.c @@ -1,5 +1,5 @@ /* Flushing buffers of a FILE stream. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -101,7 +101,7 @@ fpurge (FILE *fp) if (fp->_ptr != NULL) fp->_count = 0; return 0; -# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_ptr = fp_->_base; if (fp_->_ptr != NULL) fp_->_cnt = 0; diff --git a/gl/freading.c b/gl/freading.c index 6a60d6b3..8e06282e 100644 --- a/gl/freading.c +++ b/gl/freading.c @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -22,7 +22,7 @@ #include "stdio-impl.h" /* Don't use glibc's __freading function in glibc < 2.7, see - */ + */ #if !(HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))) /* This code is not compiled on systems that have a working __freading function, @@ -47,7 +47,7 @@ freading (FILE *fp) return (fp->_flags & _IOREAD) != 0; # elif defined __minix /* Minix */ return (fp->_flags & _IOREADING) != 0; -# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ # if defined __sun /* Solaris */ return (fp_->_flag & _IOREAD) != 0 && (fp_->_flag & _IOWRT) == 0; # else diff --git a/gl/freading.h b/gl/freading.h index 405a651e..3d75d75e 100644 --- a/gl/freading.h +++ b/gl/freading.h @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/free.c b/gl/free.c index 98ceafd7..e6e7cf0f 100644 --- a/gl/free.c +++ b/gl/free.c @@ -1,6 +1,6 @@ /* Make free() preserve errno. - Copyright (C) 2003, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2003, 2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -33,7 +33,7 @@ rpl_free (void *p) { # if defined __GNUC__ && !defined __clang__ /* An invalid GCC optimization - + would optimize away the assignments in the code below, when link-time optimization (LTO) is enabled. Make the code more complicated, so that GCC does not grok how to optimize it. */ @@ -44,9 +44,9 @@ rpl_free (void *p) free (p); errno = err[errno == 0]; # else - int err = errno; + int saved_errno = errno; free (p); - errno = err; + errno = saved_errno; # endif } diff --git a/gl/fseek.c b/gl/fseek.c index a5857650..bf1f303f 100644 --- a/gl/fseek.c +++ b/gl/fseek.c @@ -1,5 +1,5 @@ /* An fseek() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/fseeko.c b/gl/fseeko.c index ecd2f83a..f6cd7cba 100644 --- a/gl/fseeko.c +++ b/gl/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -84,7 +84,7 @@ fseeko (FILE *fp, off_t offset, int whence) #elif defined __minix /* Minix */ if (fp_->_ptr == fp_->_buf && (fp_->_ptr == NULL || fp_->_count == 0)) -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ if (fp_->_ptr == fp_->_base && (fp_->_ptr == NULL || fp_->_cnt == 0)) #elif defined __UCLIBC__ /* uClibc */ @@ -158,7 +158,7 @@ fseeko (FILE *fp, off_t offset, int whence) fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ fp->_flags &= ~_IOEOF; -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag &= ~_IOEOF; #elif defined __MINT__ /* Atari FreeMiNT */ fp->__offset = pos; diff --git a/gl/fseterr.c b/gl/fseterr.c index a01ef2af..0ab61765 100644 --- a/gl/fseterr.c +++ b/gl/fseterr.c @@ -1,5 +1,5 @@ /* Set the error indicator of a stream. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -42,7 +42,7 @@ fseterr (FILE *fp) fp->_flags |= _IOERR; #elif defined __minix /* Minix */ fp->_flags |= _IOERR; -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag |= _IOERR; #elif defined __UCLIBC__ /* uClibc */ fp->__modeflags |= __FLAG_ERROR; @@ -59,14 +59,10 @@ fseterr (FILE *fp) Not activated on any system, because there is no way to repair FP when the sequence of system calls fails, and library code should not call abort(). */ - int saved_errno; - int fd; - int fd2; - - saved_errno = errno; + int saved_errno = errno; fflush (fp); - fd = fileno (fp); - fd2 = dup (fd); + int fd = fileno (fp); + int fd2 = dup (fd); if (fd2 >= 0) { close (fd); diff --git a/gl/fseterr.h b/gl/fseterr.h index 57c30ef3..ac2b793e 100644 --- a/gl/fseterr.h +++ b/gl/fseterr.h @@ -1,5 +1,5 @@ /* Set the error indicator of a stream. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/fstat.c b/gl/fstat.c index 200e672e..292ce75f 100644 --- a/gl/fstat.c +++ b/gl/fstat.c @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -40,14 +40,7 @@ orig_fstat (int fd, struct stat *buf) #endif /* Specification. */ -#ifdef __osf__ -/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc - eliminates this include because of the preliminary #include - above. */ -# include "sys/stat.h" -#else -# include -#endif +#include #include "stat-time.h" diff --git a/gl/fsusage.c b/gl/fsusage.c index e26bda88..1700a19c 100644 --- a/gl/fsusage.c +++ b/gl/fsusage.c @@ -1,6 +1,6 @@ /* fsusage.c -- return space usage of mounted file systems - Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2025 Free Software + Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -91,10 +91,12 @@ static int statvfs_works (void) { static int statvfs_works_cache = -1; - struct utsname name; if (statvfs_works_cache < 0) - statvfs_works_cache = (uname (&name) == 0 - && 0 <= strverscmp (name.release, "2.6.36")); + { + struct utsname name; + statvfs_works_cache = (uname (&name) == 0 + && 0 <= strverscmp (name.release, "2.6.36")); + } return statvfs_works_cache; } # endif @@ -148,15 +150,6 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) ? PROPAGATE_ALL_ONES (fsd.f_frsize) : PROPAGATE_ALL_ONES (fsd.f_bsize)); -#elif defined STAT_STATFS3_OSF1 /* OSF/1 */ - - struct statfs fsd; - - if (statfs (file, &fsd, sizeof (struct statfs)) != 0) - return -1; - - fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize); - #elif defined STAT_STATFS2_FRSIZE /* 2.6 < glibc/Linux < 2.6.36 */ struct statfs fsd; @@ -201,7 +194,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize); -#elif defined STAT_STATFS4 /* SVR3, old Irix */ +#elif defined STAT_STATFS4 /* SVR3 */ struct statfs fsd; diff --git a/gl/fsusage.h b/gl/fsusage.h index 00d9067e..bfa1857e 100644 --- a/gl/fsusage.h +++ b/gl/fsusage.h @@ -1,6 +1,6 @@ /* fsusage.h -- declarations for file system space usage info - Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2025 Free Software + Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/ftell.c b/gl/ftell.c index 96648d5a..f2a64e73 100644 --- a/gl/ftell.c +++ b/gl/ftell.c @@ -1,5 +1,5 @@ /* An ftell() function that works around platform bugs. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/ftello.c b/gl/ftello.c index b0a20bf3..e4f96d1a 100644 --- a/gl/ftello.c +++ b/gl/ftello.c @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -124,13 +124,11 @@ ftello (FILE *fp) gets confused by this. */ if (fp_->_flag & _IOWRT) { - off_t pos; - /* Call ftello nevertheless, for the side effects that it does on fp. */ ftello (fp); /* Compute the file position ourselves. */ - pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR); + off_t pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR); if (pos >= 0) { if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL) diff --git a/gl/gai_strerror.c b/gl/gai_strerror.c index 9c5f1419..ef6b506b 100644 --- a/gl/gai_strerror.c +++ b/gl/gai_strerror.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2025 Free Software +/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. @@ -27,7 +27,7 @@ # include #else # include "gettext.h" -# define _(msgid) dgettext ("gnulib", msgid) +# define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) # define N_(msgid) msgid #endif @@ -79,8 +79,7 @@ values[] = const char * gai_strerror (int code) { - size_t i; - for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i) + for (size_t i = 0; i < sizeof (values) / sizeof (values[0]); ++i) if (values[i].code == code) return _(values[i].msg); diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c index a8c45c21..2b60377b 100644 --- a/gl/getaddrinfo.c +++ b/gl/getaddrinfo.c @@ -1,5 +1,5 @@ /* Get address information (partial implementation). - Copyright (C) 1997, 2001-2002, 2004-2025 Free Software Foundation, Inc. + Copyright (C) 1997, 2001-2002, 2004-2026 Free Software Foundation, Inc. Contributed by Simon Josefsson . This file is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ #include #include "gettext.h" -#define _(msgid) dgettext ("gnulib", msgid) +#define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) #define N_(msgid) msgid /* BeOS has AF_INET, but not PF_INET. */ @@ -52,9 +52,40 @@ # define PF_UNSPEC 0 #endif +#if defined __sun || !HAVE_GETADDRINFO + +static bool +is_numeric_host (const char *host, int family) +{ +# if HAVE_IPV4 + if (family == PF_INET || family == PF_UNSPEC) + { + /* glibc supports IPv4 addresses in numbers-and-dots notation, that is, + also hexadecimal and octal number formats and formats that don't + require all four bytes to be explicitly written, via inet_aton(). + But POSIX doesn't require support for these legacy formats. Therefore + we are free to use inet_pton() instead of inet_aton(). */ + struct in_addr addr; + if (inet_pton (AF_INET, host, &addr)) + return true; + } +# endif +# if HAVE_IPV6 + if (family == PF_INET6 || family == PF_UNSPEC) + { + struct in6_addr addr; + if (inet_pton (AF_INET6, host, &addr)) + return true; + } +# endif + return false; +} + +#endif + #if HAVE_GETADDRINFO -/* Override with cdecl calling convention and mingw fix. */ +/* Override with cdecl calling convention and Windows and Solaris 10 fixes. */ int getaddrinfo (const char *restrict nodename, @@ -63,10 +94,18 @@ getaddrinfo (const char *restrict nodename, struct addrinfo **restrict res) # undef getaddrinfo { + /* Workaround for native Windows. */ if (hints && (hints->ai_flags & AI_NUMERICSERV) != 0 && servname && !(*servname >= '0' && *servname <= '9')) return EAI_NONAME; +# ifdef __sun + /* Workaround for Solaris 10. */ + if (hints && (hints->ai_flags & AI_NUMERICHOST) + && nodename && !is_numeric_host (nodename, hints->ai_family)) + return EAI_NONAME; +# endif + return getaddrinfo (nodename, servname, hints, res); } @@ -114,14 +153,13 @@ static int use_win32_p (void) { static int done = 0; - HMODULE h; if (done) return getaddrinfo_ptr ? 1 : 0; done = 1; - h = GetModuleHandle ("ws2_32.dll"); + HMODULE h = GetModuleHandle ("ws2_32.dll"); if (h) { @@ -185,33 +223,6 @@ validate_family (int family) return false; } -static bool -is_numeric_host (const char *host, int family) -{ -# if HAVE_IPV4 - if (family == PF_INET || family == PF_UNSPEC) - { - /* glibc supports IPv4 addresses in numbers-and-dots notation, that is, - also hexadecimal and octal number formats and formats that don't - require all four bytes to be explicitly written, via inet_aton(). - But POSIX doesn't require support for these legacy formats. Therefore - we are free to use inet_pton() instead of inet_aton(). */ - struct in_addr addr; - if (inet_pton (AF_INET, host, &addr)) - return true; - } -# endif -# if HAVE_IPV6 - if (family == PF_INET6 || family == PF_UNSPEC) - { - struct in6_addr addr; - if (inet_pton (AF_INET6, host, &addr)) - return true; - } -# endif - return false; -} - /* Translate name of a service location and/or a service name to set of socket addresses. */ int @@ -221,11 +232,6 @@ getaddrinfo (const char *restrict nodename, struct addrinfo **restrict res) #undef getaddrinfo { - struct addrinfo *tmp; - int port = 0; - struct hostent *he; - void *storage; - size_t size; # if HAVE_IPV6 struct v6_pair { struct addrinfo addrinfo; @@ -281,6 +287,7 @@ getaddrinfo (const char *restrict nodename, # endif } + int port = 0; if (servname) { struct servent *se = NULL; @@ -306,10 +313,11 @@ getaddrinfo (const char *restrict nodename, } /* FIXME: Use gethostbyname_r if available. */ - he = gethostbyname (nodename); + struct hostent *he = gethostbyname (nodename); if (!he || he->h_addr_list[0] == NULL) return EAI_NONAME; + size_t size; switch (he->h_addrtype) { # if HAVE_IPV6 @@ -328,10 +336,11 @@ getaddrinfo (const char *restrict nodename, return EAI_NODATA; } - storage = calloc (1, size); + void *storage = calloc (1, size); if (!storage) return EAI_MEMORY; + struct addrinfo *tmp; switch (he->h_addrtype) { # if HAVE_IPV6 @@ -446,9 +455,7 @@ freeaddrinfo (struct addrinfo *ai) while (ai) { - struct addrinfo *cur; - - cur = ai; + struct addrinfo *cur = ai; ai = ai->ai_next; free (cur->ai_canonname); diff --git a/gl/getdelim.c b/gl/getdelim.c index 2576d376..21f3abc2 100644 --- a/gl/getdelim.c +++ b/gl/getdelim.c @@ -1,5 +1,5 @@ /* getdelim.c --- Implementation of replacement getdelim function. - Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2025 Free Software + Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -62,10 +62,13 @@ alloc_failed (void) ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) { - ssize_t result; - size_t cur_len = 0; - - if (lineptr == NULL || n == NULL || fp == NULL) + if (lineptr == NULL || n == NULL + /* glibc already declares this function as __nonnull ((4)). + Avoid a gcc warning "‘nonnull’ argument ‘fp’ compared to NULL". */ +#if !(__GLIBC__ >= 2) + || fp == NULL +#endif + ) { errno = EINVAL; return -1; @@ -73,6 +76,8 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) flockfile (fp); + ssize_t result; + if (*lineptr == NULL || *n == 0) { char *new_lineptr; @@ -87,54 +92,56 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) *lineptr = new_lineptr; } - for (;;) - { - int i; - - i = getc_maybe_unlocked (fp); - if (i == EOF) - { - result = -1; + { + size_t cur_len = 0; + for (;;) + { + int i; + + i = getc_maybe_unlocked (fp); + if (i == EOF) + { + result = -1; + break; + } + + /* Make enough space for len+1 (for final NUL) bytes. */ + if (cur_len + 1 >= *n) + { + size_t needed_max = + SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; + size_t needed = 2 * *n + 1; /* Be generous. */ + + if (needed_max < needed) + needed = needed_max; + if (cur_len + 1 >= needed) + { + result = -1; + errno = EOVERFLOW; + goto unlock_return; + } + + char *new_lineptr = (char *) realloc (*lineptr, needed); + if (new_lineptr == NULL) + { + alloc_failed (); + result = -1; + goto unlock_return; + } + + *lineptr = new_lineptr; + *n = needed; + } + + (*lineptr)[cur_len] = i; + cur_len++; + + if (i == delimiter) break; - } - - /* Make enough space for len+1 (for final NUL) bytes. */ - if (cur_len + 1 >= *n) - { - size_t needed_max = - SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; - size_t needed = 2 * *n + 1; /* Be generous. */ - char *new_lineptr; - - if (needed_max < needed) - needed = needed_max; - if (cur_len + 1 >= needed) - { - result = -1; - errno = EOVERFLOW; - goto unlock_return; - } - - new_lineptr = (char *) realloc (*lineptr, needed); - if (new_lineptr == NULL) - { - alloc_failed (); - result = -1; - goto unlock_return; - } - - *lineptr = new_lineptr; - *n = needed; - } - - (*lineptr)[cur_len] = i; - cur_len++; - - if (i == delimiter) - break; - } - (*lineptr)[cur_len] = '\0'; - result = cur_len ? cur_len : result; + } + (*lineptr)[cur_len] = '\0'; + result = cur_len ? cur_len : result; + } unlock_return: funlockfile (fp); /* doesn't set errno */ diff --git a/gl/getdtablesize.c b/gl/getdtablesize.c index b98fbb70..cc823952 100644 --- a/gl/getdtablesize.c +++ b/gl/getdtablesize.c @@ -1,5 +1,5 @@ /* getdtablesize() function: Return maximum possible file descriptor value + 1. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify @@ -61,13 +61,10 @@ getdtablesize (void) { /* We are looking for the number N such that the valid file descriptors are 0..N-1. It can be obtained through a loop as follows: - { - int fd; - for (fd = 3; fd < 65536; fd++) - if (dup2 (0, fd) == -1) - break; - return fd; - } + for (int fd = 3; fd < 65536; fd++) + if (dup2 (0, fd) == -1) + break; + return fd; On Windows XP, the result is 2048. The drawback of this loop is that it allocates memory for a libc internal array that is never freed. diff --git a/gl/gethostname.c b/gl/gethostname.c index 8f0ceafc..464bac39 100644 --- a/gl/gethostname.c +++ b/gl/gethostname.c @@ -1,6 +1,6 @@ /* gethostname emulation for SysV and POSIX.1. - Copyright (C) 1992, 2003, 2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 1992, 2003, 2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -89,12 +89,10 @@ gethostname (char *name, size_t len) int rpl_gethostname (char *name, size_t len) { - int r; - if (len > INT_MAX) len = INT_MAX; gl_sockets_startup (SOCKETS_1_1); - r = gethostname (name, (int) len); + int r = gethostname (name, (int) len); if (r < 0) set_winsock_errno (); diff --git a/gl/getline.c b/gl/getline.c index 0921dd95..bbc8712d 100644 --- a/gl/getline.c +++ b/gl/getline.c @@ -1,5 +1,5 @@ /* getline.c --- Implementation of replacement getline function. - Copyright (C) 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/getloadavg.c b/gl/getloadavg.c index 752ec1f5..73b2ee28 100644 --- a/gl/getloadavg.c +++ b/gl/getloadavg.c @@ -1,6 +1,6 @@ /* Get the system load averages. - Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2025 Free Software + Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2026 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. @@ -140,21 +140,6 @@ # define SUNOS_5 # endif -# if defined (__osf__) && defined (__alpha) -# define OSF_ALPHA -# include -# include -# include -# include -/* Tru64 4.0D's table.h redefines sys */ -# undef sys -# endif - -# if defined (__osf__) && (defined (mips) || defined (__mips__)) -# define OSF_MIPS -# include -# endif - /* VAX C can't handle multi-line #ifs, or lines longer than 256 chars. */ # ifndef LOAD_AVE_TYPE @@ -167,31 +152,16 @@ # define LOAD_AVE_TYPE long # endif -# ifdef sgi -# define LOAD_AVE_TYPE long -# endif - # ifdef SVR4 # define LOAD_AVE_TYPE long # endif -# ifdef OSF_ALPHA -# define LOAD_AVE_TYPE long -# endif - # if defined _AIX && ! defined HAVE_LIBPERFSTAT # define LOAD_AVE_TYPE long # endif # endif /* No LOAD_AVE_TYPE. */ -# ifdef OSF_ALPHA -/* defines an incorrect value for FSCALE on Alpha OSF/1, - according to ghazi@noc.rutgers.edu. */ -# undef FSCALE -# define FSCALE 1024.0 -# endif - # ifndef FSCALE @@ -324,10 +294,6 @@ # endif # endif /* NeXT */ -# ifdef sgi -# include -# endif /* sgi */ - # ifdef UMAX # include # include @@ -389,7 +355,7 @@ static bool getloadavg_initialized; /* Offset in kmem to seek to read load average, or 0 means invalid. */ static long offset; -# if ! defined __VMS && ! defined sgi && ! (defined __linux__ || defined __ANDROID__) +# if ! defined __VMS && ! (defined __linux__ || defined __ANDROID__) static struct nlist name_list[2]; # endif @@ -418,51 +384,47 @@ getloadavg (double loadavg[], int nelem) # if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT) /* Solaris <= 2.6 */ /* Use libkstat because we don't have to be root. */ # define LDAV_DONE - kstat_ctl_t *kc; - kstat_t *ksp; - kstat_named_t *kn; - int saved_errno; - - kc = kstat_open (); - if (kc == NULL) - return -1; - ksp = kstat_lookup (kc, "unix", 0, "system_misc"); - if (ksp == NULL) - return -1; - if (kstat_read (kc, ksp, 0) == -1) - return -1; - - - kn = kstat_data_lookup (ksp, "avenrun_1min"); - if (kn == NULL) - { - /* Return -1 if no load average information is available. */ - nelem = 0; - elem = -1; - } - - if (nelem >= 1) - loadavg[elem++] = (double) kn->value.ul / FSCALE; - - if (nelem >= 2) - { - kn = kstat_data_lookup (ksp, "avenrun_5min"); - if (kn != NULL) - { - loadavg[elem++] = (double) kn->value.ul / FSCALE; + { + kstat_ctl_t *kc = kstat_open (); + if (kc == NULL) + return -1; + kstat_t *ksp = kstat_lookup (kc, "unix", 0, "system_misc"); + if (ksp == NULL) + return -1; + if (kstat_read (kc, ksp, 0) == -1) + return -1; - if (nelem >= 3) - { - kn = kstat_data_lookup (ksp, "avenrun_15min"); - if (kn != NULL) - loadavg[elem++] = (double) kn->value.ul / FSCALE; - } - } - } + kstat_named_t *kn = kstat_data_lookup (ksp, "avenrun_1min"); + if (kn == NULL) + { + /* Return -1 if no load average information is available. */ + nelem = 0; + elem = -1; + } + + if (nelem >= 1) + loadavg[elem++] = (double) kn->value.ul / FSCALE; + + if (nelem >= 2) + { + kn = kstat_data_lookup (ksp, "avenrun_5min"); + if (kn != NULL) + { + loadavg[elem++] = (double) kn->value.ul / FSCALE; + + if (nelem >= 3) + { + kn = kstat_data_lookup (ksp, "avenrun_15min"); + if (kn != NULL) + loadavg[elem++] = (double) kn->value.ul / FSCALE; + } + } + } - saved_errno = errno; - kstat_close (kc); - errno = saved_errno; + int saved_errno = errno; + kstat_close (kc); + errno = saved_errno; + } # endif /* HAVE_LIBKSTAT */ # if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC) @@ -523,13 +485,12 @@ getloadavg (double loadavg[], int nelem) char ldavgbuf[3 * (INT_STRLEN_BOUND (int) + sizeof ".00 ")]; char const *ptr = ldavgbuf; - int fd, count, saved_errno; - fd = open ("/proc/loadavg", O_RDONLY | O_CLOEXEC); + int fd = open ("/proc/loadavg", O_RDONLY | O_CLOEXEC); if (fd == -1) return -1; - count = read (fd, ldavgbuf, sizeof ldavgbuf - 1); - saved_errno = errno; + int count = read (fd, ldavgbuf, sizeof ldavgbuf - 1); + int saved_errno = errno; (void) close (fd); errno = saved_errno; if (count <= 0) @@ -538,9 +499,6 @@ getloadavg (double loadavg[], int nelem) for (elem = 0; elem < nelem; elem++) { - double numerator = 0; - double denominator = 1; - while (*ptr == ' ') ptr++; @@ -556,6 +514,9 @@ getloadavg (double loadavg[], int nelem) break; } + double numerator = 0; + double denominator = 1; + while ('0' <= *ptr && *ptr <= '9') numerator = 10 * numerator + (*ptr++ - '0'); @@ -578,24 +539,25 @@ getloadavg (double loadavg[], int nelem) # define NETBSD_LDAV_FILE "/kern/loadavg" # endif - unsigned long int load_ave[3], scale; - int count; - char readbuf[4 * INT_BUFSIZE_BOUND (unsigned long int) + 1]; int fd = open (NETBSD_LDAV_FILE, O_RDONLY | O_CLOEXEC); if (fd < 0) return fd; + + char readbuf[4 * INT_BUFSIZE_BOUND (unsigned long int) + 1]; int nread = read (fd, readbuf, sizeof readbuf - 1); - int err = errno; + int saved_errno = errno; close (fd); if (nread < 0) { - errno = err; + errno = saved_errno; return -1; } readbuf[nread] = '\0'; - count = sscanf (readbuf, "%lu %lu %lu %lu\n", - &load_ave[0], &load_ave[1], &load_ave[2], - &scale); + + unsigned long int load_ave[3], scale; + int count = sscanf (readbuf, "%lu %lu %lu %lu\n", + &load_ave[0], &load_ave[1], &load_ave[2], + &scale); if (count != 4) { errno = ENOTSUP; @@ -613,10 +575,6 @@ getloadavg (double loadavg[], int nelem) # define LDAV_DONE /* The NeXT code was adapted from iscreen 3.2. */ - host_t host; - struct processor_set_basic_info info; - unsigned int info_count; - /* We only know how to get the 1-minute average for this system, so even if the caller asks for more than 1, we only return 1. */ @@ -628,7 +586,9 @@ getloadavg (double loadavg[], int nelem) if (getloadavg_initialized) { - info_count = PROCESSOR_SET_BASIC_INFO_COUNT; + host_t host; + struct processor_set_basic_info info; + unsigned int info_count = PROCESSOR_SET_BASIC_INFO_COUNT; if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host, (processor_set_info_t) &info, &info_count) != KERN_SUCCESS) @@ -654,14 +614,9 @@ getloadavg (double loadavg[], int nelem) can be gathered with inq_stats system calls. We only know how to get the 1-minute average for this system. */ - struct proc_summary proc_sum_data; - struct stat_descr proc_info; - double load; - register unsigned int i, j; - if (cpus == 0) { - register unsigned int c, i; + register unsigned int c; struct cpu_config conf; struct stat_descr desc; @@ -675,7 +630,7 @@ getloadavg (double loadavg[], int nelem) return -1; c = 0; - for (i = 0; i < conf.config_maxclass; ++i) + for (unsigned int i = 0; i < conf.config_maxclass; ++i) { struct class_stats stats; memset (&stats, 0, sizeof stats); @@ -694,6 +649,9 @@ getloadavg (double loadavg[], int nelem) samples = cpus < 2 ? 3 : (2 * cpus / 3); } + struct proc_summary proc_sum_data; + + struct stat_descr proc_info; proc_info.sd_next = 0; proc_info.sd_subsys = SUBSYS_PROC; proc_info.sd_type = PROCTYPE_SUMMARY; @@ -704,9 +662,9 @@ getloadavg (double loadavg[], int nelem) if (inq_stats (1, &proc_info) != 0) return -1; - load = proc_sum_data.ps_nrunnable; - j = 0; - for (i = samples - 1; i > 0; --i) + double load = proc_sum_data.ps_nrunnable; + register unsigned int j = 0; + for (unsigned int i = samples - 1; i > 0; --i) { load += proc_sum_data.ps_nrun[j]; if (j++ == PS_NRUNSIZE) @@ -781,18 +739,6 @@ getloadavg (double loadavg[], int nelem) } # endif /* __MSDOS__ || WINDOWS32 */ -# if !defined (LDAV_DONE) && defined (OSF_ALPHA) /* OSF/1 */ -# define LDAV_DONE - - struct tbl_loadavg load_ave; - table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); - for (elem = 0; elem < nelem; elem++) - loadavg[elem] - = (load_ave.tl_lscale == 0 - ? load_ave.tl_avenrun.d[elem] - : (load_ave.tl_avenrun.l[elem] / (double) load_ave.tl_lscale)); -# endif /* OSF_ALPHA */ - # if ! defined LDAV_DONE && defined __VMS /* VMS */ /* VMS specific code -- read from the Load Ave driver. */ @@ -837,52 +783,44 @@ getloadavg (double loadavg[], int nelem) # endif /* ! defined LDAV_DONE && defined __VMS */ # if ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS - /* IRIX, other old systems */ + /* other old systems */ /* UNIX-specific code -- read the average from /dev/kmem. */ # define LDAV_PRIVILEGED /* This code requires special installation. */ - LOAD_AVE_TYPE load_ave[3]; - /* Get the address of LDAV_SYMBOL. */ if (offset == 0) { -# ifndef sgi -# if ! defined NLIST_STRUCT || ! defined N_NAME_POINTER +# if ! defined NLIST_STRUCT || ! defined N_NAME_POINTER strcpy (name_list[0].n_name, LDAV_SYMBOL); strcpy (name_list[1].n_name, ""); -# else /* NLIST_STRUCT */ -# ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME +# else /* NLIST_STRUCT */ +# ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME name_list[0].n_un.n_name = LDAV_SYMBOL; name_list[1].n_un.n_name = 0; -# else /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */ +# else /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */ name_list[0].n_name = LDAV_SYMBOL; name_list[1].n_name = 0; -# endif /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */ -# endif /* NLIST_STRUCT */ +# endif /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */ +# endif /* NLIST_STRUCT */ -# ifndef SUNOS_5 +# ifndef SUNOS_5 if ( -# if !defined (_AIX) +# if !defined (_AIX) nlist (KERNEL_FILE, name_list) -# else /* _AIX */ +# else /* _AIX */ knlist (name_list, 1, sizeof (name_list[0])) -# endif +# endif >= 0) /* Omit "&& name_list[0].n_type != 0 " -- it breaks on Sun386i. */ { -# ifdef FIXUP_KERNEL_SYMBOL_ADDR +# ifdef FIXUP_KERNEL_SYMBOL_ADDR FIXUP_KERNEL_SYMBOL_ADDR (name_list); -# endif +# endif offset = name_list[0].n_value; } -# endif /* !SUNOS_5 */ -# else /* sgi */ - ptrdiff_t ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN); - if (ldav_off != -1) - offset = (long int) ldav_off & 0x7fffffff; -# endif /* sgi */ +# endif /* !SUNOS_5 */ } /* Make sure we have /dev/kmem open. */ @@ -909,6 +847,8 @@ getloadavg (double loadavg[], int nelem) # endif /* SUNOS_5 */ } + LOAD_AVE_TYPE load_ave[3]; + /* If we can, get the load average values. */ if (offset && getloadavg_initialized) { diff --git a/gl/getopt-cdefs.in.h b/gl/getopt-cdefs.in.h index 3a5d06be..57406947 100644 --- a/gl/getopt-cdefs.in.h +++ b/gl/getopt-cdefs.in.h @@ -1,5 +1,5 @@ /* getopt-on-non-glibc compatibility macros. - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gl/getopt-core.h b/gl/getopt-core.h index 51ac213d..c815966f 100644 --- a/gl/getopt-core.h +++ b/gl/getopt-core.h @@ -1,5 +1,5 @@ /* Declarations for getopt (basic, portable features only). - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gl/getopt-ext.h b/gl/getopt-ext.h index 92b66a3b..c0784d96 100644 --- a/gl/getopt-ext.h +++ b/gl/getopt-ext.h @@ -1,5 +1,5 @@ /* Declarations for getopt (GNU extensions). - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gl/getopt-pfx-core.h b/gl/getopt-pfx-core.h index 7c5ea094..d7dd8788 100644 --- a/gl/getopt-pfx-core.h +++ b/gl/getopt-pfx-core.h @@ -1,5 +1,5 @@ /* getopt (basic, portable features) gnulib wrapper header. - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gl/getopt-pfx-ext.h b/gl/getopt-pfx-ext.h index a61c68c7..db2e27f3 100644 --- a/gl/getopt-pfx-ext.h +++ b/gl/getopt-pfx-ext.h @@ -1,5 +1,5 @@ /* getopt (GNU extensions) gnulib wrapper header. - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gl/getopt.c b/gl/getopt.c index 6b155e6c..406a406b 100644 --- a/gl/getopt.c +++ b/gl/getopt.c @@ -1,5 +1,5 @@ /* Getopt for GNU. - Copyright (C) 1987-2025 Free Software Foundation, Inc. + Copyright (C) 1987-2026 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. @@ -42,7 +42,7 @@ # define funlockfile(fp) _IO_funlockfile (fp) #else # include "gettext.h" -# define _(msgid) dgettext ("gnulib", msgid) +# define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) /* When used standalone, flockfile and funlockfile might not be available. */ # if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \ @@ -133,7 +133,6 @@ exchange (char **argv, struct _getopt_data *d) int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; - char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. @@ -151,7 +150,7 @@ exchange (char **argv, struct _getopt_data *d) /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { - tem = argv[bottom + i]; + char *tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } @@ -167,7 +166,7 @@ exchange (char **argv, struct _getopt_data *d) /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { - tem = argv[bottom + i]; + char *tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } @@ -196,28 +195,29 @@ process_long_option (int argc, char **argv, const char *optstring, int long_only, struct _getopt_data *d, int print_errors, const char *prefix) { - char *nameend; - size_t namelen; - const struct option *p; - const struct option *pfound = NULL; - int n_options; - int option_index; + char *nameend; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; - namelen = nameend - d->__nextchar; + size_t namelen = nameend - d->__nextchar; /* First look for an exact match, counting the options as a side effect. */ - for (p = longopts, n_options = 0; p->name; p++, n_options++) - if (!strncmp (p->name, d->__nextchar, namelen) - && namelen == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - option_index = n_options; - break; - } + const struct option *pfound = NULL; + int n_options; + int option_index; + { + const struct option *p; + for (p = longopts, n_options = 0; p->name; p++, n_options++) + if (!strncmp (p->name, d->__nextchar, namelen) + && namelen == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + option_index = n_options; + break; + } + } if (pfound == NULL) { @@ -227,6 +227,7 @@ process_long_option (int argc, char **argv, const char *optstring, unsigned char ambig_fallback; void *ambig_malloced = NULL; int indfound = -1; + const struct option *p; for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, namelen)) @@ -475,11 +476,11 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, struct _getopt_data *d, int posixly_correct) { - int print_errors = d->opterr; - if (argc < 1) return -1; + int print_errors = d->opterr; + d->optarg = NULL; if (d->optind == 0 || !d->__initialized) @@ -594,11 +595,10 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, if (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))) { - int code; d->__nextchar = argv[d->optind] + 1; - code = process_long_option (argc, argv, optstring, longopts, - longind, long_only, d, - print_errors, "-"); + int code = process_long_option (argc, argv, optstring, longopts, + longind, long_only, d, + print_errors, "-"); if (code != -1) return code; } @@ -707,14 +707,12 @@ _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { - int result; - getopt_data.optind = optind; getopt_data.opterr = opterr; - result = _getopt_internal_r (argc, argv, optstring, longopts, - longind, long_only, &getopt_data, - posixly_correct); + int result = _getopt_internal_r (argc, argv, optstring, longopts, + longind, long_only, &getopt_data, + posixly_correct); optind = getopt_data.optind; optarg = getopt_data.optarg; @@ -751,14 +749,13 @@ GETOPT_ENTRY(getopt, 1) int main (int argc, char **argv) { - int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; - c = getopt (argc, argv, "abc:d:0123456789"); + int c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; diff --git a/gl/getopt.in.h b/gl/getopt.in.h index 4a87a2d5..e72a034b 100644 --- a/gl/getopt.in.h +++ b/gl/getopt.in.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library, which supplies a different version of diff --git a/gl/getopt1.c b/gl/getopt1.c index c8566845..a5f99888 100644 --- a/gl/getopt1.c +++ b/gl/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2025 Free Software Foundation, Inc. + Copyright (C) 1987-2026 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. @@ -73,7 +73,6 @@ _getopt_long_only_r (int argc, char **argv, const char *options, int main (int argc, char **argv) { - int c; int digit_optind = 0; while (1) @@ -91,8 +90,8 @@ main (int argc, char **argv) {0, 0, 0, 0} }; - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); + int c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); if (c == -1) break; diff --git a/gl/getopt_int.h b/gl/getopt_int.h index 94c1945c..023d8a4f 100644 --- a/gl/getopt_int.h +++ b/gl/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1989-2026 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gl/getprogname.c b/gl/getprogname.c index 4fe7c90d..8eec96c5 100644 --- a/gl/getprogname.c +++ b/gl/getprogname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2025 Free Software Foundation, Inc. + Copyright (C) 2016-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -42,14 +42,6 @@ # include #endif -#if defined __sgi || defined __osf__ -# include -# include -# include -# include -# include -#endif - #if defined __SCO_VERSION__ || defined __sysv5__ # include # include @@ -137,7 +129,7 @@ getprogname (void) else p = cmd; if (strlen (p) > PST_UCOMMLEN - 1 - && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0) + && memeq (p, ucomm, PST_UCOMMLEN - 1)) /* p is less truncated than ucomm. */ ; else @@ -173,7 +165,7 @@ getprogname (void) else p = cmd; if (strlen (p) > PST_UCOMMLEN - 1 - && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0) + && memeq (p, ucomm, PST_UCOMMLEN - 1)) /* p is less truncated than ucomm. */ ; else @@ -196,7 +188,6 @@ getprogname (void) if (first) { pid_t pid = getpid (); - int token; W_PSPROC buf; first = 0; memset (&buf, 0, sizeof(buf)); @@ -205,7 +196,8 @@ getprogname (void) buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN); if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr) { - for (token = 0; token >= 0; + for (int token = 0; + token >= 0; token = w_getpsent (token, &buf, sizeof(buf))) { if (token > 0 && buf.ps_pid == pid) @@ -234,60 +226,22 @@ getprogname (void) free (buf.ps_pathptr); } return p; -# elif defined __sgi || defined __osf__ /* IRIX or Tru64 */ - char filename[50]; - int fd; - - # if defined __sgi - sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); - # else - sprintf (filename, "/proc/%d", (int) getpid ()); - # endif - fd = open (filename, O_RDONLY | O_CLOEXEC); - if (0 <= fd) - { - prpsinfo_t buf; - int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf); - close (fd); - if (ioctl_ok) - { - char *name = buf.pr_fname; - size_t namesize = sizeof buf.pr_fname; - /* It may not be NUL-terminated. */ - char *namenul = memchr (name, '\0', namesize); - size_t namelen = namenul ? namenul - name : namesize; - char *namecopy = malloc (namelen + 1); - if (namecopy) - { - namecopy[namelen] = '\0'; - return memcpy (namecopy, name, namelen); - } - } - } - return NULL; # elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */ char buf[80]; - int fd; sprintf (buf, "/proc/%d/cmdline", getpid()); - fd = open (buf, O_RDONLY); + int fd = open (buf, O_RDONLY); if (0 <= fd) { size_t n = read (fd, buf, 79); if (n > 0) { buf[n] = '\0'; /* Guarantee null-termination */ - char *progname; - progname = strrchr (buf, '/'); + char *progname = strrchr (buf, '/'); if (progname) - { - progname = progname + 1; /* Skip the '/' */ - } + progname = progname + 1; /* Skip the '/' */ else - { - progname = buf; - } - char *ret; - ret = malloc (strlen (progname) + 1); + progname = buf; + char *ret = malloc (strlen (progname) + 1); if (ret) { strcpy (ret, progname); diff --git a/gl/getprogname.h b/gl/getprogname.h index ee9bb286..3b5e502e 100644 --- a/gl/getprogname.h +++ b/gl/getprogname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2025 Free Software Foundation, Inc. + Copyright (C) 2016-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/gl/gettext.h b/gl/gettext.h index 0650abc9..0291cf09 100644 --- a/gl/gettext.h +++ b/gl/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-2025 Free Software Foundation, Inc. + Copyright (C) 1995-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -298,12 +298,11 @@ dcpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { - int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); - found_translation = (translation != msg_ctxt_id); + int found_translation = (translation != msg_ctxt_id); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); @@ -346,12 +345,11 @@ dcnpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { - int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); - found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); + int found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); diff --git a/gl/gl_openssl.h b/gl/gl_openssl.h index dea70c1c..06fd8f66 100644 --- a/gl/gl_openssl.h +++ b/gl/gl_openssl.h @@ -1,6 +1,6 @@ /* Wrap openssl crypto hash routines in gnulib interface. -*- coding: utf-8 -*- - Copyright (C) 2013-2025 Free Software Foundation, Inc. + Copyright (C) 2013-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -103,7 +103,7 @@ GL_OPENSSL_INLINE void * GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *restrict res) { /* Assume any unprocessed bytes in ctx are not to be ignored. */ - _gl_CTX tmp_ctx = *(_gl_CTX *) ctx; + _gl_CTX tmp_ctx = *(_gl_CTX const *) ctx; OPENSSL_FN (_Final) ((unsigned char *) res, &tmp_ctx); return res; } diff --git a/gl/glthread/lock.c b/gl/glthread/lock.c index dace4fda..cfb9393c 100644 --- a/gl/glthread/lock.c +++ b/gl/glthread/lock.c @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -255,15 +255,13 @@ glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) # if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP # if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER - /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ + /* glibc with bug https://sourceware.org/PR13701 */ int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) { pthread_rwlockattr_t attributes; - int err; - - err = pthread_rwlockattr_init (&attributes); + int err = pthread_rwlockattr_init (&attributes); if (err != 0) return err; /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that @@ -286,9 +284,7 @@ glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_rwlock_init (&lock->rwlock, NULL); + int err = pthread_rwlock_init (&lock->rwlock, NULL); if (err != 0) return err; lock->initialized = 1; @@ -300,9 +296,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -326,9 +320,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -358,11 +350,9 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { - int err; - if (!lock->initialized) return EINVAL; - err = pthread_rwlock_destroy (&lock->rwlock); + int err = pthread_rwlock_destroy (&lock->rwlock); if (err != 0) return err; lock->initialized = 0; @@ -376,9 +366,7 @@ glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_init (&lock->lock, NULL); + int err = pthread_mutex_init (&lock->lock, NULL); if (err != 0) return err; err = pthread_cond_init (&lock->waiting_readers, NULL); @@ -395,9 +383,7 @@ glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether only readers are currently running, and whether the runcount @@ -422,9 +408,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether no readers or writers are currently running. */ @@ -449,9 +433,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; if (lock->runcount < 0) @@ -505,9 +487,7 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_destroy (&lock->lock); + int err = pthread_mutex_destroy (&lock->lock); if (err != 0) return err; err = pthread_cond_destroy (&lock->waiting_readers); @@ -531,9 +511,7 @@ int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; - int err; - - err = pthread_mutexattr_init (&attributes); + int err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); @@ -560,9 +538,7 @@ int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; - int err; - - err = pthread_mutexattr_init (&attributes); + int err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); @@ -589,9 +565,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -621,11 +595,9 @@ glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { - int err; - if (!lock->initialized) return EINVAL; - err = pthread_mutex_destroy (&lock->recmutex); + int err = pthread_mutex_destroy (&lock->recmutex); if (err != 0) return err; lock->initialized = 0; @@ -639,9 +611,7 @@ glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { - int err; - - err = pthread_mutex_init (&lock->mutex, NULL); + int err = pthread_mutex_init (&lock->mutex, NULL); if (err != 0) return err; lock->owner = (pthread_t) 0; @@ -655,9 +625,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) pthread_t self = pthread_self (); if (lock->owner != self) { - int err; - - err = pthread_mutex_lock (&lock->mutex); + int err = pthread_mutex_lock (&lock->mutex); if (err != 0) return err; lock->owner = self; diff --git a/gl/glthread/lock.h b/gl/glthread/lock.h index d6ccc202..d8190b6c 100644 --- a/gl/glthread/lock.h +++ b/gl/glthread/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -239,7 +239,7 @@ typedef pthread_rwlock_t gl_rwlock_t; # endif # define glthread_rwlock_init(LOCK) \ (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0) -# else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ +# else /* glibc with bug https://sourceware.org/PR13701 */ # define gl_rwlock_initializer \ PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP # define glthread_rwlock_init(LOCK) \ diff --git a/gl/glthread/once.c b/gl/glthread/once.c index 53211af8..b72a4a20 100644 --- a/gl/glthread/once.c +++ b/gl/glthread/once.c @@ -1,5 +1,5 @@ /* Once-only initialization in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/glthread/once.h b/gl/glthread/once.h index 943bd7a2..b6d9ab40 100644 --- a/gl/glthread/once.h +++ b/gl/glthread/once.h @@ -1,5 +1,5 @@ /* Once-only initialization in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/glthread/threadlib.c b/gl/glthread/threadlib.c index a6f7688b..5c0ba1f4 100644 --- a/gl/glthread/threadlib.c +++ b/gl/glthread/threadlib.c @@ -1,5 +1,5 @@ /* Multithreading primitives. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/hard-locale.c b/gl/hard-locale.c index 767906d1..6a3dad4f 100644 --- a/gl/hard-locale.c +++ b/gl/hard-locale.c @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2025 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -32,7 +32,7 @@ hard_locale (int category) if (setlocale_null_r (category, locale, sizeof (locale))) return false; - if (!(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)) + if (!(streq (locale, "C") || streq (locale, "POSIX"))) return true; #if defined __ANDROID__ diff --git a/gl/hard-locale.h b/gl/hard-locale.h index 29808da6..b8d7029d 100644 --- a/gl/hard-locale.h +++ b/gl/hard-locale.h @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/ialloc.c b/gl/ialloc.c index 881c8f04..38ec1d05 100644 --- a/gl/ialloc.c +++ b/gl/ialloc.c @@ -1,6 +1,6 @@ /* malloc with idx_t rather than size_t - Copyright 2021-2025 Free Software Foundation, Inc. + Copyright 2021-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define IALLOC_INLINE _GL_EXTERN_INLINE +#include #include "ialloc.h" diff --git a/gl/ialloc.h b/gl/ialloc.h index 8bf5dd12..97b0e0c5 100644 --- a/gl/ialloc.h +++ b/gl/ialloc.h @@ -1,6 +1,6 @@ /* ialloc.h -- malloc with idx_t rather than size_t - Copyright 2021-2025 Free Software Foundation, Inc. + Copyright 2021-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/idpriv-droptemp.c b/gl/idpriv-droptemp.c index ecaab836..993d25b6 100644 --- a/gl/idpriv-droptemp.c +++ b/gl/idpriv-droptemp.c @@ -1,5 +1,5 @@ /* Dropping uid/gid privileges of the current process temporarily. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ idpriv_temp_drop (void) # if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */ if (setresgid (-1, gid, saved_gid) < 0) return -1; -# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */ +# else /* Mac OS X, NetBSD, AIX, Solaris >= 2.5, Cygwin */ if (setregid (-1, gid) < 0) return -1; # endif @@ -64,7 +64,7 @@ idpriv_temp_drop (void) figure 14. */ if (setresuid (-1, uid, saved_uid) < 0) return -1; -# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */ +# else /* Mac OS X, NetBSD, AIX, Solaris >= 2.5, Cygwin */ if (setreuid (-1, uid) < 0) return -1; # endif @@ -142,7 +142,7 @@ idpriv_temp_restore (void) figure 14. */ if (setresuid (-1, saved_uid, -1) < 0) return -1; -# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */ +# else /* Mac OS X, NetBSD, AIX, Solaris >= 2.5, Cygwin */ if (setreuid (-1, saved_uid) < 0) return -1; # endif @@ -151,7 +151,7 @@ idpriv_temp_restore (void) # if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */ if (setresgid (-1, saved_gid, -1) < 0) return -1; -# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */ +# else /* Mac OS X, NetBSD, AIX, Solaris >= 2.5, Cygwin */ if (setregid (-1, saved_gid) < 0) return -1; # endif diff --git a/gl/idpriv.h b/gl/idpriv.h index f4f8158e..8fa6c0e6 100644 --- a/gl/idpriv.h +++ b/gl/idpriv.h @@ -1,5 +1,5 @@ /* Dropping uid/gid privileges of the current process. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/idx.h b/gl/idx.h index 639b6cf0..deb7dc4c 100644 --- a/gl/idx.h +++ b/gl/idx.h @@ -1,5 +1,5 @@ /* A type for indices and sizes. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c index df3d9512..599ca4fb 100644 --- a/gl/inet_ntop.c +++ b/gl/inet_ntop.c @@ -1,6 +1,6 @@ /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form - Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -125,9 +125,7 @@ static const char * inet_ntop4 (const unsigned char *src, char *dst, socklen_t size) { char tmp[sizeof "255.255.255.255"]; - int len; - - len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]); + int len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]); if (len < 0) return NULL; @@ -151,34 +149,26 @@ inet_ntop4 (const unsigned char *src, char *dst, socklen_t size) static const char * inet_ntop6 (const unsigned char *src, char *dst, socklen_t size) { - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; - struct - { - int base, len; - } best, cur; - unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ]; - int i; - /* * Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ + unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ]; memset (words, '\0', sizeof words); - for (i = 0; i < NS_IN6ADDRSZ; i += 2) + for (int i = 0; i < NS_IN6ADDRSZ; i += 2) words[i / 2] = (src[i] << 8) | src[i + 1]; + + struct + { + int base, len; + } best, cur; best.base = -1; cur.base = -1; IF_LINT(best.len = 0); IF_LINT(cur.len = 0); - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) + + for (int i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { @@ -208,8 +198,16 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size) /* * Format the result. */ - tp = tmp; - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; + char *tp = tmp; + for (int i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) diff --git a/gl/inet_pton.c b/gl/inet_pton.c index 74d55c43..1e75c8c5 100644 --- a/gl/inet_pton.c +++ b/gl/inet_pton.c @@ -1,6 +1,6 @@ /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form - Copyright (C) 2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -112,43 +112,44 @@ inet_pton (int af, const char *restrict src, void *restrict dst) static int inet_pton4 (const char *restrict src, unsigned char *restrict dst) { - int saw_digit, octets, ch; - unsigned char tmp[NS_INADDRSZ], *tp; + unsigned char tmp[NS_INADDRSZ]; - saw_digit = 0; - octets = 0; - *(tp = tmp) = 0; - while ((ch = *src++) != '\0') - { - - if (ch >= '0' && ch <= '9') - { - unsigned new = *tp * 10 + (ch - '0'); - - if (saw_digit && *tp == 0) - return (0); - if (new > 255) - return (0); - *tp = new; - if (!saw_digit) - { - if (++octets > 4) - return (0); - saw_digit = 1; - } - } - else if (ch == '.' && saw_digit) - { - if (octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } - else - return (0); - } - if (octets < 4) - return (0); + { + int saw_digit = 0; + int octets = 0; + unsigned char *tp = tmp; + *tp = 0; + int ch; + while ((ch = *src++) != '\0') + { + if (ch >= '0' && ch <= '9') + { + if (saw_digit && *tp == 0) + return (0); + unsigned new = *tp * 10 + (ch - '0'); + if (new > 255) + return (0); + *tp = new; + if (!saw_digit) + { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } + else if (ch == '.' && saw_digit) + { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } + else + return (0); + } + if (octets < 4) + return (0); + } memcpy (dst, tmp, NS_INADDRSZ); return (1); } @@ -172,93 +173,89 @@ static int inet_pton6 (const char *restrict src, unsigned char *restrict dst) { static const char xdigits[] = "0123456789abcdef"; - unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; - const char *curtok; - int ch, saw_xdigit; - unsigned val; + unsigned char tmp[NS_IN6ADDRSZ]; - tp = memset (tmp, '\0', NS_IN6ADDRSZ); - endp = tp + NS_IN6ADDRSZ; - colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') return (0); - curtok = src; - saw_xdigit = 0; - val = 0; - while ((ch = c_tolower (*src++)) != '\0') - { - const char *pch; - pch = strchr (xdigits, ch); - if (pch != NULL) - { - val <<= 4; - val |= (pch - xdigits); - if (val > 0xffff) - return (0); - saw_xdigit = 1; - continue; - } - if (ch == ':') - { - curtok = src; - if (!saw_xdigit) - { - if (colonp) - return (0); - colonp = tp; - continue; - } - else if (*src == '\0') - { + { + unsigned char *tp = memset (tmp, '\0', NS_IN6ADDRSZ); + unsigned char *endp = tp + NS_IN6ADDRSZ; + unsigned char *colonp = NULL; + const char *curtok = src; + int saw_xdigit = 0; + unsigned int val = 0; + int ch; + while ((ch = c_tolower (*src++)) != '\0') + { + const char *pch = strchr (xdigits, ch); + if (pch != NULL) + { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) return (0); - } - if (tp + NS_INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - saw_xdigit = 0; - val = 0; - continue; - } - if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && - inet_pton4 (curtok, tp) > 0) - { - tp += NS_INADDRSZ; - saw_xdigit = 0; - break; /* '\0' was seen by inet_pton4(). */ - } + saw_xdigit = 1; + } + else if (ch == ':') + { + curtok = src; + if (!saw_xdigit) + { + if (colonp) + return (0); + colonp = tp; + } + else if (*src == '\0') + return (0); + else if (tp + NS_INT16SZ > endp) + return (0); + else + { + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + saw_xdigit = 0; + val = 0; + } + } + else if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4 (curtok, tp) > 0) + { + tp += NS_INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + else + return (0); + } + if (saw_xdigit) + { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + } + if (colonp != NULL) + { + if (tp == endp) + return (0); + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + for (int i = 1; i <= n; i++) + { + endp[-i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) return (0); - } - if (saw_xdigit) - { - if (tp + NS_INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - } - if (colonp != NULL) - { - /* - * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. - */ - const int n = tp - colonp; - int i; - - if (tp == endp) - return (0); - for (i = 1; i <= n; i++) - { - endp[-i] = colonp[n - i]; - colonp[n - i] = 0; - } - tp = endp; - } - if (tp != endp) - return (0); + } memcpy (dst, tmp, NS_IN6ADDRSZ); return (1); } diff --git a/gl/intprops-internal.h b/gl/intprops-internal.h index 7ace0cdd..0df385b9 100644 --- a/gl/intprops-internal.h +++ b/gl/intprops-internal.h @@ -1,6 +1,6 @@ /* intprops-internal.h -- properties of integer types not visible to users - Copyright (C) 2001-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -29,10 +29,6 @@ Do not evaluate E. */ #define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) -/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see - . */ -#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) - /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -41,7 +37,7 @@ /* Return 1 if the real expression E, after promotion, has a signed or floating type. Do not evaluate E. */ -#define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) +#define _GL_EXPR_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0) /* Minimum and maximum values for integer types and expressions. */ @@ -60,7 +56,7 @@ #define _GL_INT_MAXIMUM(e) \ (_GL_EXPR_SIGNED (e) \ ? _GL_SIGNED_INT_MAXIMUM (e) \ - : _GL_INT_NEGATE_CONVERT (e, 1)) + : _GL_INT_CONVERT (e, -1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) @@ -112,7 +108,7 @@ #elif defined __has_builtin # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) /* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, - see . */ + see . */ #elif 7 <= __GNUC__ # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 #else @@ -184,7 +180,7 @@ #endif /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25764. See: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://gcc.gnu.org/PR68193 https://github.com/llvm/llvm-project/issues/25764 For now, assume GCC < 14 and all Clang versions generate bogus warnings for _Generic. This matters only for compilers that diff --git a/gl/intprops.h b/gl/intprops.h index 2f9fa0a0..924b6f9a 100644 --- a/gl/intprops.h +++ b/gl/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -205,11 +205,11 @@ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) #endif #define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ : (a) < 0 ? (b) <= (a) + (b) - 1 \ : (b) < 0 && (a) + (b) <= (a)) #define _GL_REMAINDER_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max)) diff --git a/gl/inttypes.in.h b/gl/inttypes.in.h index 5520ebc5..cbe5a6f0 100644 --- a/gl/inttypes.in.h +++ b/gl/inttypes.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2025 Free Software Foundation, Inc. +/* Copyright (C) 2006-2026 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. @@ -925,7 +925,6 @@ _GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x)); _GL_CXXALIASWARN (imaxabs); # endif #elif defined GNULIB_POSIXCHECK -# undef imaxabs # if HAVE_RAW_DECL_IMAXABS _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " "use gnulib module imaxabs for portability"); @@ -956,7 +955,6 @@ _GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); _GL_CXXALIASWARN (imaxdiv); # endif #elif defined GNULIB_POSIXCHECK -# undef imaxdiv # if HAVE_RAW_DECL_IMAXDIV _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " "use gnulib module imaxdiv for portability"); @@ -986,7 +984,6 @@ _GL_CXXALIAS_SYS (strtoimax, intmax_t, # endif _GL_CXXALIASWARN (strtoimax); #elif defined GNULIB_POSIXCHECK -# undef strtoimax # if HAVE_RAW_DECL_STRTOIMAX _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " "use gnulib module strtoimax for portability"); @@ -1016,7 +1013,6 @@ _GL_CXXALIAS_SYS (strtoumax, uintmax_t, # endif _GL_CXXALIASWARN (strtoumax); #elif defined GNULIB_POSIXCHECK -# undef strtoumax # if HAVE_RAW_DECL_STRTOUMAX _GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " "use gnulib module strtoumax for portability"); diff --git a/gl/iswblank.c b/gl/iswblank.c index 6e361f43..c09f33bd 100644 --- a/gl/iswblank.c +++ b/gl/iswblank.c @@ -1,5 +1,5 @@ /* Test wide character for being blank. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/iswctype-impl.h b/gl/iswctype-impl.h index c87e00ff..34d84b19 100644 --- a/gl/iswctype-impl.h +++ b/gl/iswctype-impl.h @@ -1,5 +1,5 @@ /* Test whether a wide character has a given property. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify diff --git a/gl/iswctype.c b/gl/iswctype.c index 576e93e4..97a60032 100644 --- a/gl/iswctype.c +++ b/gl/iswctype.c @@ -1,5 +1,5 @@ /* Test whether a wide character has a given property. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify diff --git a/gl/iswdigit.c b/gl/iswdigit.c index 6bba487b..65616822 100644 --- a/gl/iswdigit.c +++ b/gl/iswdigit.c @@ -1,5 +1,5 @@ /* Test wide character for being a digit. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/iswpunct.c b/gl/iswpunct.c index 2b9258a9..5308ddae 100644 --- a/gl/iswpunct.c +++ b/gl/iswpunct.c @@ -1,5 +1,5 @@ /* Test wide character for being a punctuation or symbol character. - Copyright (C) 2023-2025 Free Software Foundation, Inc. + Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/iswxdigit.c b/gl/iswxdigit.c index e154ac80..7db2f676 100644 --- a/gl/iswxdigit.c +++ b/gl/iswxdigit.c @@ -1,5 +1,5 @@ /* Test wide character for being a hexadecimal digit. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/itold.c b/gl/itold.c index 084eba23..d240fb7e 100644 --- a/gl/itold.c +++ b/gl/itold.c @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify diff --git a/gl/langinfo.in.h b/gl/langinfo.in.h index e16c95b3..4b3f9b5b 100644 --- a/gl/langinfo.in.h +++ b/gl/langinfo.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -162,11 +162,6 @@ typedef int nl_item; # define GNULIB_defined_CODESET 1 # endif -# if !@HAVE_LANGINFO_T_FMT_AMPM@ -# define T_FMT_AMPM 10006 -# define GNULIB_defined_T_FMT_AMPM 1 -# endif - # if !@HAVE_LANGINFO_ALTMON@ # define ALTMON_1 10200 # define ALTMON_2 (ALTMON_1 + 1) @@ -223,12 +218,6 @@ typedef int nl_item; # define GNULIB_defined_ERA 1 # endif -# if !@HAVE_LANGINFO_YESEXPR@ -# define YESEXPR 10053 -# define NOEXPR 10054 -# define GNULIB_defined_YESEXPR 1 -# endif - #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -260,7 +249,6 @@ _GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item)); _GL_CXXALIASWARN (nl_langinfo); # endif #elif defined GNULIB_POSIXCHECK -# undef nl_langinfo # if HAVE_RAW_DECL_NL_LANGINFO _GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - " "use gnulib module nl_langinfo for portability"); diff --git a/gl/lc-charset-dispatch.c b/gl/lc-charset-dispatch.c index 91ab6d72..53a9b2cd 100644 --- a/gl/lc-charset-dispatch.c +++ b/gl/lc-charset-dispatch.c @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2025 Free Software Foundation, Inc. + Copyright (C) 2018-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/lc-charset-dispatch.h b/gl/lc-charset-dispatch.h index 554137b6..665da408 100644 --- a/gl/lc-charset-dispatch.h +++ b/gl/lc-charset-dispatch.h @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2025 Free Software Foundation, Inc. + Copyright (C) 2018-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/libc-config.h b/gl/libc-config.h index 33da9cf1..e5102aa9 100644 --- a/gl/libc-config.h +++ b/gl/libc-config.h @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2025 Free Software Foundation, Inc. + Copyright 2017-2026 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/gl/limits.in.h b/gl/limits.in.h index c33c59e1..66bd63ee 100644 --- a/gl/limits.in.h +++ b/gl/limits.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright 2016-2025 Free Software Foundation, Inc. + Copyright 2016-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -47,7 +47,7 @@ #ifndef LLONG_MIN # if defined LONG_LONG_MIN /* HP-UX 11.31 */ # define LLONG_MIN LONG_LONG_MIN -# elif defined LONGLONG_MIN /* IRIX 6.5 */ +# elif defined LONGLONG_MIN /* AIX, BeOS */ # define LLONG_MIN LONGLONG_MIN # elif defined __GNUC__ # define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL) @@ -56,7 +56,7 @@ #ifndef LLONG_MAX # if defined LONG_LONG_MAX /* HP-UX 11.31 */ # define LLONG_MAX LONG_LONG_MAX -# elif defined LONGLONG_MAX /* IRIX 6.5 */ +# elif defined LONGLONG_MAX /* AIX, BeOS */ # define LLONG_MAX LONGLONG_MAX # elif defined __GNUC__ # define LLONG_MAX __LONG_LONG_MAX__ @@ -65,7 +65,7 @@ #ifndef ULLONG_MAX # if defined ULONG_LONG_MAX /* HP-UX 11.31 */ # define ULLONG_MAX ULONG_LONG_MAX -# elif defined ULONGLONG_MAX /* IRIX 6.5 */ +# elif defined ULONGLONG_MAX /* AIX, BeOS */ # define ULLONG_MAX ULONGLONG_MAX # elif defined __GNUC__ # define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL) diff --git a/gl/localcharset.c b/gl/localcharset.c index 32f6f78e..22dc38d3 100644 --- a/gl/localcharset.c +++ b/gl/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -279,45 +279,6 @@ static const struct table_entry alias_table[] = { "utf8", "UTF-8" } # define alias_table_defined # endif -# if defined __sgi /* IRIX */ - { "ISO8859-1", "ISO-8859-1" }, - { "ISO8859-15", "ISO-8859-15" }, - { "ISO8859-2", "ISO-8859-2" }, - { "ISO8859-5", "ISO-8859-5" }, - { "ISO8859-7", "ISO-8859-7" }, - { "ISO8859-9", "ISO-8859-9" }, - { "eucCN", "GB2312" }, - { "eucJP", "EUC-JP" }, - { "eucKR", "EUC-KR" }, - { "eucTW", "EUC-TW" } -# define alias_table_defined -# endif -# if defined __osf__ /* OSF/1 */ - /*{ "GBK", "GBK" },*/ - { "ISO8859-1", "ISO-8859-1" }, - { "ISO8859-15", "ISO-8859-15" }, - { "ISO8859-2", "ISO-8859-2" }, - { "ISO8859-4", "ISO-8859-4" }, - { "ISO8859-5", "ISO-8859-5" }, - { "ISO8859-7", "ISO-8859-7" }, - { "ISO8859-8", "ISO-8859-8" }, - { "ISO8859-9", "ISO-8859-9" }, - { "KSC5601", "CP949" }, - { "SJIS", "SHIFT_JIS" }, - { "TACTIS", "TIS-620" }, - /*{ "UTF-8", "UTF-8" },*/ - { "big5", "BIG5" }, - { "cp850", "CP850" }, - { "dechanyu", "DEC-HANYU" }, - { "dechanzi", "GB2312" }, - { "deckanji", "DEC-KANJI" }, - { "deckorean", "EUC-KR" }, - { "eucJP", "EUC-JP" }, - { "eucKR", "EUC-KR" }, - { "eucTW", "EUC-TW" }, - { "sdeckanji", "EUC-JP" } -# define alias_table_defined -# endif # if defined __sun /* Solaris */ { "5601", "EUC-KR" }, { "646", "ASCII" }, @@ -850,12 +811,11 @@ locale_charset (void) /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always returns "US-ASCII". Return the suffix of the locale name from the environment variables (if present) or the codepage as a number. */ - if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) + if (codeset != NULL && streq (codeset, "US-ASCII")) { - const char *locale; static char resultbuf[2 + 10 + 1]; - locale = getenv ("LC_ALL"); + const char *locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); @@ -941,8 +901,7 @@ locale_charset (void) /* For a locale name such as "French_France.65001", in Windows 10, setlocale now returns "French_France.utf8" instead, or in the UTF-8 environment (with modern system settings) "fr_FR.UTF-8". */ - if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0 - || strcmp (buf + 2, "UTF-8") == 0) + if (streq (buf + 2, "65001") || streq (buf + 2, "utf8") || streq (buf + 2, "UTF-8")) codeset = "UTF-8"; else { @@ -952,16 +911,13 @@ locale_charset (void) # elif defined OS2 - const char *locale; static char resultbuf[2 + 10 + 1]; - ULONG cp[3]; - ULONG cplen; codeset = NULL; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ - locale = getenv ("LC_ALL"); + const char *locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); @@ -992,12 +948,15 @@ locale_charset (void) } /* For the POSIX locale, don't use the system's codepage. */ - if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0) + if (streq (locale, "C") || streq (locale, "POSIX")) codeset = ""; } if (codeset == NULL) { + ULONG cp[3]; + ULONG cplen; + /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) codeset = ""; @@ -1024,7 +983,7 @@ locale_charset (void) Speed up the common case and slow down the less common cases by testing for this case first. */ # if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__ - if (strcmp (codeset, "UTF-8") == 0) + if (streq (codeset, "UTF-8")) goto done_table_lookup; else # endif @@ -1153,7 +1112,7 @@ locale_charset (void) #ifdef DARWIN7 /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8" (the default codeset) does not work when MB_CUR_MAX is 1. */ - if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1) + if (streq (codeset, "UTF-8") && MB_CUR_MAX_L (uselocale (NULL)) <= 1) codeset = "ASCII"; #endif diff --git a/gl/localcharset.h b/gl/localcharset.h index 25e6d099..59f748d7 100644 --- a/gl/localcharset.h +++ b/gl/localcharset.h @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2026 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This file is free software: you can redistribute it and/or modify @@ -48,24 +48,24 @@ extern const char * locale_charset (void); (darwin = Mac OS X, windows = native Windows) ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin - ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos - ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-1 Y glibc aix hpux solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-2 Y glibc aix hpux solaris freebsd netbsd openbsd darwin cygwin zos ISO-8859-3 Y glibc solaris cygwin - ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin - ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-4 Y hpux solaris freebsd netbsd openbsd darwin + ISO-8859-5 Y glibc aix hpux solaris freebsd netbsd openbsd darwin cygwin zos ISO-8859-6 Y glibc aix hpux solaris cygwin - ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos - ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos - ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos + ISO-8859-7 Y glibc aix hpux solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-8 Y glibc aix hpux solaris cygwin zos + ISO-8859-9 Y glibc aix hpux solaris freebsd darwin cygwin zos ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin ISO-8859-14 glibc cygwin - ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-15 glibc aix solaris freebsd netbsd openbsd darwin cygwin KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin KOI8-T glibc CP437 dos CP775 dos - CP850 aix osf dos + CP850 aix dos CP852 dos CP855 dos CP856 aix @@ -80,7 +80,7 @@ extern const char * locale_charset (void); CP922 aix CP932 aix cygwin windows dos CP943 aix zos - CP949 osf darwin windows dos + CP949 darwin windows dos CP950 windows dos CP1046 aix CP1124 aix @@ -95,17 +95,17 @@ extern const char * locale_charset (void); CP1255 glibc windows CP1256 windows CP1257 windows - GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos - EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin - EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos - EUC-TW glibc aix hpux irix osf solaris netbsd - BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos + GB2312 Y glibc aix hpux solaris freebsd netbsd darwin cygwin zos + EUC-JP Y glibc aix hpux solaris freebsd netbsd darwin cygwin + EUC-KR Y glibc aix hpux solaris freebsd netbsd darwin cygwin zos + EUC-TW glibc aix hpux solaris netbsd + BIG5 Y glibc aix hpux solaris freebsd netbsd darwin cygwin zos BIG5-HKSCS glibc hpux solaris netbsd darwin - GBK glibc aix osf solaris freebsd darwin cygwin windows dos + GBK glibc aix solaris freebsd darwin cygwin windows dos GB18030 glibc hpux solaris freebsd netbsd darwin - SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin + SHIFT_JIS Y hpux solaris freebsd netbsd darwin JOHAB solaris windows - TIS-620 glibc aix hpux osf solaris cygwin zos + TIS-620 glibc aix hpux solaris cygwin zos ARMSCII-8 glibc freebsd netbsd darwin GEORGIAN-PS glibc cygwin PT154 glibc netbsd cygwin @@ -115,9 +115,9 @@ extern const char * locale_charset (void); HP-HEBREW8 hpux HP-TURKISH8 hpux HP-KANA8 hpux - DEC-KANJI osf - DEC-HANYU osf - UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos + DEC-KANJI vms + DEC-HANYU vms + UTF-8 Y glibc aix hpux solaris netbsd darwin cygwin zos Note: Names which are not marked as being a MIME name should not be used in Internet protocols for information interchange (mail, news, etc.). diff --git a/gl/locale.in.h b/gl/locale.in.h index 34f8c5b6..c264493e 100644 --- a/gl/locale.in.h +++ b/gl/locale.in.h @@ -1,5 +1,5 @@ /* A POSIX . - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -264,7 +264,6 @@ _GL_CXXALIASWARN (localeconv); # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv # endif #elif defined GNULIB_POSIXCHECK -# undef localeconv # if HAVE_RAW_DECL_LOCALECONV _GL_WARN_ON_USE (localeconv, "localeconv returns too few information on some platforms - " @@ -288,7 +287,6 @@ _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale)); _GL_CXXALIASWARN (setlocale); # endif #elif defined GNULIB_POSIXCHECK -# undef setlocale # if HAVE_RAW_DECL_SETLOCALE _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " "use gnulib module setlocale for portability"); @@ -325,7 +323,6 @@ _GL_CXXALIAS_SYS (newlocale, locale_t, _GL_CXXALIASWARN (newlocale); # endif #elif defined GNULIB_POSIXCHECK -# undef newlocale # if HAVE_RAW_DECL_NEWLOCALE _GL_WARN_ON_USE (newlocale, "newlocale is not portable"); # endif @@ -350,7 +347,6 @@ _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale)); _GL_CXXALIASWARN (duplocale); # endif #elif defined GNULIB_POSIXCHECK -# undef duplocale # if HAVE_RAW_DECL_DUPLOCALE _GL_WARN_ON_USE (duplocale, "duplocale is unportable and buggy on some glibc systems - " "use gnulib module duplocale for portability"); @@ -378,7 +374,6 @@ _GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale)); _GL_CXXALIASWARN (freelocale); # endif #elif defined GNULIB_POSIXCHECK -# undef freelocale # if HAVE_RAW_DECL_FREELOCALE _GL_WARN_ON_USE (freelocale, "freelocale is not portable"); # endif @@ -408,7 +403,6 @@ _GL_CXXALIAS_SYS (getlocalename_l, const char *, _GL_CXXALIASWARN (getlocalename_l); # endif #elif defined GNULIB_POSIXCHECK -# undef getlocalename_l # if HAVE_RAW_DECL_GETLOCALENAME_L _GL_WARN_ON_USE (getlocalename_l, "getlocalename_l is not portable"); # endif diff --git a/gl/localeconv.c b/gl/localeconv.c index a6bbdced..bf6271ee 100644 --- a/gl/localeconv.c +++ b/gl/localeconv.c @@ -1,5 +1,5 @@ /* Query locale dependent information for formatting numbers. - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/lseek.c b/gl/lseek.c index 41708787..7478ea13 100644 --- a/gl/lseek.c +++ b/gl/lseek.c @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/lstat.c b/gl/lstat.c index bb4a59f1..2495568f 100644 --- a/gl/lstat.c +++ b/gl/lstat.c @@ -1,6 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 1997-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -42,14 +42,7 @@ orig_lstat (const char *filename, struct stat *buf) } /* Specification. */ -# ifdef __osf__ -/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc - eliminates this include because of the preliminary #include - above. */ -# include "sys/stat.h" -# else -# include -# endif +# include # include "stat-time.h" diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4 index 2b205b35..a4b32403 100644 --- a/gl/m4/00gnulib.m4 +++ b/gl/m4/00gnulib.m4 @@ -1,6 +1,6 @@ # 00gnulib.m4 # serial 9 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4 index d1b8257b..4dedc0d4 100644 --- a/gl/m4/__inline.m4 +++ b/gl/m4/__inline.m4 @@ -1,6 +1,6 @@ # __inline.m4 # serial 1 -dnl Copyright 2017-2025 Free Software Foundation, Inc. +dnl Copyright 2017-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4 index 5501b07b..94ecc510 100644 --- a/gl/m4/absolute-header.m4 +++ b/gl/m4/absolute-header.m4 @@ -1,6 +1,6 @@ # absolute-header.m4 # serial 18 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/af_alg.m4 b/gl/m4/af_alg.m4 index 38575b6d..e4ff9a3d 100644 --- a/gl/m4/af_alg.m4 +++ b/gl/m4/af_alg.m4 @@ -1,6 +1,6 @@ # af_alg.m4 # serial 6 -dnl Copyright 2018-2025 Free Software Foundation, Inc. +dnl Copyright 2018-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4 index 68fc6211..ff0c59dd 100644 --- a/gl/m4/alloca.m4 +++ b/gl/m4/alloca.m4 @@ -1,6 +1,6 @@ # alloca.m4 # serial 21 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4 index 5dae6f72..63634c30 100644 --- a/gl/m4/arpa_inet_h.m4 +++ b/gl/m4/arpa_inet_h.m4 @@ -1,6 +1,6 @@ # arpa_inet_h.m4 # serial 18 -dnl Copyright (C) 2006, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/assert_h.m4 b/gl/m4/assert_h.m4 index e77524ca..d9433ef7 100644 --- a/gl/m4/assert_h.m4 +++ b/gl/m4/assert_h.m4 @@ -1,6 +1,6 @@ # assert_h.m4 -# serial 5 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +# serial 6 +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -56,8 +56,6 @@ AC_DEFUN([gl_ASSERT_H], dnl The seemingly redundant parentheses are necessary for MSVC 14. dnl #undef assert so that programs are not tempted to use it without dnl specifically including assert.h. - dnl #undef __ASSERT_H__ so that on IRIX, when programs later include - dnl , this include actually defines assert. dnl Break the #undef_s apart with a comment so that 'configure' does dnl not comment them out. AH_VERBATIM([zzstatic_assert], @@ -78,9 +76,6 @@ AC_DEFUN([gl_ASSERT_H], && __GNUG__ < 6 && __clang_major__ < 6))) #include #undef/**/assert - #ifdef __sgi - #undef/**/__ASSERT_H__ - #endif /* Solaris 11.4 defines static_assert as a macro with 2 arguments. We need it also to be invocable with a single argument. Haiku 2022 does not define static_assert at all. */ diff --git a/gl/m4/base64.m4 b/gl/m4/base64.m4 index 785d31c0..40beb50b 100644 --- a/gl/m4/base64.m4 +++ b/gl/m4/base64.m4 @@ -1,6 +1,6 @@ # base64.m4 # serial 4 -dnl Copyright (C) 2004, 2006, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4 index 59d52be6..93c9d769 100644 --- a/gl/m4/btowc.m4 +++ b/gl/m4/btowc.m4 @@ -1,6 +1,6 @@ # btowc.m4 -# serial 15 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +# serial 16 +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_BTOWC], dnl Check whether is usable at all, first. Otherwise the test dnl program below may lead to an endless loop. See - dnl . + dnl . AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) AC_CHECK_FUNCS_ONCE([btowc]) @@ -54,43 +54,6 @@ changequote([,])dnl ]) ]) - dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. - AC_CACHE_CHECK([whether btowc(EOF) is correct], - [gl_cv_func_btowc_eof], - [ - dnl Initial guess, used when cross-compiling or when no suitable locale - dnl is present. -changequote(,)dnl - case "$host_os" in - # Guess no on IRIX. - irix*) gl_cv_func_btowc_eof="guessing no" ;; - # Guess yes on native Windows. - mingw* | windows*) gl_cv_func_btowc_eof="guessing yes" ;; - # Guess yes otherwise. - *) gl_cv_func_btowc_eof="guessing yes" ;; - esac -changequote([,])dnl - if test $LOCALE_FR != none; then - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include -#include -#include -int main () -{ - if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) - { - if (btowc (EOF) != WEOF) - return 1; - } - return 0; -}]])], - [gl_cv_func_btowc_eof=yes], - [gl_cv_func_btowc_eof=no], - [:]) - fi - ]) - dnl On mingw, in the C locale, btowc is inconsistent with mbrtowc: dnl mbrtowc avoids calling MultiByteToWideChar when MB_CUR_MAX is 1 and dnl ___lc_codepage_func() is 0, but btowc is lacking this special case. @@ -146,10 +109,6 @@ int main () *yes) ;; *) REPLACE_BTOWC=1 ;; esac - case "$gl_cv_func_btowc_eof" in - *yes) ;; - *) REPLACE_BTOWC=1 ;; - esac case "$gl_cv_func_btowc_consistent" in *yes) ;; *) REPLACE_BTOWC=1 ;; diff --git a/gl/m4/build-to-host.m4 b/gl/m4/build-to-host.m4 index 01bff8f3..d3b93ce1 100644 --- a/gl/m4/build-to-host.m4 +++ b/gl/m4/build-to-host.m4 @@ -1,6 +1,6 @@ # build-to-host.m4 # serial 5 -dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4 index 76d32867..cf96977e 100644 --- a/gl/m4/builtin-expect.m4 +++ b/gl/m4/builtin-expect.m4 @@ -1,6 +1,6 @@ # builtin-expect.m4 # serial 3 -dnl Copyright 2016-2025 Free Software Foundation, Inc. +dnl Copyright 2016-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/byteswap.m4 b/gl/m4/byteswap.m4 index b53cb4d0..a0287062 100644 --- a/gl/m4/byteswap.m4 +++ b/gl/m4/byteswap.m4 @@ -1,6 +1,6 @@ # byteswap.m4 # serial 7 -dnl Copyright (C) 2005, 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/c-bool.m4 b/gl/m4/c-bool.m4 index 8fa8bfc8..f04041a4 100644 --- a/gl/m4/c-bool.m4 +++ b/gl/m4/c-bool.m4 @@ -1,6 +1,6 @@ # c-bool.m4 # serial 3 -dnl Copyright 2022-2025 Free Software Foundation, Inc. +dnl Copyright 2022-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/c32rtomb.m4 b/gl/m4/c32rtomb.m4 index ce26a31e..b7a0d44c 100644 --- a/gl/m4/c32rtomb.m4 +++ b/gl/m4/c32rtomb.m4 @@ -1,6 +1,6 @@ # c32rtomb.m4 # serial 8 -dnl Copyright (C) 2020-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/calloc.m4 b/gl/m4/calloc.m4 index ac7d08d4..2ed64332 100644 --- a/gl/m4/calloc.m4 +++ b/gl/m4/calloc.m4 @@ -1,6 +1,6 @@ # calloc.m4 # serial 36 -dnl Copyright (C) 2004-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/close.m4 b/gl/m4/close.m4 index 314e321e..9b498643 100644 --- a/gl/m4/close.m4 +++ b/gl/m4/close.m4 @@ -1,6 +1,6 @@ # close.m4 # serial 10 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4 index 6bed9dee..4ab542f4 100644 --- a/gl/m4/codeset.m4 +++ b/gl/m4/codeset.m4 @@ -1,6 +1,6 @@ # codeset.m4 # serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2025 Free Software +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2026 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4 index 5c40b73c..957adca6 100644 --- a/gl/m4/double-slash-root.m4 +++ b/gl/m4/double-slash-root.m4 @@ -1,6 +1,6 @@ # double-slash-root.m4 # serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4 index 5da3a0b9..e1d51898 100644 --- a/gl/m4/dup2.m4 +++ b/gl/m4/dup2.m4 @@ -1,6 +1,6 @@ # dup2.m4 # serial 28 -dnl Copyright (C) 2002, 2005, 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4 index e0690e54..5c0644ab 100644 --- a/gl/m4/environ.m4 +++ b/gl/m4/environ.m4 @@ -1,6 +1,6 @@ # environ.m4 # serial 8 -dnl Copyright (C) 2001-2004, 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4 index 420d5bb3..ade19b6f 100644 --- a/gl/m4/errno_h.m4 +++ b/gl/m4/errno_h.m4 @@ -1,6 +1,6 @@ # errno_h.m4 -# serial 18 -dnl Copyright (C) 2004, 2006, 2008-2025 Free Software Foundation, Inc. +# serial 19 +dnl Copyright (C) 2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -83,59 +83,4 @@ booboo gl_NEXT_HEADERS([errno.h]) GL_GENERATE_ERRNO_H=true fi - gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) - gl_REPLACE_ERRNO_VALUE([ENOLINK]) - gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) -]) - -# Assuming $1 = EOVERFLOW. -# The EOVERFLOW errno value ought to be defined in , according to -# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and -# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. -# Check for the value of EOVERFLOW. -# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE. -AC_DEFUN([gl_REPLACE_ERRNO_VALUE], -[ - if $GL_GENERATE_ERRNO_H; then - AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ - AC_EGREP_CPP([yes],[ -#include -#ifdef ]$1[ -yes -#endif - ], - [gl_cv_header_errno_h_]$1[=yes], - [gl_cv_header_errno_h_]$1[=no]) - if test $gl_cv_header_errno_h_]$1[ = no; then - AC_EGREP_CPP([yes],[ -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef ]$1[ -yes -#endif - ], [gl_cv_header_errno_h_]$1[=hidden]) - if test $gl_cv_header_errno_h_]$1[ = hidden; then - dnl The macro exists but is hidden. - dnl Define it to the same value. - AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [ -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include -]) - fi - fi - ]) - case $gl_cv_header_errno_h_]$1[ in - yes | no) - ]$1[_HIDDEN=0; ]$1[_VALUE= - ;; - *) - ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1[" - ;; - esac - AC_SUBST($1[_HIDDEN]) - AC_SUBST($1[_VALUE]) - fi ]) diff --git a/gl/m4/error.m4 b/gl/m4/error.m4 index 1572250a..f14b9ceb 100644 --- a/gl/m4/error.m4 +++ b/gl/m4/error.m4 @@ -1,6 +1,6 @@ # error.m4 # serial 16 -dnl Copyright (C) 1996-1998, 2001-2004, 2009-2025 Free Software Foundation, +dnl Copyright (C) 1996-1998, 2001-2004, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/error_h.m4 b/gl/m4/error_h.m4 index 4ef5cbff..73e96943 100644 --- a/gl/m4/error_h.m4 +++ b/gl/m4/error_h.m4 @@ -1,6 +1,6 @@ # error_h.m4 # serial 5 -dnl Copyright (C) 1996-2025 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4 index 08e93397..bff98570 100644 --- a/gl/m4/exponentd.m4 +++ b/gl/m4/exponentd.m4 @@ -1,6 +1,6 @@ # exponentd.m4 # serial 5 -dnl Copyright (C) 2007-2008, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/extensions-aix.m4 b/gl/m4/extensions-aix.m4 index 08b703b4..9036d7bb 100644 --- a/gl/m4/extensions-aix.m4 +++ b/gl/m4/extensions-aix.m4 @@ -1,6 +1,6 @@ # extensions-aix.m4 # serial 1 -dnl Copyright (C) 2024-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4 index 76516bce..01a8e5f9 100644 --- a/gl/m4/extensions.m4 +++ b/gl/m4/extensions.m4 @@ -1,6 +1,6 @@ # extensions.m4 # serial 25 -*- Autoconf -*- -dnl Copyright (C) 2003, 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4 index d4fe6d82..4ccc4a95 100644 --- a/gl/m4/extern-inline.m4 +++ b/gl/m4/extern-inline.m4 @@ -1,6 +1,6 @@ # extern-inline.m4 -# serial 1 -dnl Copyright 2012-2025 Free Software Foundation, Inc. +# serial 2 +dnl Copyright 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -43,9 +43,11 @@ AC_DEFUN([gl_EXTERN_INLINE], functions or macros in standard C headers like . For example, if isdigit is mistakenly implemented via a static inline function, a program containing an extern inline function that calls isdigit - may not work since the C standard prohibits extern inline functions - from calling static functions (ISO C 99 section 6.7.4.(3). - This bug is known to occur on: + may not work since C99 through C23 prohibit extern inline functions + from calling static functions (ISO C 23 § 6.7.5 ¶ 3)). + Although a future C standard will likely relax this restriction + , + respect it for now. This bug is known to occur on: OS X 10.8 and earlier; see: https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html @@ -112,8 +114,8 @@ AC_DEFUN([gl_EXTERN_INLINE], suppress bogus "no previous prototype for 'FOO'" and "no previous declaration for 'FOO'" diagnostics, when FOO is an inline function in the header; see - and - . */ + and + . */ #if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA diff --git a/gl/m4/fclose.m4 b/gl/m4/fclose.m4 index cfb92e28..65eb7705 100644 --- a/gl/m4/fclose.m4 +++ b/gl/m4/fclose.m4 @@ -1,6 +1,6 @@ # fclose.m4 # serial 12 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4 index 8020c481..a94fc557 100644 --- a/gl/m4/fcntl-o.m4 +++ b/gl/m4/fcntl-o.m4 @@ -1,6 +1,6 @@ # fcntl-o.m4 # serial 12 -dnl Copyright (C) 2006, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4 index 08ab936f..69ac76f9 100644 --- a/gl/m4/fcntl.m4 +++ b/gl/m4/fcntl.m4 @@ -1,6 +1,6 @@ # fcntl.m4 # serial 12 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4 index 1c9f9cce..946a0bd6 100644 --- a/gl/m4/fcntl_h.m4 +++ b/gl/m4/fcntl_h.m4 @@ -1,6 +1,6 @@ # fcntl_h.m4 -# serial 20 -dnl Copyright (C) 2006-2007, 2009-2025 Free Software Foundation, Inc. +# serial 21 +dnl Copyright (C) 2006-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,7 +26,7 @@ AC_DEFUN_ONCE([gl_FCNTL_H], dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include - ]], [fcntl openat]) + ]], [fcntl openat openat2]) ]) # gl_FCNTL_MODULE_INDICATOR([modulename]) @@ -53,6 +53,7 @@ AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT2]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1]) @@ -66,6 +67,7 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS], dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + HAVE_OPENAT2=0; AC_SUBST([HAVE_OPENAT2]) REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT]) REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) diff --git a/gl/m4/fflush.m4 b/gl/m4/fflush.m4 index 399065b6..c5913b23 100644 --- a/gl/m4/fflush.m4 +++ b/gl/m4/fflush.m4 @@ -1,6 +1,6 @@ # fflush.m4 # serial 20 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4 index 8580c9c9..c0ee7f8f 100644 --- a/gl/m4/float_h.m4 +++ b/gl/m4/float_h.m4 @@ -1,6 +1,6 @@ # float_h.m4 -# serial 15 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +# serial 17 +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FLOAT_H], GL_GENERATE_FLOAT_H=false REPLACE_FLOAT_LDBL=0 case "$host_os" in - aix* | beos* | openbsd* | mirbsd* | irix*) + aix* | beos* | openbsd* | mirbsd*) GL_GENERATE_FLOAT_H=true ;; freebsd* | dragonfly*) @@ -63,6 +63,7 @@ changequote([,])dnl [AC_LANG_PROGRAM( [[#include int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG }; + int y[] = { FLT_IS_IEC_60559, DBL_IS_IEC_60559, LDBL_IS_IEC_60559 }; float maxf = FLT_NORM_MAX; double maxd = DBL_NORM_MAX; long double maxl = LDBL_NORM_MAX; diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4 index cb75fce9..731f0b0a 100644 --- a/gl/m4/floorf.m4 +++ b/gl/m4/floorf.m4 @@ -1,6 +1,6 @@ # floorf.m4 # serial 21 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fopen.m4 b/gl/m4/fopen.m4 index e27b3270..07779a16 100644 --- a/gl/m4/fopen.m4 +++ b/gl/m4/fopen.m4 @@ -1,6 +1,6 @@ # fopen.m4 # serial 16 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fpurge.m4 b/gl/m4/fpurge.m4 index 408a2579..a7cf67dc 100644 --- a/gl/m4/fpurge.m4 +++ b/gl/m4/fpurge.m4 @@ -1,6 +1,6 @@ # fpurge.m4 # serial 16 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/freading.m4 b/gl/m4/freading.m4 index 373d2bff..b5b54f40 100644 --- a/gl/m4/freading.m4 +++ b/gl/m4/freading.m4 @@ -1,6 +1,6 @@ # freading.m4 # serial 3 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/free.m4 b/gl/m4/free.m4 index 485d8243..c7a134ba 100644 --- a/gl/m4/free.m4 +++ b/gl/m4/free.m4 @@ -1,6 +1,6 @@ # free.m4 # serial 6 -dnl Copyright (C) 2003-2005, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,10 +14,10 @@ AC_DEFUN([gl_FUNC_FREE], dnl In the next release of POSIX, free must preserve errno. dnl https://www.austingroupbugs.net/view.php?id=385 - dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924 + dnl https://sourceware.org/PR17924 dnl So far, we know of three platforms that do this: dnl * glibc >= 2.33, thanks to the fix for this bug: - dnl + dnl dnl * OpenBSD >= 4.5, thanks to this commit: dnl dnl * Solaris, because its malloc() implementation is based on brk(), diff --git a/gl/m4/fseek.m4 b/gl/m4/fseek.m4 index ce728f60..398fd5f8 100644 --- a/gl/m4/fseek.m4 +++ b/gl/m4/fseek.m4 @@ -1,6 +1,6 @@ # fseek.m4 # serial 4 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4 index c093d399..cd81961a 100644 --- a/gl/m4/fseeko.m4 +++ b/gl/m4/fseeko.m4 @@ -1,6 +1,6 @@ # fseeko.m4 # serial 21 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fseterr.m4 b/gl/m4/fseterr.m4 index 3a94c288..e5ad635b 100644 --- a/gl/m4/fseterr.m4 +++ b/gl/m4/fseterr.m4 @@ -1,6 +1,6 @@ # fseterr.m4 # serial 2 -dnl Copyright (C) 2012-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4 index e89bbc32..7db4e346 100644 --- a/gl/m4/fstat.m4 +++ b/gl/m4/fstat.m4 @@ -1,6 +1,6 @@ # fstat.m4 # serial 10 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fstypename.m4 b/gl/m4/fstypename.m4 index 4407b765..64122a73 100644 --- a/gl/m4/fstypename.m4 +++ b/gl/m4/fstypename.m4 @@ -1,6 +1,6 @@ # fstypename.m4 # serial 6 -dnl Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2025 Free Software +dnl Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2026 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4 index bb7b6e43..db6e0e3b 100644 --- a/gl/m4/fsusage.m4 +++ b/gl/m4/fsusage.m4 @@ -1,6 +1,6 @@ # fsusage.m4 -# serial 35 -dnl Copyright (C) 1997-1998, 2000-2001, 2003-2025 Free Software Foundation, +# serial 37 +dnl Copyright (C) 1997-1998, 2000-2001, 2003-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -48,16 +48,12 @@ AC_DEFUN([gl_FILE_SYSTEM_USAGE], # is what it gets when this test fails. if test $ac_fsusage_space = no; then # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, - # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS. + # OpenBSD >= 4.4, AIX, HP-UX, Solaris, Cygwin, Interix, BeOS. AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], [AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ #include -#ifdef __osf__ -"Do not use Tru64's statvfs implementation" -#endif - #include struct statvfs fsd; @@ -79,7 +75,7 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; if test $fu_cv_sys_stat_statvfs = yes; then ac_fsusage_space=yes # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs. - # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems + # glibc, HP-UX, Solaris have statvfs64 as well, but on these systems # statvfs with large-file support is already equivalent to statvfs64. AC_CACHE_CHECK([whether to use statvfs64], [fu_cv_sys_stat_statvfs64], @@ -140,38 +136,10 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; (glibc/Linux > 2.6)]) fi - if test $ac_fsusage_space = no; then - # DEC Alpha running OSF/1 - AC_CACHE_CHECK([for 3-argument statfs function (DEC OSF/1)], - [fu_cv_sys_stat_statfs3_osf1], - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include - int - main () - { - struct statfs fsd; - fsd.f_fsize = 0; - return statfs (".", &fsd, sizeof (struct statfs)) != 0; - }]])], - [fu_cv_sys_stat_statfs3_osf1=yes], - [fu_cv_sys_stat_statfs3_osf1=no], - [fu_cv_sys_stat_statfs3_osf1=no]) - ]) - if test $fu_cv_sys_stat_statfs3_osf1 = yes; then - ac_fsusage_space=yes - AC_DEFINE([STAT_STATFS3_OSF1], [1], - [Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) - fi - fi - if test $ac_fsusage_space = no; then # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, - # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.) - # (On IRIX you need to include , not only and - # .) + # OpenBSD >= 4.4, AIX, HP-UX, Cygwin already handled above.) # (On Solaris, statfs has 4 arguments.) AC_CACHE_CHECK([for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)], [fu_cv_sys_stat_statfs2_bsize], @@ -225,13 +193,12 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; if test $fu_cv_sys_stat_statfs4 = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS4], [1], - [Define if statfs takes 4 args. (SVR3, old Irix)]) + [Define if statfs takes 4 args. (SVR3)]) fi fi if test $ac_fsusage_space = no; then # 4.4BSD and older NetBSD - # (OSF/1 already handled above.) # (On AIX, you need to include , not only .) # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in # .) diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4 index d5610b70..0b389f86 100644 --- a/gl/m4/ftell.m4 +++ b/gl/m4/ftell.m4 @@ -1,6 +1,6 @@ # ftell.m4 # serial 3 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4 index 35d30f98..ae0e884f 100644 --- a/gl/m4/ftello.m4 +++ b/gl/m4/ftello.m4 @@ -1,6 +1,6 @@ # ftello.m4 # serial 17 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4 index 2931d526..8a63600b 100644 --- a/gl/m4/getaddrinfo.m4 +++ b/gl/m4/getaddrinfo.m4 @@ -1,6 +1,6 @@ # getaddrinfo.m4 -# serial 38 -dnl Copyright (C) 2004-2025 Free Software Foundation, Inc. +# serial 39 +dnl Copyright (C) 2004-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -90,7 +90,7 @@ int getaddrinfo (const char *, const char *, const struct addrinfo *, struct add fi fi if test $HAVE_GETADDRINFO != 0; then - AC_CACHE_CHECK([whether getaddrinfo supports AI_NUMERICSERV], + AC_CACHE_CHECK([whether getaddrinfo supports AI_NUMERICHOST and AI_NUMERICSERV], [gl_cv_func_getaddrinfo_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ @@ -107,16 +107,30 @@ int getaddrinfo (const char *, const char *, const struct addrinfo *, struct add #include #include ]], [[ - struct addrinfo hints; + int result = 0; struct addrinfo *ai; - memset (&hints, 0, sizeof (hints)); - hints.ai_flags = AI_NUMERICSERV; - return getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME; + { + struct addrinfo hints; + memset (&hints, 0, sizeof (hints)); + hints.ai_flags = AI_NUMERICHOST; + if (getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME) + result |= 1; + } + { + struct addrinfo hints; + memset (&hints, 0, sizeof (hints)); + hints.ai_flags = AI_NUMERICSERV; + if (getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME) + result |= 2; + } + return result; ]]) ], [gl_cv_func_getaddrinfo_works=yes], [gl_cv_func_getaddrinfo_works=no], [case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_getaddrinfo_works="guessing no" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_getaddrinfo_works="guessing no" ;; # Guess yes otherwise. diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4 index 63d88306..8b6eff47 100644 --- a/gl/m4/getdelim.m4 +++ b/gl/m4/getdelim.m4 @@ -1,7 +1,7 @@ # getdelim.m4 -# serial 19 +# serial 21 -dnl Copyright (C) 2005-2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -37,6 +37,7 @@ AC_DEFUN([gl_FUNC_GETDELIM], gl_cv_func_working_getdelim=no ;; *) echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data + touch conftest.empty AC_RUN_IFELSE([AC_LANG_SOURCE([[ # include # include @@ -44,6 +45,7 @@ AC_DEFUN([gl_FUNC_GETDELIM], int main () { FILE *in = fopen ("./conftest.data", "r"); + int result = 0; if (!in) return 1; { @@ -53,7 +55,7 @@ AC_DEFUN([gl_FUNC_GETDELIM], size_t siz = 0; int len = getdelim (&line, &siz, '\n', in); if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) - { free (line); fclose (in); return 2; } + result |= 2; free (line); } { @@ -62,35 +64,40 @@ AC_DEFUN([gl_FUNC_GETDELIM], char *line = NULL; size_t siz = (size_t)(~0) / 4; if (getdelim (&line, &siz, '\n', in) == -1) - { fclose (in); return 3; } + result |= 4; free (line); } fclose (in); - return 0; + { + /* Test that reading EOF as the first character sets the first byte + in the buffer to NUL. This fails on glibc 2.42 and earlier. */ + in = fopen ("./conftest.empty", "r"); + if (!in) + return 1; + char *line = malloc (1); + line[0] = 'A'; + size_t siz = 1; + if (getdelim (&line, &siz, '\n', in) != -1 || line[0] != '\0') + result |= 8; + free (line); + } + fclose (in); + return result; } ]])], [gl_cv_func_working_getdelim=yes], [gl_cv_func_working_getdelim=no], - [dnl We're cross compiling. - dnl Guess it works on glibc2 systems and musl systems. - AC_EGREP_CPP([Lucky GNU user], - [ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) && !defined __UCLIBC__ - Lucky GNU user - #endif -#endif - ], - [gl_cv_func_working_getdelim="guessing yes"], - [case "$host_os" in - *-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;; - *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;; - esac - ]) + [case "$host_os" in + # Guess yes on musl. + *-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;; + # Guess no on glibc. + *-gnu* | gnu*) gl_cv_func_working_getdelim="guessing no" ;; + *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;; + esac ]) ;; esac + rm -f conftest.data conftest.empty ]) case "$gl_cv_func_working_getdelim" in *yes) ;; diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4 index 112c1c4d..0b780110 100644 --- a/gl/m4/getdtablesize.m4 +++ b/gl/m4/getdtablesize.m4 @@ -1,6 +1,6 @@ # getdtablesize.m4 # serial 8 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/gethostname.m4 b/gl/m4/gethostname.m4 index be71ff78..33293521 100644 --- a/gl/m4/gethostname.m4 +++ b/gl/m4/gethostname.m4 @@ -1,6 +1,6 @@ # gethostname.m4 # serial 16 -dnl Copyright (C) 2002, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4 index b97b8011..ed32fa10 100644 --- a/gl/m4/getline.m4 +++ b/gl/m4/getline.m4 @@ -1,7 +1,7 @@ # getline.m4 -# serial 33 +# serial 35 -dnl Copyright (C) 1998-2003, 2005-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 1998-2003, 2005-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl dnl This file is free software; the Free Software Foundation @@ -31,6 +31,7 @@ AC_DEFUN([gl_FUNC_GETLINE], AC_CACHE_CHECK([for working getline function], [am_cv_func_working_getline], [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data + touch conftest.empty AC_RUN_IFELSE([AC_LANG_SOURCE([[ # include # include @@ -38,6 +39,7 @@ AC_DEFUN([gl_FUNC_GETLINE], int main () { FILE *in = fopen ("./conftest.data", "r"); + int result = 0; if (!in) return 1; { @@ -47,7 +49,7 @@ AC_DEFUN([gl_FUNC_GETLINE], size_t siz = 0; int len = getline (&line, &siz, in); if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) - { free (line); fclose (in); return 2; } + result |= 2; free (line); } { @@ -56,33 +58,38 @@ AC_DEFUN([gl_FUNC_GETLINE], char *line = NULL; size_t siz = (size_t)(~0) / 4; if (getline (&line, &siz, in) == -1) - { fclose (in); return 3; } + result |= 4; free (line); } fclose (in); - return 0; + { + /* Test that reading EOF as the first character sets the first byte + in the buffer to NUL. This fails on glibc 2.42 and earlier. */ + in = fopen ("./conftest.empty", "r"); + if (!in) + return 1; + char *line = malloc (1); + line[0] = 'A'; + size_t siz = 1; + if (getline (&line, &siz, in) != -1 || line[0] != '\0') + result |= 8; + free (line); + } + fclose (in); + return result; } ]])], [am_cv_func_working_getline=yes], [am_cv_func_working_getline=no], - [dnl We're cross compiling. - dnl Guess it works on glibc2 systems and musl systems. - AC_EGREP_CPP([Lucky GNU user], - [ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) && !defined __UCLIBC__ - Lucky GNU user - #endif -#endif - ], - [am_cv_func_working_getline="guessing yes"], - [case "$host_os" in - *-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;; - *) am_cv_func_working_getline="$gl_cross_guess_normal" ;; - esac - ]) + [case "$host_os" in + # Guess yes on musl. + *-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;; + # Guess no on glibc. + *-gnu* | gnu*) am_cv_func_working_getline="guessing no" ;; + *) am_cv_func_working_getline="$gl_cross_guess_normal" ;; + esac ]) + rm -f conftest.data conftest.empty ]) else am_cv_func_working_getline=no diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4 index 8ab613db..dc226168 100644 --- a/gl/m4/getloadavg.m4 +++ b/gl/m4/getloadavg.m4 @@ -1,6 +1,6 @@ # getloadavg.m4 -# serial 13 -dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2025 Free +# serial 14 +dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2026 Free dnl Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -124,8 +124,7 @@ if test $gl_func_getloadavg_done = no; then fi # We cannot check for , because Solaris 2 does not use dwarf (it -# uses stabs), but it is still SVR4. We cannot check for because -# Irix 4.0.5F has the header but not the library. +# uses stabs), but it is still SVR4. if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \ && test "$ac_cv_lib_kvm_kvm_open" = yes; then gl_func_getloadavg_done=yes diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4 index cb344c15..c620b2b7 100644 --- a/gl/m4/getopt.m4 +++ b/gl/m4/getopt.m4 @@ -1,6 +1,6 @@ # getopt.m4 -# serial 50 -dnl Copyright (C) 2002-2006, 2008-2025 Free Software Foundation, Inc. +# serial 52 +dnl Copyright (C) 2002-2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -88,8 +88,8 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS], dnl Merging these three different test programs into a single one dnl would require a reset mechanism. On BSD systems, it can be done dnl through 'optreset'; on some others (glibc), it can be done by - dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, - dnl Solaris 9, musl libc), there is no such mechanism. + dnl setting 'optind' to 0; on others again (HP-UX, Solaris 9, + dnl musl libc), there is no such mechanism. if test $cross_compiling = no; then dnl Sanity check. Succeeds everywhere (except on MSVC, dnl which lacks and getopt() entirely). @@ -238,8 +238,7 @@ dnl is ambiguous with environment values that contain newlines. nocrash_init(); /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, - and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, - OSF/1 5.1, Solaris 10. */ + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, Solaris 10. */ { static char conftest[] = "conftest"; static char plus[] = "-+"; @@ -250,7 +249,7 @@ dnl is ambiguous with environment values that contain newlines. } /* This code succeeds on glibc 2.8, mingw, and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, - IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + Solaris 10, Cygwin 1.5.x. */ { static char program[] = "program"; static char p[] = "-p"; diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4 index 90f34c74..d60f3efb 100644 --- a/gl/m4/getprogname.m4 +++ b/gl/m4/getprogname.m4 @@ -1,6 +1,6 @@ # getprogname.m4 -# serial 8 -dnl Copyright (C) 2016-2025 Free Software Foundation, Inc. +# serial 9 +dnl Copyright (C) 2016-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,6 +12,12 @@ AC_DEFUN([gl_FUNC_GETPROGNAME], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/process.h]) + if test $ac_cv_header_sys_process_h = yes; then + HAVE_SYS_PROCESS_H=1 + else + HAVE_SYS_PROCESS_H=0 + fi gl_CHECK_FUNCS_ANDROID([getprogname], [[#include ]]) if test $ac_cv_func_getprogname = no; then HAVE_GETPROGNAME=0 diff --git a/gl/m4/gettext_h.m4 b/gl/m4/gettext_h.m4 new file mode 100644 index 00000000..7ef89541 --- /dev/null +++ b/gl/m4/gettext_h.m4 @@ -0,0 +1,21 @@ +# gettext_h.m4 +# serial 1 +dnl Copyright (C) 2025-2026 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +AC_DEFUN_ONCE([gl_GETTEXT_H], +[ + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AH_BOTTOM([ +/* The text domainname for Gnulib messages. Ordinarily this is "gnulib", + but packages that do their own translations of Gnulib can use something + different by defining GNULIB_TEXT_DOMAIN in their config.h file. */ +#ifndef GNULIB_TEXT_DOMAIN +# define GNULIB_TEXT_DOMAIN/**/"gnulib" +#endif +]) +]) diff --git a/gl/m4/gl-openssl.m4 b/gl/m4/gl-openssl.m4 index 3cfea50f..70f43a55 100644 --- a/gl/m4/gl-openssl.m4 +++ b/gl/m4/gl-openssl.m4 @@ -1,6 +1,6 @@ # gl-openssl.m4 -# serial 7 -dnl Copyright (C) 2013-2025 Free Software Foundation, Inc. +# serial 8 +dnl Copyright (C) 2013-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -58,12 +58,17 @@ AC_DEFUN([gl_CRYPTO_CHECK], fi if test "x$with_openssl" != xauto-gpl-compat || test "x$gl_cv_openssl_gpl_compat" = xyes; then - AC_CHECK_LIB([crypto], [$1], - [AC_CHECK_HEADERS( - m4_if([$1], [MD5], [openssl/md5.h], [openssl/sha.h]), + m4_if([$1], [SHA3], + [AC_CHECK_LIB([crypto], [EVP_sha3_224], [LIB_CRYPTO=-lcrypto AC_DEFINE([HAVE_OPENSSL_$1], [1], - [Define to 1 if libcrypto is used for $1.])])]) + [Define to 1 if libcrypto is used for $1.])])], + [AC_CHECK_LIB([crypto], [$1], + [AC_CHECK_HEADERS( + m4_if([$1], [MD5], [openssl/md5.h], [openssl/sha.h]), + [LIB_CRYPTO=-lcrypto + AC_DEFINE([HAVE_OPENSSL_$1], [1], + [Define to 1 if libcrypto is used for $1.])])])]) fi if test "x$LIB_CRYPTO" = x; then message='openssl development library not found for $1. diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 6a6e8593..1b964b34 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2025 Free Software Foundation, Inc. +# Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4 index 034dae69..26eef771 100644 --- a/gl/m4/gnulib-common.m4 +++ b/gl/m4/gnulib-common.m4 @@ -1,6 +1,6 @@ # gnulib-common.m4 -# serial 113 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +# serial 115 +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -168,7 +168,7 @@ AC_DEFUN([gl_COMMON_BODY], [ ====================================================================== This gives a syntax error - in C mode with gcc - , and + , and - in C++ mode with clang++ version < 16, and - in C++ mode, inside extern "C" {}, still in newer clang++ versions . @@ -414,22 +414,25 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif /* _GL_ATTRIBUTE_CONST declares: - It is OK for a compiler to move calls to the function and to omit - calls to the function if another call has the same arguments or the - result is not used. - This attribute is safe for a function that neither depends on - nor affects state, and always returns exactly once - + It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached return value, even if the state changes between calls. + It is also OK to omit a call if the result is not used. + This attribute is safe if the function does not change observable state, + returns a value determined solely by its arguments' values + without examining state, and always returns exactly once - e.g., does not raise an exception, call longjmp, or loop forever. (This attribute is stricter than _GL_ATTRIBUTE_PURE because the - function cannot observe state. It is stricter than - _GL_ATTRIBUTE_UNSEQUENCED because the function must return exactly - once and cannot depend on state addressed by its arguments.) */ + function cannot observe state. Unlike _GL_ATTRIBUTE_UNSEQUENCED + the function must return exactly once and cannot access state + addressed by its pointer arguments or that happens to have the same + value for all calls to the function, but the function is allowed to + return a pointer to storage that can be modified later. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_CONST # if _GL_HAS_ATTRIBUTE (const) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) # else -# define _GL_ATTRIBUTE_CONST _GL_ATTRIBUTE_UNSEQUENCED +# define _GL_ATTRIBUTE_CONST # endif #endif @@ -451,7 +454,7 @@ AC_DEFUN([gl_COMMON_BODY], [ yet. */ #ifndef _GL_ATTRIBUTE_DEALLOC_FREE # if defined __cplusplus && defined __GNUC__ && !defined __clang__ -/* Work around GCC bug */ +/* Work around GCC bug */ # define _GL_ATTRIBUTE_DEALLOC_FREE \ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1) # else @@ -590,7 +593,9 @@ AC_DEFUN([gl_COMMON_BODY], [ /* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if the entity is not used. The compiler should not warn if the entity is not - used. */ + used. However, 'int _GL_UNNAMED (i)' is preferable to + '_GL_ATTRIBUTE_MAYBE_UNUSED int i' when parameter I is unused + regardless of preprocessor macro settings. */ /* Applies to: - function, variable, - struct, union, struct/union member, @@ -744,39 +749,40 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif /* _GL_ATTRIBUTE_PURE declares: - It is OK for a compiler to move calls to the function and to omit - calls to the function if another call has the same arguments or the - result is not used, and if observable state is the same. - This attribute is safe for a function that does not affect observable state - and always returns exactly once. + It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached return value, if observable state is the same. + It is also OK to omit a call if the return value is not used. + This attribute is safe if the function does not change observable state, + returns a value determined solely by its arguments's values + together with observable state, and always returns exactly once. (This attribute is looser than _GL_ATTRIBUTE_CONST because the function - can depend on observable state. It is stricter than - _GL_ATTRIBUTE_REPRODUCIBLE because the function must return exactly - once and cannot affect state addressed by its arguments.) */ + can depend on observable state. + Unlike _GL_ATTRIBUTE_REPRODUCIBLE the function must return exactly + once and cannot change state addressed by its arguments, but the + function can return a pointer to storage whose contents change later.) */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_PURE # if _GL_HAS_ATTRIBUTE (pure) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else -# define _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_REPRODUCIBLE +# define _GL_ATTRIBUTE_PURE # endif #endif /* _GL_ATTRIBUTE_REPRODUCIBLE declares: - It is OK for a compiler to move calls to the function and to omit duplicate - calls to the function with the same arguments, so long as the state - addressed by its arguments is the same and is updated in time for - the rest of the program. - This attribute is safe for a function that is effectless and idempotent; see - ISO C 23 § 6.7.12.7 for a definition of these terms. + It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached value returned either directly or indirectly via + a pointer, if other observable state is the same; + however, pointer arguments cannot alias. + This attribute is safe for a function that is effectless and idempotent; + see ISO C 23 § 6.7.13.8 for a definition of these terms. (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because - the function need not be stateless and idempotent. It is looser - than _GL_ATTRIBUTE_PURE because the function need not return - exactly once and can affect state addressed by its arguments.) + the function need not be stateless or independent. + Unlike _GL_ATTRIBUTE_PURE the function need not return exactly once + and can change state addressed by its pointer arguments, but the + function cannot return a pointer to storage whose contents change later.) See also and - . - ATTENTION! Efforts are underway to change the meaning of this attribute. - See . */ + . */ /* Applies to: functions, pointer to functions, function types. */ #ifndef _GL_ATTRIBUTE_REPRODUCIBLE /* This may be revisited when gcc and clang support [[reproducible]] or possibly @@ -816,20 +822,22 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif /* _GL_ATTRIBUTE_UNSEQUENCED declares: - It is OK for a compiler to move calls to the function and to omit duplicate - calls to the function with the same arguments, so long as the state - addressed by its arguments is the same. + It is OK for a compiler to move a call, or omit a duplicate call + and reuse a cached value returned either directly or indirectly via + a pointer, if the state addressed by its pointer arguments is the same; + however, pointer arguments cannot alias. This attribute is safe for a function that is effectless, idempotent, - stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of + stateless, and independent; see ISO C 23 § 6.7.13.8 for a definition of these terms. (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because - the function must be stateless and independent. It is looser than - _GL_ATTRIBUTE_CONST because the function need not return exactly - once and can depend on state addressed by its arguments.) + the function must be stateless and independent. Unlike + _GL_ATTRIBUTE_CONST the function need not return exactly once, and + can depend on state accessed via its pointer arguments or that + happens to have the same value for all calls to the function, but + the function cannot return a pointer to storage whose contents + change later.) See also and - . - ATTENTION! Efforts are underway to change the meaning of this attribute. - See . */ + . */ /* Applies to: functions, pointer to functions, function types. */ #ifndef _GL_ATTRIBUTE_UNSEQUENCED /* This may be revisited when gcc and clang support [[unsequenced]] or possibly @@ -869,6 +877,21 @@ AC_DEFUN([gl_COMMON_BODY], [ # endif #endif +/* _GL_UNNAMED (ID) is the "name" of an unnamed function parameter. + Each of the function's unnamed parameters should have a unique "name". + The "name" cannot be used. This ports both to C17 and earlier, which + lack unnamed parameters, and to C++ and later C, which have them. */ +/* Applies to: + - function parameters. */ +#ifndef _GL_UNNAMED +# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 202311 \ + && !defined __cplusplus) +# define _GL_UNNAMED(id) unnamed_##id _GL_ATTRIBUTE_UNUSED +# else +# define _GL_UNNAMED(id) +# endif +#endif + /* The following attributes enable detection of multithread-safety problems and resource leaks at compile-time, by clang ≥ 15, when the warning option -Wthread-safety is enabled. For usage, see @@ -1406,7 +1429,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], dnl -Wno-type-limits >= 4.3 >= 3.9 dnl -Wno-undef >= 3 >= 3.9 dnl -Wno-unsuffixed-float-constants >= 4.5 - dnl -Wno-unused-const-variable >= 4.4 >= 3.9 + dnl -Wno-unused-const-variable >= 6.1 >= 3.9 dnl -Wno-unused-function >= 3 >= 3.9 dnl -Wno-unused-parameter >= 3 >= 3.9 dnl @@ -1436,7 +1459,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], -Wno-sign-conversion -Wno-type-limits #endif - #if (__GNUC__ + (__GNUC_MINOR__ >= 4) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) + #if (__GNUC__ + (__GNUC_MINOR__ >= 1) > 6 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-unused-const-variable #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 50e98454..cdd46759 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2025 Free Software Foundation, Inc. +# Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -209,6 +209,7 @@ AC_DEFUN([gl_EARLY], # Code from module stdint-h: # Code from module stdio-h: gl_STDIO_H_EARLY + # Code from module stdio-windows: # Code from module stdlib-h: # Code from module strcase: # Code from module strcasecmp: @@ -218,6 +219,7 @@ AC_DEFUN([gl_EARLY], # Code from module strerror: # Code from module strerror-override: # Code from module string-h: + # Code from module stringeq: # Code from module strings-h: # Code from module strncasecmp: # Code from module strncpy: @@ -570,7 +572,8 @@ AC_DEFUN([gl_INIT], ]) gl_UNISTD_MODULE_INDICATOR([getdtablesize]) gl_FUNC_GETHOSTNAME - gl_CONDITIONAL([GL_COND_OBJ_GETHOSTNAME], [test $HAVE_GETHOSTNAME = 0]) + gl_CONDITIONAL([GL_COND_OBJ_GETHOSTNAME], + [test $HAVE_GETHOSTNAME = 0 || test $UNISTD_H_HAVE_WINSOCK2_H = 1]) AM_COND_IF([GL_COND_OBJ_GETHOSTNAME], [ gl_PREREQ_GETHOSTNAME ]) @@ -614,8 +617,7 @@ AC_DEFUN([gl_INIT], gl_PREREQ_GETPROGNAME ]) gl_STDLIB_MODULE_INDICATOR([getprogname]) - AC_SUBST([LIBINTL]) - AC_SUBST([LTLIBINTL]) + gl_GETTEXT_H AC_PROG_MKDIR_P GNULIB_I18N AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) @@ -884,19 +886,6 @@ AC_DEFUN([gl_INIT], gl_STDIO_H gl_STDIO_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - USES_MSVCRT=0 - case "$host_os" in - mingw* | windows*) - AC_EGREP_CPP([Special], [ - #ifndef _UCRT - Special - #endif - ], - [USES_MSVCRT=1]) - ;; - esac - gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) - AC_CHECK_FUNCS([vasprintf]) gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1]) gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1]) dnl No need to create extra modules for these functions. Everyone who uses @@ -922,6 +911,20 @@ AC_DEFUN([gl_INIT], gl_STDIO_MODULE_INDICATOR([fputs]) gl_STDIO_MODULE_INDICATOR([puts]) gl_STDIO_MODULE_INDICATOR([fwrite]) + AC_REQUIRE([AC_CANONICAL_HOST]) + USES_MSVCRT=0 + case "$host_os" in + mingw* | windows*) + AC_EGREP_CPP([Special], [ + #ifndef _UCRT + Special + #endif + ], + [USES_MSVCRT=1]) + ;; + esac + gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) + AC_CHECK_FUNCS([vasprintf]) gl_STDLIB_H gl_STDLIB_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P @@ -957,6 +960,9 @@ AC_DEFUN([gl_INIT], gl_STRING_H gl_STRING_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P + gl_FUNC_STREQ + gl_FUNC_MEMEQ + gl_STRING_MODULE_INDICATOR([stringeq]) gl_STRINGS_H gl_STRINGS_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P @@ -1021,35 +1027,35 @@ AC_DEFUN([gl_INIT], gl_UNICASE_H gl_UNICASE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - gl_LIBUNISTRING_MODULE([1.3], [unicase/tolower]) + gl_LIBUNISTRING_MODULE([1.4], [unicase/tolower]) gl_LIBUNISTRING_LIBHEADER([1.3], [unictype.h]) gl_UNICTYPE_H gl_UNICTYPE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-alnum]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-alnum]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-alpha]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-alpha]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-blank]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-blank]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-cntrl]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-cntrl]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-digit]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-digit]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-graph]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-graph]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-lower]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-lower]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-print]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-print]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-punct]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-punct]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-space]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-space]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([1.3], [unictype/ctype-upper]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-upper]) AC_REQUIRE([AC_C_INLINE]) - gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-xdigit]) + gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-xdigit]) gl_LIBUNISTRING_LIBHEADER([1.2], [uninorm.h]) gl_UNINORM_H gl_UNINORM_H_REQUIRE_DEFAULTS @@ -1062,7 +1068,7 @@ AC_DEFUN([gl_INIT], gl_UNITYPES_H gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h]) AC_PROG_MKDIR_P - gl_LIBUNISTRING_MODULE([1.3], [uniwidth/width]) + gl_LIBUNISTRING_MODULE([1.4], [uniwidth/width]) gl_FUNC_GLIBC_UNLOCKED_IO gl_FUNC_UNSETENV gl_CONDITIONAL([GL_COND_OBJ_UNSETENV], @@ -1535,6 +1541,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/strerror-override.c lib/strerror-override.h lib/strerror.c + lib/string.c lib/string.in.h lib/strings.in.h lib/stripslash.c @@ -1677,6 +1684,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/getloadavg.m4 m4/getopt.m4 m4/getprogname.m4 + m4/gettext_h.m4 m4/gl-openssl.m4 m4/gnulib-common.m4 m4/gnulib-i18n.m4 @@ -1773,6 +1781,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/strcasestr.m4 m4/strerror.m4 m4/string_h.m4 + m4/stringeq.m4 m4/strings_h.m4 m4/strncasecmp.m4 m4/strncpy.m4 diff --git a/gl/m4/gnulib-i18n.m4 b/gl/m4/gnulib-i18n.m4 index 868043e7..9a389187 100644 --- a/gl/m4/gnulib-i18n.m4 +++ b/gl/m4/gnulib-i18n.m4 @@ -1,6 +1,6 @@ # gnulib-i18n.m4 # serial 1 -dnl Copyright (C) 2005-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/gnulib-tool.m4 b/gl/m4/gnulib-tool.m4 index 8634a6e9..83d1e701 100644 --- a/gl/m4/gnulib-tool.m4 +++ b/gl/m4/gnulib-tool.m4 @@ -1,6 +1,6 @@ # gnulib-tool.m4 # serial 5 -dnl Copyright (C) 2004-2005, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4 index 9278285c..0303ff80 100644 --- a/gl/m4/hostent.m4 +++ b/gl/m4/hostent.m4 @@ -1,6 +1,6 @@ # hostent.m4 # serial 5 -dnl Copyright (C) 2008, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4 index 6e855e9a..a7091ad3 100644 --- a/gl/m4/idpriv.m4 +++ b/gl/m4/idpriv.m4 @@ -1,6 +1,6 @@ # idpriv.m4 # serial 1 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4 index 80de991e..a19f2dfd 100644 --- a/gl/m4/include_next.m4 +++ b/gl/m4/include_next.m4 @@ -1,6 +1,6 @@ # include_next.m4 # serial 27 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4 index 693bd51b..62e7a575 100644 --- a/gl/m4/inet_ntop.m4 +++ b/gl/m4/inet_ntop.m4 @@ -1,6 +1,6 @@ # inet_ntop.m4 -# serial 22 -dnl Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. +# serial 23 +dnl Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,6 +19,7 @@ AC_DEFUN([gl_FUNC_INET_NTOP], dnl Solaris 8..10 provide inet_ntop in libnsl instead. dnl Solaris 2.6..7 provide inet_ntop in libresolv instead. dnl Haiku provides it in -lnetwork. + dnl QNX provides it in -lsocket. dnl Native Windows provides it in -lws2_32 instead, with a declaration in dnl , and it uses stdcall calling convention, not cdecl dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). @@ -39,7 +40,7 @@ AC_DEFUN([gl_FUNC_INET_NTOP], fi else gl_saved_LIBS=$LIBS - AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [], + AC_SEARCH_LIBS([inet_ntop], [nsl resolv network socket], [], [AC_CHECK_FUNCS([inet_ntop]) if test $ac_cv_func_inet_ntop = no; then HAVE_INET_NTOP=0 diff --git a/gl/m4/inet_pton.m4 b/gl/m4/inet_pton.m4 index b6e59a25..150c3a07 100644 --- a/gl/m4/inet_pton.m4 +++ b/gl/m4/inet_pton.m4 @@ -1,6 +1,6 @@ # inet_pton.m4 -# serial 20 -dnl Copyright (C) 2006, 2008-2025 Free Software Foundation, Inc. +# serial 21 +dnl Copyright (C) 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,6 +19,7 @@ AC_DEFUN([gl_FUNC_INET_PTON], dnl Solaris 8..10 provide inet_pton in libnsl instead. dnl Solaris 2.6..7 provide inet_pton in libresolv instead. dnl Haiku provides it in -lnetwork. + dnl QNX provides it in -lsocket. dnl Native Windows provides it in -lws2_32 instead, with a declaration in dnl , and it uses stdcall calling convention, not cdecl dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). @@ -39,7 +40,7 @@ AC_DEFUN([gl_FUNC_INET_PTON], fi else gl_saved_LIBS=$LIBS - AC_SEARCH_LIBS([inet_pton], [nsl resolv network], [], + AC_SEARCH_LIBS([inet_pton], [nsl resolv network socket], [], [AC_CHECK_FUNCS([inet_pton]) if test $ac_cv_func_inet_pton = no; then HAVE_INET_PTON=0 diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4 index c1df7b27..ad79536c 100644 --- a/gl/m4/intmax_t.m4 +++ b/gl/m4/intmax_t.m4 @@ -1,6 +1,6 @@ # intmax_t.m4 # serial 9 -dnl Copyright (C) 1997-2004, 2006-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4 index 63c82c61..ec17c237 100644 --- a/gl/m4/inttypes.m4 +++ b/gl/m4/inttypes.m4 @@ -1,6 +1,6 @@ # inttypes.m4 # serial 37 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4 index ad939a53..ed9e7033 100644 --- a/gl/m4/inttypes_h.m4 +++ b/gl/m4/inttypes_h.m4 @@ -1,6 +1,6 @@ # inttypes_h.m4 # serial 10 -dnl Copyright (C) 1997-2004, 2006, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/iswblank.m4 b/gl/m4/iswblank.m4 index d06b16a2..2c301a97 100644 --- a/gl/m4/iswblank.m4 +++ b/gl/m4/iswblank.m4 @@ -1,6 +1,6 @@ # iswblank.m4 # serial 7 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/iswctype.m4 b/gl/m4/iswctype.m4 index f5a3b760..3b179a76 100644 --- a/gl/m4/iswctype.m4 +++ b/gl/m4/iswctype.m4 @@ -1,6 +1,6 @@ # iswctype.m4 # serial 3 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/iswdigit.m4 b/gl/m4/iswdigit.m4 index 4582f598..7fca8167 100644 --- a/gl/m4/iswdigit.m4 +++ b/gl/m4/iswdigit.m4 @@ -1,6 +1,6 @@ # iswdigit.m4 # serial 9 -dnl Copyright (C) 2020-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/iswpunct.m4 b/gl/m4/iswpunct.m4 index d8e8d712..be312d6c 100644 --- a/gl/m4/iswpunct.m4 +++ b/gl/m4/iswpunct.m4 @@ -1,6 +1,6 @@ # iswpunct.m4 # serial 2 -dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/iswxdigit.m4 b/gl/m4/iswxdigit.m4 index 95226fc4..2cb8e873 100644 --- a/gl/m4/iswxdigit.m4 +++ b/gl/m4/iswxdigit.m4 @@ -1,6 +1,6 @@ # iswxdigit.m4 # serial 9 -dnl Copyright (C) 2020-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4 index 69f936f0..3ed8d593 100644 --- a/gl/m4/langinfo_h.m4 +++ b/gl/m4/langinfo_h.m4 @@ -1,6 +1,6 @@ # langinfo_h.m4 -# serial 13 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +# serial 14 +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,18 +18,15 @@ AC_DEFUN_ONCE([gl_LANGINFO_H], dnl Determine whether exists. It is missing on mingw and BeOS. HAVE_LANGINFO_CODESET=0 - HAVE_LANGINFO_T_FMT_AMPM=0 HAVE_LANGINFO_ALTMON=0 HAVE_LANGINFO_ABALTMON=0 HAVE_LANGINFO_ERA=0 - HAVE_LANGINFO_YESEXPR=0 AC_CHECK_HEADERS_ONCE([langinfo.h]) if test $ac_cv_header_langinfo_h = yes; then HAVE_LANGINFO_H=1 dnl Determine what defines. dnl CODESET is missing on OpenBSD 3.8. dnl ERA etc. are missing on OpenBSD 6.7. - dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. dnl ALTMON_* are missing on glibc 2.26 and many other systems. dnl ABALTMON_* are missing on glibc 2.41 and many other systems. AC_CACHE_CHECK([whether langinfo.h defines CODESET], @@ -44,18 +41,6 @@ int a = CODESET; if test $gl_cv_header_langinfo_codeset = yes; then HAVE_LANGINFO_CODESET=1 fi - AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], - [gl_cv_header_langinfo_t_fmt_ampm], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include -int a = T_FMT_AMPM; -]])], - [gl_cv_header_langinfo_t_fmt_ampm=yes], - [gl_cv_header_langinfo_t_fmt_ampm=no]) - ]) - if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then - HAVE_LANGINFO_T_FMT_AMPM=1 - fi AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1], [gl_cv_header_langinfo_altmon], [AC_COMPILE_IFELSE( @@ -92,28 +77,14 @@ int a = ERA; if test $gl_cv_header_langinfo_era = yes; then HAVE_LANGINFO_ERA=1 fi - AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], - [gl_cv_header_langinfo_yesexpr], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include -int a = YESEXPR; -]])], - [gl_cv_header_langinfo_yesexpr=yes], - [gl_cv_header_langinfo_yesexpr=no]) - ]) - if test $gl_cv_header_langinfo_yesexpr = yes; then - HAVE_LANGINFO_YESEXPR=1 - fi else HAVE_LANGINFO_H=0 fi AC_SUBST([HAVE_LANGINFO_H]) AC_SUBST([HAVE_LANGINFO_CODESET]) - AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) AC_SUBST([HAVE_LANGINFO_ALTMON]) AC_SUBST([HAVE_LANGINFO_ABALTMON]) AC_SUBST([HAVE_LANGINFO_ERA]) - AC_SUBST([HAVE_LANGINFO_YESEXPR]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4 index b24f657d..3134f336 100644 --- a/gl/m4/largefile.m4 +++ b/gl/m4/largefile.m4 @@ -1,6 +1,6 @@ # largefile.m4 -# serial 2 -dnl Copyright 1992-1996, 1998-2025 Free Software Foundation, Inc. +# serial 4 +dnl Copyright 1992-1996, 1998-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -355,8 +355,7 @@ AC_DEFUN([gl_LARGEFILE], *) dnl Nothing to do on gnulib's side. dnl A 64-bit off_t is - dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, - dnl OSF/1, Cygwin, + dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, Cygwin, dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on dnl glibc, HP-UX, Solaris, dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, diff --git a/gl/m4/libunistring-base.m4 b/gl/m4/libunistring-base.m4 index 9b5795ed..f2f144ac 100644 --- a/gl/m4/libunistring-base.m4 +++ b/gl/m4/libunistring-base.m4 @@ -1,6 +1,6 @@ # libunistring-base.m4 # serial 10 -dnl Copyright (C) 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4 index 202df492..048c8fab 100644 --- a/gl/m4/limits-h.m4 +++ b/gl/m4/limits-h.m4 @@ -1,6 +1,6 @@ # limits-h.m4 # serial 1 -dnl Copyright 2016-2025 Free Software Foundation, Inc. +dnl Copyright 2016-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4 index 374a48f1..8e2c2755 100644 --- a/gl/m4/localcharset.m4 +++ b/gl/m4/localcharset.m4 @@ -1,6 +1,6 @@ # localcharset.m4 # serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/locale-en.m4 b/gl/m4/locale-en.m4 index 4151428a..f5e035f3 100644 --- a/gl/m4/locale-en.m4 +++ b/gl/m4/locale-en.m4 @@ -1,6 +1,6 @@ # locale-en.m4 # serial 1 -dnl Copyright (C) 2003-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ AC_DEFUN_ONCE([gt_LOCALE_EN_UTF8], *-musl* | midipix*) dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without dnl any locale file on disk. But they are effectively equivalent to the - dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES) + dnl C.UTF-8 locale, except for locale categories (such as LC_MESSAGES) dnl for which localizations (.mo files) have been installed. gt_cv_locale_en_utf8=en_US.UTF-8 ;; diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4 index f504d5b5..097cefa6 100644 --- a/gl/m4/locale-fr.m4 +++ b/gl/m4/locale-fr.m4 @@ -1,6 +1,6 @@ # locale-fr.m4 -# serial 24 -dnl Copyright (C) 2003, 2005-2025 Free Software Foundation, Inc. +# serial 25 +dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -112,7 +112,7 @@ int main () { if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO-8859-1 else - # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + # Test for the AIX, FreeBSD, NetBSD, OpenBSD locale name. if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO8859-1 else @@ -156,7 +156,7 @@ AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8], *-musl* | midipix*) dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without dnl any locale file on disk. But they are effectively equivalent to the - dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES) + dnl C.UTF-8 locale, except for locale categories (such as LC_MESSAGES) dnl for which localizations (.mo files) have been installed. gt_cv_locale_fr_utf8=fr_FR.UTF-8 ;; diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4 index 1c813b89..ee4309ed 100644 --- a/gl/m4/locale-ja.m4 +++ b/gl/m4/locale-ja.m4 @@ -1,6 +1,6 @@ # locale-ja.m4 -# serial 19 -dnl Copyright (C) 2003, 2005-2025 Free Software Foundation, Inc. +# serial 21 +dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -112,11 +112,11 @@ int main () if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC-JP else - # Test for the HP-UX, OSF/1, NetBSD locale name. + # Test for the HP-UX, NetBSD locale name. if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.eucJP else - # Test for the IRIX, FreeBSD locale name. + # Test for the FreeBSD locale name. if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC else diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4 index 6f9374d2..98975bdd 100644 --- a/gl/m4/locale-zh.m4 +++ b/gl/m4/locale-zh.m4 @@ -1,6 +1,6 @@ # locale-zh.m4 # serial 20 -dnl Copyright (C) 2003, 2005-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4 index e1afbc16..aeda9f9d 100644 --- a/gl/m4/locale_h.m4 +++ b/gl/m4/locale_h.m4 @@ -1,6 +1,6 @@ # locale_h.m4 -# serial 37 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +# serial 39 +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -63,8 +63,8 @@ AC_DEFUN_ONCE([gl_LOCALE_H], dnl Check whether 'struct lconv' is complete. dnl Bionic libc's 'struct lconv' is just a dummy. - dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, - dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. + dnl On OpenBSD 4.9, HP-UX 11, Solaris 9, Cygwin 1.5.x, mingw, MSVC 9, + dnl it lacks the int_p_* and int_n_* members. AC_CACHE_CHECK([whether struct lconv is properly defined], [gl_cv_sys_struct_lconv_ok], [AC_COMPILE_IFELSE( diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4 index 55a669d0..9fa31de8 100644 --- a/gl/m4/localeconv.m4 +++ b/gl/m4/localeconv.m4 @@ -1,6 +1,6 @@ # localeconv.m4 # serial 3 -dnl Copyright (C) 2012-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4 index b1d3f435..7058fb30 100644 --- a/gl/m4/lock.m4 +++ b/gl/m4/lock.m4 @@ -1,6 +1,6 @@ # lock.m4 -# serial 14 -dnl Copyright (C) 2005-2025 Free Software Foundation, Inc. +# serial 15 +dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,8 +12,8 @@ AC_DEFUN([gl_LOCK], [ AC_REQUIRE([gl_THREADLIB]) if test "$gl_threads_api" = posix; then - # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the - # pthread_rwlock_* functions. + # Mac OS X 10.1 lacks the pthread_rwlock_t type and the pthread_rwlock_* + # functions. has_rwlock=false AC_CHECK_TYPE([pthread_rwlock_t], [has_rwlock=true diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4 index ddfadd38..342fc55b 100644 --- a/gl/m4/lseek.m4 +++ b/gl/m4/lseek.m4 @@ -1,6 +1,6 @@ # lseek.m4 # serial 15 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/lstat.m4 b/gl/m4/lstat.m4 index efae2485..57df6fd9 100644 --- a/gl/m4/lstat.m4 +++ b/gl/m4/lstat.m4 @@ -1,6 +1,6 @@ # lstat.m4 # serial 36 -dnl Copyright (C) 1997-2001, 2003-2025 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2001, 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4 index 547b4e4d..a95e33db 100644 --- a/gl/m4/malloc.m4 +++ b/gl/m4/malloc.m4 @@ -1,6 +1,6 @@ # malloc.m4 -# serial 43.1 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +# serial 46 +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -187,40 +187,42 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], [gl_cv_func_malloc_posix="guessing yes"], [gl_cv_func_malloc_posix="guessing no"]) ;; - irix* | solaris*) - dnl On IRIX 6.5, the three functions return NULL with errno unset - dnl when the argument is larger than PTRDIFF_MAX. - dnl On Solaris 11.3, the three functions return NULL with errno set + solaris*) + dnl On Solaris 11.3, the three functions might fail with errno set dnl to EAGAIN, not ENOMEM, when the argument is larger than - dnl PTRDIFF_MAX. + dnl PTRDIFF_MAX. See: + dnl https://lists.gnu.org/r/bug-gnulib/2021-05/msg00052.html dnl Here is a test program: + m4_divert_push([KILL]) #include +#include #include +#include #include -#define ptrdiff_t long -#ifndef PTRDIFF_MAX -# define PTRDIFF_MAX ((ptrdiff_t) ((1UL << (8 * sizeof (ptrdiff_t) - 1)) - 1)) -#endif -int main () +#define TEST_CALL(call) \ + do { \ + void *p = call; \ + if (p) \ + fprintf (stderr, "returned %p (incorrect success)\n", p); \ + else if (errno == ENOMEM) \ + perror ("correct failure"); \ + else \ + perror ("incorrect failure (wrong errno)"); \ + free (p); \ + } while (0) + +int +main () { - void *p; - - fprintf (stderr, "PTRDIFF_MAX = %lu\n", (unsigned long) PTRDIFF_MAX); - - errno = 0; - p = malloc ((unsigned long) PTRDIFF_MAX + 1); - fprintf (stderr, "p=%p errno=%d\n", p, errno); - - errno = 0; - p = calloc (PTRDIFF_MAX / 2 + 1, 2); - fprintf (stderr, "p=%p errno=%d\n", p, errno); - - errno = 0; - p = realloc (NULL, (unsigned long) PTRDIFF_MAX + 1); - fprintf (stderr, "p=%p errno=%d\n", p, errno); - + size_t big = PTRDIFF_MAX; + TEST_CALL (malloc (big + 1)); + TEST_CALL (calloc (big / 2 + 1, 2)); + TEST_CALL (realloc (NULL, big + 1)); + void *small = malloc (1); + TEST_CALL (realloc (small, big + 1)); + free (small); return 0; } m4_divert_pop([KILL]) diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4 index cabe5fe7..2c0ed8ea 100644 --- a/gl/m4/malloca.m4 +++ b/gl/m4/malloca.m4 @@ -1,6 +1,6 @@ # malloca.m4 # serial 3 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4 index 8c27503b..4cf59671 100644 --- a/gl/m4/math_h.m4 +++ b/gl/m4/math_h.m4 @@ -1,6 +1,6 @@ # math_h.m4 -# serial 140.1 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +# serial 146 +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -131,8 +131,11 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL]) @@ -177,6 +180,7 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF]) @@ -220,14 +224,19 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) + HAVE_COPYSIGNF=1; AC_SUBST([HAVE_COPYSIGNF]) HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) HAVE_COSF=1; AC_SUBST([HAVE_COSF]) HAVE_COSL=1; AC_SUBST([HAVE_COSL]) HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) + HAVE_EXP2=1; AC_SUBST([HAVE_EXP2]) + HAVE_EXP2F=1; AC_SUBST([HAVE_EXP2F]) + HAVE_EXP2L=1; AC_SUBST([HAVE_EXP2L]) HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) + HAVE_EXPM1L=1; AC_SUBST([HAVE_EXPM1L]) HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) HAVE_FMA=1; AC_SUBST([HAVE_FMA]) @@ -255,6 +264,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) + HAVE_LOG2=1; AC_SUBST([HAVE_LOG2]) + HAVE_LOG2F=1; AC_SUBST([HAVE_LOG2F]) + HAVE_LOG2L=1; AC_SUBST([HAVE_LOG2L]) HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) HAVE_LOGP1=1; AC_SUBST([HAVE_LOGP1]) @@ -265,8 +277,13 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], HAVE_POWF=1; AC_SUBST([HAVE_POWF]) HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) + HAVE_REMAINDERL=1; AC_SUBST([HAVE_REMAINDERL]) HAVE_RINT=1; AC_SUBST([HAVE_RINT]) + HAVE_RINTF=1; AC_SUBST([HAVE_RINTF]) HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) + HAVE_ROUND=1; AC_SUBST([HAVE_ROUND]) + HAVE_ROUNDF=1; AC_SUBST([HAVE_ROUNDF]) + HAVE_ROUNDL=1; AC_SUBST([HAVE_ROUNDL]) HAVE_SETPAYLOAD=1; AC_SUBST([HAVE_SETPAYLOAD]) HAVE_SETPAYLOADF=1; AC_SUBST([HAVE_SETPAYLOADF]) HAVE_SETPAYLOADL=1; AC_SUBST([HAVE_SETPAYLOADL]) @@ -290,33 +307,17 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) - HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) - HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) - HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) - HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) - HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) - HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) - HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) - HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) - HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) - HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) - HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) - HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) - HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) - HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) - HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) - HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) diff --git a/gl/m4/mbchar.m4 b/gl/m4/mbchar.m4 index b76f1d7b..4251a84c 100644 --- a/gl/m4/mbchar.m4 +++ b/gl/m4/mbchar.m4 @@ -1,6 +1,6 @@ # mbchar.m4 # serial 9 -dnl Copyright (C) 2005-2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mbiter.m4 b/gl/m4/mbiter.m4 index b51242e6..927876bc 100644 --- a/gl/m4/mbiter.m4 +++ b/gl/m4/mbiter.m4 @@ -1,6 +1,6 @@ # mbiter.m4 # serial 7 -dnl Copyright (C) 2005, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mbrtoc32.m4 b/gl/m4/mbrtoc32.m4 index 1991529c..d1690fb4 100644 --- a/gl/m4/mbrtoc32.m4 +++ b/gl/m4/mbrtoc32.m4 @@ -1,6 +1,6 @@ # mbrtoc32.m4 # serial 21 -dnl Copyright (C) 2014-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2014-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4 index cc09a5fb..a49872fa 100644 --- a/gl/m4/mbrtowc.m4 +++ b/gl/m4/mbrtowc.m4 @@ -1,6 +1,6 @@ # mbrtowc.m4 -# serial 46 -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2025 Free Software Foundation, +# serial 47 +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC], REPLACE_MBRTOWC=1 else gl_MBRTOWC_NULL_ARG1 - gl_MBRTOWC_NULL_ARG2 gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL gl_MBRTOWC_STORES_INCOMPLETE @@ -46,13 +45,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC], REPLACE_MBRTOWC=1 ;; esac - case "$gl_cv_func_mbrtowc_null_arg2" in - *yes) ;; - *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], - [Define if the mbrtowc function has the NULL string argument bug.]) - REPLACE_MBRTOWC=1 - ;; - esac case "$gl_cv_func_mbrtowc_retval" in *yes) ;; *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], @@ -170,10 +162,10 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on AIX and OSF/1. - aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + # Guess no on AIX. + aix*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none; then @@ -346,57 +338,6 @@ int main () ]) ]) -dnl Test whether mbrtowc supports a NULL string argument correctly. -dnl Result is gl_cv_func_mbrtowc_null_arg2. - -AC_DEFUN([gl_MBRTOWC_NULL_ARG2], -[ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([gt_LOCALE_EN_UTF8]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], - [gl_cv_func_mbrtowc_null_arg2], - [ - dnl Initial guess, used when cross-compiling or when no suitable locale - dnl is present. -changequote(,)dnl - case "$host_os" in - # Guess no on OSF/1. - osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; - esac -changequote([,])dnl - if test "$LOCALE_EN_UTF8" != none; then - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include -#include -#include -int main () -{ - if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) - { - mbstate_t state; - wchar_t wc; - int ret; - - memset (&state, '\0', sizeof (mbstate_t)); - wc = (wchar_t) 0xBADFACE; - mbrtowc (&wc, NULL, 5, &state); - /* Check that wc was not modified. */ - if (wc != (wchar_t) 0xBADFACE) - return 2; - } - return 0; -}]])], - [gl_cv_func_mbrtowc_null_arg2=yes], - [gl_cv_func_mbrtowc_null_arg2=no], - [:]) - fi - ]) -]) - dnl Test whether mbrtowc, when parsing the end of a multibyte character, dnl correctly returns the number of bytes that were needed to complete the dnl character (not the total number of bytes of the multibyte character). @@ -716,7 +657,7 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], dnl Test whether mbrtowc reports encoding errors in the C locale. dnl Although POSIX was never intended to allow this, the GNU C Library dnl and other implementations do it. See: -dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 +dnl https://sourceware.org/PR19932 dnl POSIX has now clarified it: dnl dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4 index 69cfa574..757f2360 100644 --- a/gl/m4/mbsinit.m4 +++ b/gl/m4/mbsinit.m4 @@ -1,6 +1,6 @@ # mbsinit.m4 # serial 10 -dnl Copyright (C) 2008, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4 index 59df1e2e..88307d7a 100644 --- a/gl/m4/mbstate_t.m4 +++ b/gl/m4/mbstate_t.m4 @@ -1,6 +1,6 @@ # mbstate_t.m4 # serial 14 -dnl Copyright (C) 2000-2002, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4 index 3e3f6ce0..9c5887d3 100644 --- a/gl/m4/mbtowc.m4 +++ b/gl/m4/mbtowc.m4 @@ -1,6 +1,6 @@ # mbtowc.m4 # serial 5 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4 index 1c2ecf1d..c5c74682 100644 --- a/gl/m4/memchr.m4 +++ b/gl/m4/memchr.m4 @@ -1,6 +1,6 @@ # memchr.m4 -# serial 20 -dnl Copyright (C) 2002-2004, 2009-2025 Free Software Foundation, Inc. +# serial 21 +dnl Copyright (C) 2002-2004, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -21,7 +21,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], # https://bugzilla.redhat.com/show_bug.cgi?id=499689 # memchr should not dereference overestimated length after a match # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # https://sourceware.org/PR10162 # memchr should cast the second argument to 'unsigned char'. # This bug exists in Android 4.3. # Assume that memchr works on platforms that lack mprotect. @@ -33,31 +33,20 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], # include # include # include -# ifndef MAP_FILE -# define MAP_FILE 0 -# endif #endif ]], [[ int result = 0; char *fence = NULL; #if HAVE_SYS_MMAN_H && HAVE_MPROTECT -# if HAVE_MAP_ANONYMOUS - const int flags = MAP_ANONYMOUS | MAP_PRIVATE; - const int fd = -1; -# else /* !HAVE_MAP_ANONYMOUS */ - const int flags = MAP_FILE | MAP_PRIVATE; - int fd = open ("/dev/zero", O_RDONLY, 0666); - if (fd >= 0) -# endif - { - long int pagesize = sysconf (_SC_PAGESIZE); - char *two_pages = - (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, - flags, fd, 0); - if (two_pages != (char *)(-1) - && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) - fence = two_pages + pagesize; - } + { + long int pagesize = sysconf (_SC_PAGESIZE); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } #endif if (fence) { diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4 index 69c8a89f..3344e3f7 100644 --- a/gl/m4/minmax.m4 +++ b/gl/m4/minmax.m4 @@ -1,6 +1,6 @@ # minmax.m4 # serial 4 -dnl Copyright (C) 2005, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mktime.m4 b/gl/m4/mktime.m4 index eca6c4d8..fa32d138 100644 --- a/gl/m4/mktime.m4 +++ b/gl/m4/mktime.m4 @@ -1,6 +1,6 @@ # mktime.m4 -# serial 42 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2025 Free Software Foundation, +# serial 43 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -112,22 +112,6 @@ mktime_test (time_t now) && mktime_test1 ((time_t) (time_t_min + now))); } -static int -irix_6_4_bug () -{ - /* Based on code from Ariel Faigon. */ - struct tm tm; - tm.tm_year = 96; - tm.tm_mon = 3; - tm.tm_mday = 0; - tm.tm_hour = 0; - tm.tm_min = 0; - tm.tm_sec = 0; - tm.tm_isdst = -1; - mktime (&tm); - return tm.tm_mon == 2 && tm.tm_mday == 31; -} - static int bigtime_test (int j) { @@ -255,12 +239,10 @@ main () if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) result |= 8; } - if (! irix_6_4_bug ()) - result |= 16; if (! spring_forward_gap ()) - result |= 32; + result |= 16; if (! year_2050_test () || ! indiana_test ()) - result |= 64; + result |= 32; return result; }]])], [gl_cv_func_working_mktime=yes], diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4 index 3f7a6656..b5e323d4 100644 --- a/gl/m4/mmap-anon.m4 +++ b/gl/m4/mmap-anon.m4 @@ -1,6 +1,6 @@ # mmap-anon.m4 -# serial 12 -dnl Copyright (C) 2005, 2007, 2009-2025 Free Software Foundation, Inc. +# serial 15 +dnl Copyright (C) 2005, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,12 +8,10 @@ dnl This file is offered as-is, without any warranty. # Detect how mmap can be used to create anonymous (not file-backed) memory # mappings. -# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS -# and MAP_ANON exist and have the same value. +# - On Linux, AIX, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS and +# MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. # - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists. -# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be -# used. AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON], [ @@ -23,11 +21,13 @@ AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON], # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is # irrelevant for anonymous mappings. - AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) + # Instead, assume that mmap() exists if and only if exists. + # Code needs to tests HAVE_SYS_MMAN_H, not HAVE_MMAP. + AC_CHECK_HEADERS_ONCE([sys/mman.h]) # Try to allow MAP_ANONYMOUS. gl_have_mmap_anonymous=no - if test $gl_have_mmap = yes; then + if test $ac_cv_header_sys_mman_h = yes; then AC_MSG_CHECKING([for MAP_ANONYMOUS]) AC_EGREP_CPP([I cannot identify this map], [ #include @@ -48,10 +48,5 @@ AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON], gl_have_mmap_anonymous=yes]) fi AC_MSG_RESULT([$gl_have_mmap_anonymous]) - if test $gl_have_mmap_anonymous = yes; then - AC_DEFINE([HAVE_MAP_ANONYMOUS], [1], - [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including - config.h and .]) - fi fi ]) diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4 index 7dae201b..4621813d 100644 --- a/gl/m4/mode_t.m4 +++ b/gl/m4/mode_t.m4 @@ -1,6 +1,6 @@ # mode_t.m4 # serial 2 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/mountlist.m4 b/gl/m4/mountlist.m4 index e7eac2e9..311e00b2 100644 --- a/gl/m4/mountlist.m4 +++ b/gl/m4/mountlist.m4 @@ -1,6 +1,6 @@ # mountlist.m4 -# serial 18 -dnl Copyright (C) 2002-2006, 2009-2025 Free Software Foundation, Inc. +# serial 20 +dnl Copyright (C) 2002-2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -75,7 +75,7 @@ $ac_includes_default # Determine whether it's the one-argument variant or the two-argument one. if test -z "$ac_list_mounted_fs"; then - # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS. + # glibc, HP-UX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS. AC_CACHE_CHECK([for one-argument getmntent function], [fu_cv_sys_mounted_getmntent1], [AC_COMPILE_IFELSE( @@ -107,7 +107,7 @@ $ac_includes_default AC_DEFINE([MOUNTED_GETMNTENT1], [1], [Define if there is a function named getmntent for reading the list of mounted file systems, and that function takes a single argument. - (4.3BSD, SunOS, HP-UX, Irix)]) + (4.3BSD, SunOS, HP-UX)]) gl_CHECK_FUNCS_ANDROID([setmntent], [[#include #include @@ -159,7 +159,7 @@ $ac_includes_default fi if test -z "$ac_list_mounted_fs"; then - # OSF/1, also (obsolete) Apple Darwin 1.3. + # (obsolete) Apple Darwin 1.3. # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h AC_CACHE_CHECK([for getfsstat function], @@ -185,7 +185,7 @@ $getfsstat_includes ac_list_mounted_fs=found AC_DEFINE([MOUNTED_GETFSSTAT], [1], [Define if there is a function named getfsstat for reading the - list of mounted file systems. (DEC Alpha running OSF/1)]) + list of mounted file systems. (obsolete Darwin)]) fi fi @@ -212,10 +212,9 @@ $getfsstat_includes if test -z "$ac_list_mounted_fs"; then # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD. - # OSF/1 also has getmntinfo but is already handled above. # We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker # level the function is sometimes called getmntinfo64 or getmntinfo$INODE64 - # on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1. + # on Mac OS X, __getmntinfo13 on NetBSD and Minix. AC_CACHE_CHECK([for getmntinfo function], [fu_cv_sys_mounted_getmntinfo], [AC_LINK_IFELSE( diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4 index bfbb983b..565c0d3a 100644 --- a/gl/m4/msvc-inval.m4 +++ b/gl/m4/msvc-inval.m4 @@ -1,6 +1,6 @@ # msvc-inval.m4 # serial 1 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4 index 6a470971..1c2b491e 100644 --- a/gl/m4/msvc-nothrow.m4 +++ b/gl/m4/msvc-nothrow.m4 @@ -1,6 +1,6 @@ # msvc-nothrow.m4 # serial 1 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4 index 817f01f1..4fb642b7 100644 --- a/gl/m4/multiarch.m4 +++ b/gl/m4/multiarch.m4 @@ -1,6 +1,6 @@ # multiarch.m4 # serial 9 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/musl.m4 b/gl/m4/musl.m4 index 6ff778cb..15b34466 100644 --- a/gl/m4/musl.m4 +++ b/gl/m4/musl.m4 @@ -1,6 +1,6 @@ # musl.m4 # serial 4 -dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4 index 88512546..bcf19b01 100644 --- a/gl/m4/netdb_h.m4 +++ b/gl/m4/netdb_h.m4 @@ -1,6 +1,6 @@ # netdb_h.m4 # serial 15 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4 index b56e354c..6d9eaf97 100644 --- a/gl/m4/netinet_in_h.m4 +++ b/gl/m4/netinet_in_h.m4 @@ -1,6 +1,6 @@ # netinet_in_h.m4 # serial 6 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4 index 9b1e0f32..a3ec57f7 100644 --- a/gl/m4/nl_langinfo.m4 +++ b/gl/m4/nl_langinfo.m4 @@ -1,6 +1,6 @@ # nl_langinfo.m4 -# serial 12.1 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +# serial 14 +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,31 +16,6 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], AC_REQUIRE([gl_PTHREADLIB]) AC_CHECK_HEADERS_ONCE([threads.h]) if test $ac_cv_func_nl_langinfo = yes; then - # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. - AC_CACHE_CHECK([whether YESEXPR works], - [gl_cv_func_nl_langinfo_yesexpr_works], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[#include -]], [[return !*nl_langinfo(YESEXPR); -]])], - [gl_cv_func_nl_langinfo_yesexpr_works=yes], - [gl_cv_func_nl_langinfo_yesexpr_works=no], - [ - case "$host_os" in - # Guess no on irix systems. - irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; - # Guess yes elsewhere. - *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; - esac - ]) - ]) - case $gl_cv_func_nl_langinfo_yesexpr_works in - *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; - *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; - esac - AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], - [$FUNC_NL_LANGINFO_YESEXPR_WORKS], - [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) # On macOS 26, Solaris 10, and Solaris 11.3, nl_langinfo is not # multithread-safe. case "$host_os" in @@ -50,11 +25,9 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE], [Define to 1 if nl_langinfo is multithread-safe.]) if test $HAVE_LANGINFO_CODESET = 1 \ - && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \ && test $HAVE_LANGINFO_ALTMON = 1 \ && test $HAVE_LANGINFO_ABALTMON = 1 \ && test $HAVE_LANGINFO_ERA = 1 \ - && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \ && test $NL_LANGINFO_MTSAFE = 1; then : else diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4 index 662fb049..5c1af8c7 100644 --- a/gl/m4/nocrash.m4 +++ b/gl/m4/nocrash.m4 @@ -1,6 +1,6 @@ # nocrash.m4 # serial 5 -dnl Copyright (C) 2005, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/off64_t.m4 b/gl/m4/off64_t.m4 index 963d53e9..93d9e37b 100644 --- a/gl/m4/off64_t.m4 +++ b/gl/m4/off64_t.m4 @@ -1,6 +1,6 @@ # off64_t.m4 # serial 1 -dnl Copyright (C) 2024-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4 index f4f4bbf6..d7d6aa0c 100644 --- a/gl/m4/off_t.m4 +++ b/gl/m4/off_t.m4 @@ -1,6 +1,6 @@ # off_t.m4 # serial 1 -dnl Copyright (C) 2012-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/once.m4 b/gl/m4/once.m4 index 7876a8fe..a478d81a 100644 --- a/gl/m4/once.m4 +++ b/gl/m4/once.m4 @@ -1,6 +1,6 @@ # once.m4 # serial 1 -dnl Copyright (C) 2024-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4 index 860541b0..9c9aef23 100644 --- a/gl/m4/open-cloexec.m4 +++ b/gl/m4/open-cloexec.m4 @@ -1,6 +1,6 @@ # open-cloexec.m4 # serial 1 -dnl Copyright 2017-2025 Free Software Foundation, Inc. +dnl Copyright 2017-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4 index 2cba48fe..c36bdced 100644 --- a/gl/m4/open-slash.m4 +++ b/gl/m4/open-slash.m4 @@ -1,6 +1,6 @@ # open-slash.m4 # serial 2 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/open.m4 b/gl/m4/open.m4 index dd3a805f..f5b2a91c 100644 --- a/gl/m4/open.m4 +++ b/gl/m4/open.m4 @@ -1,6 +1,6 @@ # open.m4 # serial 17 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4 index 0c3925df..d6bdf43e 100644 --- a/gl/m4/pathmax.m4 +++ b/gl/m4/pathmax.m4 @@ -1,6 +1,6 @@ # pathmax.m4 # serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2025 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/pid_t.m4 b/gl/m4/pid_t.m4 index a8bdabc2..314792ed 100644 --- a/gl/m4/pid_t.m4 +++ b/gl/m4/pid_t.m4 @@ -1,6 +1,6 @@ # pid_t.m4 # serial 4 -dnl Copyright (C) 2020-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4 index 4619a402..0de493b6 100644 --- a/gl/m4/printf.m4 +++ b/gl/m4/printf.m4 @@ -1,6 +1,6 @@ # printf.m4 -# serial 96 -dnl Copyright (C) 2003, 2007-2025 Free Software Foundation, Inc. +# serial 98 +dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -659,7 +659,7 @@ int main () && strcmp (buf, "0x8.0p-2") != 0)) result |= 16; /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a - glibc 2.4 bug + glibc 2.4 bug and a FreeBSD 6.4, NetBSD 10.0 bug. */ if (sprintf (buf, "%.1La", 1.999L) < 0 || (strcmp (buf, "0x1.0p+1") != 0 @@ -937,7 +937,7 @@ int main () _CrtSetReportMode (_CRT_ASSERT, 0); #endif signal (SIGABRT, abort_handler); - /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); @@ -994,7 +994,7 @@ int main () int result = 0; char buf[100]; /* Test whether %ls works at all. - This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + This test fails on OpenBSD 4.0, Solaris 2.6, Haiku, but not on Cygwin 1.5. */ { static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; @@ -1003,8 +1003,8 @@ int main () || strcmp (buf, "abc") != 0) result |= 1; } - /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an - assertion failure inside libc), but not on OpenBSD 4.0. */ + /* This test fails on Solaris 2.6, Cygwin 1.5, Haiku (with an assertion + failure inside libc), but not on OpenBSD 4.0. */ { static const wchar_t wstring[] = { 'a', 0 }; buf[0] = '\0'; @@ -1037,7 +1037,6 @@ changequote(,)dnl # Guess yes on OpenBSD >= 6.0. openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; - irix*) gl_cv_func_printf_directive_ls="guessing no";; solaris*) gl_cv_func_printf_directive_ls="guessing no";; cygwin*) gl_cv_func_printf_directive_ls="guessing no";; beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; @@ -1589,10 +1588,6 @@ changequote(,)dnl *) gl_cv_func_printf_enomem="guessing no";; esac ;; - # Guess yes on IRIX. - irix*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on OSF/1. - osf*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on Haiku. @@ -1684,11 +1679,6 @@ changequote(,)dnl # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_truncation_c99="guessing no";; @@ -1710,7 +1700,7 @@ changequote([,])dnl dnl Test whether the return value of the snprintf function is the number dnl of bytes (excluding the terminating NUL) that would have been produced dnl if the buffer had been large enough. (ISO C99, POSIX:2001) -dnl For example, this test program fails on IRIX 6.5: +dnl For example, this test program fails on HP-UX 11.31 and Solaris 9: dnl --------------------------------------------------------------------- dnl #include dnl int main() @@ -1859,7 +1849,7 @@ int main () { int count = -1; signal (SIGABRT, abort_handler); - /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); @@ -1899,11 +1889,6 @@ changequote(,)dnl # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; aix*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; - osf*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_directive_n="guessing no";; @@ -2058,8 +2043,6 @@ changequote(,)dnl # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; diff --git a/gl/m4/pthread-once.m4 b/gl/m4/pthread-once.m4 index 85549254..9080363d 100644 --- a/gl/m4/pthread-once.m4 +++ b/gl/m4/pthread-once.m4 @@ -1,6 +1,6 @@ # pthread-once.m4 # serial 6 -dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/pthread-spin.m4 b/gl/m4/pthread-spin.m4 index aae2fb3b..17fa3b5e 100644 --- a/gl/m4/pthread-spin.m4 +++ b/gl/m4/pthread-spin.m4 @@ -1,6 +1,6 @@ # pthread-spin.m4 # serial 8 -dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/pthread_h.m4 b/gl/m4/pthread_h.m4 index bb921386..f01dc3d3 100644 --- a/gl/m4/pthread_h.m4 +++ b/gl/m4/pthread_h.m4 @@ -1,6 +1,6 @@ # pthread_h.m4 # serial 11 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4 index aec9f076..c16c781d 100644 --- a/gl/m4/pthread_rwlock_rdlock.m4 +++ b/gl/m4/pthread_rwlock_rdlock.m4 @@ -1,6 +1,6 @@ # pthread_rwlock_rdlock.m4 # serial 8 -dnl Copyright (C) 2017-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -32,7 +32,7 @@ dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rd dnl but this test verifies the guarantee regardless of TPS and regardless of dnl scheduling policy. dnl Glibc does not provide this guarantee (and never will on Linux), see -dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701 +dnl https://sourceware.org/PR13701 dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052 AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [ diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4 index 67c1476b..8938db92 100644 --- a/gl/m4/realloc.m4 +++ b/gl/m4/realloc.m4 @@ -1,6 +1,6 @@ # realloc.m4 -# serial 39.1 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +# serial 40 +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/reallocarray.m4 b/gl/m4/reallocarray.m4 index 3970d9e1..e789967c 100644 --- a/gl/m4/reallocarray.m4 +++ b/gl/m4/reallocarray.m4 @@ -1,6 +1,6 @@ # reallocarray.m4 # serial 7 -dnl Copyright (C) 2017-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4 index 49a8059f..45a10490 100644 --- a/gl/m4/regex.m4 +++ b/gl/m4/regex.m4 @@ -1,6 +1,6 @@ # regex.m4 # serial 81 -dnl Copyright (C) 1996-2001, 2003-2025 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2001, 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sched_h.m4 b/gl/m4/sched_h.m4 index 1ffd465f..92ebe1b7 100644 --- a/gl/m4/sched_h.m4 +++ b/gl/m4/sched_h.m4 @@ -1,6 +1,6 @@ # sched_h.m4 # serial 16 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4 index ba6ebd1d..97bcad0f 100644 --- a/gl/m4/servent.m4 +++ b/gl/m4/servent.m4 @@ -1,6 +1,6 @@ # servent.m4 # serial 5 -dnl Copyright (C) 2008, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4 index 727e35af..5faf28d2 100644 --- a/gl/m4/setenv.m4 +++ b/gl/m4/setenv.m4 @@ -1,6 +1,6 @@ # setenv.m4 -# serial 35 -dnl Copyright (C) 2001-2004, 2006-2025 Free Software Foundation, Inc. +# serial 36 +dnl Copyright (C) 2001-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -85,8 +85,6 @@ AC_DEFUN([gl_FUNC_UNSETENV], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ -#undef _BSD -#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ #include extern #ifdef __cplusplus diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4 index 3c8b693e..b6727245 100644 --- a/gl/m4/setlocale_null.m4 +++ b/gl/m4/setlocale_null.m4 @@ -1,6 +1,6 @@ # setlocale_null.m4 -# serial 10 -dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. +# serial 11 +dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -32,8 +32,8 @@ AC_DEFUN_ONCE([gl_FUNC_SETLOCALE_NULL], [gl_cv_func_setlocale_null_all_mtsafe=yes], [gl_cv_func_setlocale_null_all_mtsafe=no]) ;; - # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. - *-gnu* | gnu* | hpux* | irix* | solaris* | mingw* | windows*) + # Guess yes on glibc, HP-UX, Solaris, native Windows. + *-gnu* | gnu* | hpux* | solaris* | mingw* | windows*) gl_cv_func_setlocale_null_all_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) @@ -63,8 +63,8 @@ AC_DEFUN_ONCE([gl_FUNC_SETLOCALE_NULL], # Guess no on OpenBSD, AIX. openbsd* | aix*) gl_cv_func_setlocale_null_one_mtsafe=no ;; - # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. - *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw* | windows*) + # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, Solaris, Haiku, Cygwin, native Windows. + *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | solaris* | haiku* | cygwin* | mingw* | windows*) gl_cv_func_setlocale_null_one_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) diff --git a/gl/m4/sha256.m4 b/gl/m4/sha256.m4 index 30e8deeb..a9bd7857 100644 --- a/gl/m4/sha256.m4 +++ b/gl/m4/sha256.m4 @@ -1,6 +1,6 @@ # sha256.m4 # serial 8 -dnl Copyright (C) 2005, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4 index b0460d45..b7a5153a 100644 --- a/gl/m4/size_max.m4 +++ b/gl/m4/size_max.m4 @@ -1,6 +1,6 @@ # size_max.m4 # serial 12 -dnl Copyright (C) 2003, 2005-2006, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4 index 2c50cee9..6de225c2 100644 --- a/gl/m4/snprintf.m4 +++ b/gl/m4/snprintf.m4 @@ -1,6 +1,6 @@ # snprintf.m4 # serial 7 -dnl Copyright (C) 2002-2004, 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4 index e3509f81..f62ffcfd 100644 --- a/gl/m4/socketlib.m4 +++ b/gl/m4/socketlib.m4 @@ -1,6 +1,6 @@ # socketlib.m4 # serial 4 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4 index 54f4dc79..95800d2e 100644 --- a/gl/m4/sockets.m4 +++ b/gl/m4/sockets.m4 @@ -1,6 +1,6 @@ # sockets.m4 # serial 7 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4 index a8ac25b1..e5156511 100644 --- a/gl/m4/socklen.m4 +++ b/gl/m4/socklen.m4 @@ -1,6 +1,6 @@ # socklen.m4 -# serial 11 -dnl Copyright (C) 2005-2007, 2009-2025 Free Software Foundation, Inc. +# serial 13 +dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ dnl From Albert Chin, Windows fixes from Simon Josefsson. dnl Check for socklen_t: historically on BSD it is an int, and in dnl POSIX 1g it is a type of its own, but some platforms use different dnl types for the argument to getsockopt, getpeername, etc.: -dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. +dnl HP-UX 10.20, Interix 3.5, BeOS. dnl So we have to test to find something that will work. AC_DEFUN([gl_TYPE_SOCKLEN_T], diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4 index 08ce843d..6379766d 100644 --- a/gl/m4/sockpfaf.m4 +++ b/gl/m4/sockpfaf.m4 @@ -1,6 +1,6 @@ # sockpfaf.m4 # serial 11 -dnl Copyright (C) 2004, 2006, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4 index a2ffd6fc..8710cb72 100644 --- a/gl/m4/ssize_t.m4 +++ b/gl/m4/ssize_t.m4 @@ -1,6 +1,6 @@ # ssize_t.m4 # serial 6 -dnl Copyright (C) 2001-2003, 2006, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4 index 4aa24e7f..10eb1dfa 100644 --- a/gl/m4/stat-time.m4 +++ b/gl/m4/stat-time.m4 @@ -1,6 +1,6 @@ # stat-time.m4 # serial 1 -dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2025 Free Software +dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2026 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4 index 66876305..3764ec0b 100644 --- a/gl/m4/stat.m4 +++ b/gl/m4/stat.m4 @@ -1,6 +1,6 @@ # stat.m4 # serial 21 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/std-gnu11.m4 b/gl/m4/std-gnu11.m4 index 762764e0..0868a43a 100644 --- a/gl/m4/std-gnu11.m4 +++ b/gl/m4/std-gnu11.m4 @@ -16,7 +16,7 @@ m4_ifndef([_AC_C_C23_OPTIONS], [ m4_version_prereq([2.70], [], [ -# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# Copyright (C) 2001-2026 Free Software Foundation, Inc. # This file is part of Autoconf. This program is free # software; you can redistribute it and/or modify it under the @@ -777,7 +777,7 @@ AC_DEFUN([_AC_CXX_CXX11_TEST_BODY], } { // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; + auto const *utf8 = u8"UTF-8 string \u2500"; // This is portable to C++20. char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4 index 885feafd..7177d034 100644 --- a/gl/m4/stdalign.m4 +++ b/gl/m4/stdalign.m4 @@ -1,6 +1,6 @@ # stdalign.m4 # serial 3 -dnl Copyright 2011-2025 Free Software Foundation, Inc. +dnl Copyright 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -30,7 +30,7 @@ AC_DEFUN([gl_ALIGNASOF], /* Test that alignof yields a result consistent with offsetof. This catches GCC bug 52023 - . */ + . */ #ifdef __cplusplus template struct alignof_helper { char a; t b; }; # define ao(type) offsetof (alignof_helper, b) @@ -82,8 +82,8 @@ AC_DEFUN([gl_ALIGNASOF], References: ISO C23 (latest free draft - ) - sections 6.5.3.4, 6.7.5, 7.15. + ) + sections 6.2.8, 6.7.6. C++11 (latest free draft ) section 18.10. */ @@ -103,7 +103,7 @@ AC_DEFUN([gl_ALIGNASOF], want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */ /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 - . + . clang versions < 8.0.0 have the same bug. IBM XL C V16.1.0 cc (non-clang) has the same bug. */ # if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ diff --git a/gl/m4/stdckdint_h.m4 b/gl/m4/stdckdint_h.m4 index d269faa5..eb8c858a 100644 --- a/gl/m4/stdckdint_h.m4 +++ b/gl/m4/stdckdint_h.m4 @@ -1,6 +1,6 @@ # stdckdint_h.m4 # serial 1 -dnl Copyright 2025 Free Software Foundation, Inc. +dnl Copyright 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4 index 127ec05b..299472b1 100644 --- a/gl/m4/stddef_h.m4 +++ b/gl/m4/stddef_h.m4 @@ -1,6 +1,6 @@ # stddef_h.m4 # serial 23 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -85,7 +85,7 @@ AC_DEFUN_ONCE([gl_STDDEF_H], dnl Provide gl_unreachable() unconditionally. GL_GENERATE_STDDEF_H=true - dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869 + dnl https://gcc.gnu.org/PR114869 AC_CACHE_CHECK([whether nullptr_t needs ], [gl_cv_nullptr_t_needs_stddef], [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]], @@ -96,7 +96,7 @@ AC_DEFUN_ONCE([gl_STDDEF_H], GL_GENERATE_STDDEF_H=true fi - dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 + dnl https://gcc.gnu.org/PR114870 dnl affects GCC 13.3 and 14.2. AC_CACHE_CHECK([whether is idempotent], [gl_cv_stddef_idempotent], diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4 index 2d69088b..410da153 100644 --- a/gl/m4/stdint.m4 +++ b/gl/m4/stdint.m4 @@ -1,6 +1,6 @@ # stdint.m4 -# serial 64 -dnl Copyright (C) 2001-2025 Free Software Foundation, Inc. +# serial 65 +dnl Copyright (C) 2001-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -391,9 +391,9 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], ]) eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then - dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, - dnl do a syntax check even on unused #if conditions and give an error - dnl on valid C code like this: + dnl Use a nonempty default, because some old compilers do a syntax check + dnl even on unused #if conditions and give an error on valid C code like + dnl this: dnl #if 0 dnl # if > 32 dnl # endif diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4 index d4f1acdd..7f60af20 100644 --- a/gl/m4/stdint_h.m4 +++ b/gl/m4/stdint_h.m4 @@ -1,6 +1,6 @@ # stdint_h.m4 # serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4 index 71d86180..9d4126f5 100644 --- a/gl/m4/stdio_h.m4 +++ b/gl/m4/stdio_h.m4 @@ -1,6 +1,6 @@ # stdio_h.m4 # serial 75 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4 index 2d25da37..f35d6611 100644 --- a/gl/m4/stdlib_h.m4 +++ b/gl/m4/stdlib_h.m4 @@ -1,6 +1,6 @@ # stdlib_h.m4 -# serial 84 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +# serial 86 +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -205,7 +205,6 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) - HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) @@ -224,6 +223,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) + HAVE_SYS_PROCESS_H=0; AC_SUBST([HAVE_SYS_PROCESS_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT]) diff --git a/gl/m4/strcasecmp.m4 b/gl/m4/strcasecmp.m4 index eb4345d9..f9f90928 100644 --- a/gl/m4/strcasecmp.m4 +++ b/gl/m4/strcasecmp.m4 @@ -1,6 +1,6 @@ # strcasecmp.m4 # serial 3 -dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4 index eb2862f1..f56eed58 100644 --- a/gl/m4/strcasestr.m4 +++ b/gl/m4/strcasestr.m4 @@ -1,6 +1,6 @@ # strcasestr.m4 # serial 29 -dnl Copyright (C) 2005, 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,8 +22,8 @@ AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE], if test $REPLACE_MEMCHR = 1; then REPLACE_STRCASESTR=1 else - dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092 - dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637. + dnl Detect https://sourceware.org/PR12092 + dnl and https://sourceware.org/PR23637. AC_CACHE_CHECK([whether strcasestr works], [gl_cv_func_strcasestr_works_always], [AC_RUN_IFELSE( diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4 index c8b3b207..9bb60c3f 100644 --- a/gl/m4/strerror.m4 +++ b/gl/m4/strerror.m4 @@ -1,6 +1,6 @@ # strerror.m4 # serial 25 -dnl Copyright (C) 2002, 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4 index fc73603a..2a6e4db4 100644 --- a/gl/m4/string_h.m4 +++ b/gl/m4/string_h.m4 @@ -1,6 +1,6 @@ # string_h.m4 -# serial 44.1 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +# serial 46 +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -63,6 +63,7 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRINGEQ]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP]) @@ -115,6 +116,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS], HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) + HAVE_DECL_MEMEQ=0; AC_SUBST([HAVE_DECL_MEMEQ]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_MEMSET_EXPLICIT=1; AC_SUBST([HAVE_MEMSET_EXPLICIT]) @@ -124,6 +126,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS], HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) + HAVE_DECL_STREQ=0; AC_SUBST([HAVE_DECL_STREQ]) HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) diff --git a/gl/m4/stringeq.m4 b/gl/m4/stringeq.m4 new file mode 100644 index 00000000..ffea8afc --- /dev/null +++ b/gl/m4/stringeq.m4 @@ -0,0 +1,25 @@ +# stringeq.m4 +# serial 1 +dnl Copyright (C) 2025-2026 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +AC_DEFUN([gl_FUNC_STREQ], +[ + AC_REQUIRE([gl_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([streq]) + if test $ac_cv_have_decl_streq != no; then + HAVE_DECL_STREQ=1 + fi +]) + +AC_DEFUN([gl_FUNC_MEMEQ], +[ + AC_REQUIRE([gl_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([memeq]) + if test $ac_cv_have_decl_memeq != no; then + HAVE_DECL_MEMEQ=1 + fi +]) diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4 index 18f30d4a..aec4f715 100644 --- a/gl/m4/strings_h.m4 +++ b/gl/m4/strings_h.m4 @@ -1,6 +1,6 @@ # strings_h.m4 # serial 14 -dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/strncasecmp.m4 b/gl/m4/strncasecmp.m4 index c7c8b240..4314b603 100644 --- a/gl/m4/strncasecmp.m4 +++ b/gl/m4/strncasecmp.m4 @@ -1,6 +1,6 @@ # strncasecmp.m4 # serial 2 -dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/strncpy.m4 b/gl/m4/strncpy.m4 index 57876171..b94abede 100644 --- a/gl/m4/strncpy.m4 +++ b/gl/m4/strncpy.m4 @@ -1,6 +1,6 @@ # strncpy.m4 # serial 1 -dnl Copyright (C) 2002-2004, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4 index b018ff88..6afd34a9 100644 --- a/gl/m4/strsep.m4 +++ b/gl/m4/strsep.m4 @@ -1,6 +1,6 @@ # strsep.m4 # serial 11 -dnl Copyright (C) 2002-2004, 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/strstr.m4 b/gl/m4/strstr.m4 index 1b5ef6c1..3a9e9c60 100644 --- a/gl/m4/strstr.m4 +++ b/gl/m4/strstr.m4 @@ -1,6 +1,6 @@ # strstr.m4 # serial 25 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,8 +14,8 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], if test $REPLACE_MEMCHR = 1; then REPLACE_STRSTR=1 else - dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092 - dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637. + dnl Detect https://sourceware.org/PR12092 + dnl and https://sourceware.org/PR23637. AC_CACHE_CHECK([whether strstr works], [gl_cv_func_strstr_works_always], [AC_RUN_IFELSE( diff --git a/gl/m4/sys_cdefs_h.m4 b/gl/m4/sys_cdefs_h.m4 index d72796ca..a1398a29 100644 --- a/gl/m4/sys_cdefs_h.m4 +++ b/gl/m4/sys_cdefs_h.m4 @@ -1,6 +1,6 @@ # sys_cdefs_h.m4 - Is compatible enough with glibc? # serial 2 -dnl Copyright 2024-2025 Free Software Foundation, Inc. +dnl Copyright 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4 index fb69209b..cdc374e4 100644 --- a/gl/m4/sys_socket_h.m4 +++ b/gl/m4/sys_socket_h.m4 @@ -1,6 +1,6 @@ # sys_socket_h.m4 -# serial 31 -dnl Copyright (C) 2005-2025 Free Software Foundation, Inc. +# serial 32 +dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,17 +13,6 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H], AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) - dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have - dnl old-style declarations (with return type 'int' instead of 'ssize_t') - dnl unless _POSIX_PII_SOCKET is defined. - case "$host_os" in - osf*) - AC_DEFINE([_POSIX_PII_SOCKET], [1], - [Define to 1 in order to get the POSIX compatible declarations - of socket functions.]) - ;; - esac - GL_GENERATE_SYS_SOCKET_H=false AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_socket_h_selfcontained], diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4 index fdcc8954..04dfce7e 100644 --- a/gl/m4/sys_stat_h.m4 +++ b/gl/m4/sys_stat_h.m4 @@ -1,6 +1,6 @@ # sys_stat_h.m4 -# serial 42 -*- Autoconf -*- -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +# serial 44 -*- Autoconf -*- +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4 index e99fdcc6..b284e08e 100644 --- a/gl/m4/sys_types_h.m4 +++ b/gl/m4/sys_types_h.m4 @@ -1,6 +1,6 @@ # sys_types_h.m4 # serial 15 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4 index eb0e8424..59496e01 100644 --- a/gl/m4/sys_uio_h.m4 +++ b/gl/m4/sys_uio_h.m4 @@ -1,6 +1,6 @@ # sys_uio_h.m4 # serial 3 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4 index 333c8fe0..bdea4b97 100644 --- a/gl/m4/threadlib.m4 +++ b/gl/m4/threadlib.m4 @@ -1,6 +1,6 @@ # threadlib.m4 -# serial 45.1 -dnl Copyright (C) 2005-2025 Free Software Foundation, Inc. +# serial 49 +dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -57,16 +57,6 @@ AC_DEFUN([gl_ANYTHREADLIB_EARLY], [ AC_REQUIRE([AC_CANONICAL_HOST]) if test -z "$gl_anythreadlib_early_done"; then - AS_CASE([$host_os], - [osf*], - [# On OSF/1, the compiler needs the flag -D_REENTRANT so that it - # groks . cc also understands the flag -pthread, but - # we do not use it because 1. gcc-2.95 does not understand -pthread, - # 2. putting a flag into CPPFLAGS that has an effect on the linker - # causes the AC_LINK_IFELSE test below to succeed unexpectedly, - # leading to wrong values of LIBTHREAD and LTLIBTHREAD. - CPPFLAGS="$CPPFLAGS -D_REENTRANT" - ]) # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of errno in . @@ -190,17 +180,13 @@ AC_DEFUN([gl_PTHREADLIB_BODY], gl_pthread_api=no LIBPTHREAD= LIBPMULTITHREAD= - # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that - # it groks . It is added above, in gl_ANYTHREADLIB_EARLY. AC_CHECK_HEADER([pthread.h], [gl_have_pthread_h=yes], [gl_have_pthread_h=no]) AS_IF([test "$gl_have_pthread_h" = yes], [ # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads - # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist - # in libc. IRIX 6.5 has the first one in both libc and libpthread, but - # the second one only in libpthread, and lock.c needs it. + # Test whether both pthread_mutex_lock exists in libc. # # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 # needs -pthread for some reason. See: @@ -212,10 +198,8 @@ AC_DEFUN([gl_PTHREADLIB_BODY], [AC_LANG_PROGRAM( [[#include pthread_mutex_t m; - pthread_mutexattr_t ma; ]], - [[pthread_mutex_lock (&m); - pthread_mutexattr_init (&ma);]])], + [[pthread_mutex_lock (&m);]])], [gl_pthread_api=yes LIBPTHREAD=$gl_pthread LIBPMULTITHREAD=$gl_pthread]) @@ -244,8 +228,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY], ]) echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD - # Test for libpthread by looking for pthread_kill. (Not pthread_self, - # since it is defined as a macro on OSF/1.) + # Test for libpthread by looking for pthread_kill. AS_IF([test $gl_pthread_api = yes && test -z "$LIBPTHREAD"], [ # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. @@ -451,18 +434,19 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], dnl gl_use_winpthreads_default defaults to "no", because in mingw 10, like dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash. m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no]) + dnl Don't display the --disable-threads option + dnl - if the package builds one or more libraries, because libraries must + dnl always be multithread-safe (as far as possible), + dnl - if the package defines gl_THREADLIB_DEFAULT_NO, because the option + dnl would then be a no-op. AC_ARG_ENABLE([threads], -AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ -AS_HELP_STRING([[--disable-threads]], [build without multithread safety])]), +AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([LT_INIT], [], [m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AS_HELP_STRING([[--disable-threads]], [build without multithread safety])])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" else AS_CASE([$host_os], - dnl Disable multithreading by default on OSF/1, because it interferes - dnl with fork()/exec(): When msgexec is linked with -lpthread, its - dnl child process gets an endless segmentation fault inside execvp(). - [osf*], [gl_use_threads=no], dnl Disable multithreading by default on Cygwin 1.5.x, because it has dnl bugs that lead to endless loops or crashes. See dnl . @@ -665,13 +649,8 @@ dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl -dnl IRIX 6.5 posix -lpthread Y 0.5 -dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl -dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK -dnl -lpthread (gcc) Y -dnl dnl Cygwin posix -lpthread Y OK dnl dnl Mingw windows N OK diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4 index f4d8e20f..8d896ea5 100644 --- a/gl/m4/time_h.m4 +++ b/gl/m4/time_h.m4 @@ -1,6 +1,6 @@ # time_h.m4 # serial 27 -dnl Copyright (C) 2000-2001, 2003-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 2000-2001, 2003-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4 index 96f5c5b5..59477e3b 100644 --- a/gl/m4/time_r.m4 +++ b/gl/m4/time_r.m4 @@ -1,6 +1,6 @@ # time_r.m4 # serial 1 -dnl Copyright (C) 2003, 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/timegm.m4 b/gl/m4/timegm.m4 index cb6da6da..50a98b25 100644 --- a/gl/m4/timegm.m4 +++ b/gl/m4/timegm.m4 @@ -1,6 +1,6 @@ # timegm.m4 # serial 16 -dnl Copyright (C) 2003, 2007, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/uchar_h.m4 b/gl/m4/uchar_h.m4 index b2309385..20b63b6c 100644 --- a/gl/m4/uchar_h.m4 +++ b/gl/m4/uchar_h.m4 @@ -1,6 +1,6 @@ # uchar_h.m4 # serial 32 -dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/ungetc.m4 b/gl/m4/ungetc.m4 index 969b60e8..299c43f2 100644 --- a/gl/m4/ungetc.m4 +++ b/gl/m4/ungetc.m4 @@ -1,6 +1,6 @@ # ungetc.m4 # serial 12 -dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/unicase_h.m4 b/gl/m4/unicase_h.m4 index bf5d4c2e..71dccf06 100644 --- a/gl/m4/unicase_h.m4 +++ b/gl/m4/unicase_h.m4 @@ -1,6 +1,6 @@ # unicase_h.m4 # serial 1 -dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/unictype_h.m4 b/gl/m4/unictype_h.m4 index 68ddaf6c..ba5a3688 100644 --- a/gl/m4/unictype_h.m4 +++ b/gl/m4/unictype_h.m4 @@ -1,6 +1,6 @@ # unictype_h.m4 # serial 4 -dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/uninorm_h.m4 b/gl/m4/uninorm_h.m4 index d416f73b..5ec9ea67 100644 --- a/gl/m4/uninorm_h.m4 +++ b/gl/m4/uninorm_h.m4 @@ -1,6 +1,6 @@ # uninorm_h.m4 # serial 1 -dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index 6ec16286..8000e888 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,6 +1,6 @@ # unistd_h.m4 # serial 97 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/unitypes_h.m4 b/gl/m4/unitypes_h.m4 index 264e61be..733b9ee2 100644 --- a/gl/m4/unitypes_h.m4 +++ b/gl/m4/unitypes_h.m4 @@ -1,6 +1,6 @@ # unitypes_h.m4 # serial 1 -dnl Copyright (C) 2021-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2021-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/unlocked-io.m4 b/gl/m4/unlocked-io.m4 index 97f43f4b..16ab6e9a 100644 --- a/gl/m4/unlocked-io.m4 +++ b/gl/m4/unlocked-io.m4 @@ -1,6 +1,6 @@ # unlocked-io.m4 -# serial 16 -dnl Copyright (C) 1998-2006, 2009-2025 Free Software Foundation, Inc. +# serial 17 +dnl Copyright (C) 1998-2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -25,6 +25,7 @@ AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], AC_CHECK_DECLS_ONCE([ferror_unlocked]) AC_CHECK_DECLS_ONCE([fflush_unlocked]) AC_CHECK_DECLS_ONCE([fgets_unlocked]) + AC_CHECK_DECLS_ONCE([fileno_unlocked]) AC_CHECK_DECLS_ONCE([fputc_unlocked]) AC_CHECK_DECLS_ONCE([fputs_unlocked]) AC_CHECK_DECLS_ONCE([fread_unlocked]) diff --git a/gl/m4/vararrays.m4 b/gl/m4/vararrays.m4 index 086e409f..3dd8e68f 100644 --- a/gl/m4/vararrays.m4 +++ b/gl/m4/vararrays.m4 @@ -1,6 +1,6 @@ # vararrays.m4 # serial 6 -dnl Copyright (C) 2001, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2001, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4 index 1d040d6e..4e01fbc9 100644 --- a/gl/m4/vasnprintf.m4 +++ b/gl/m4/vasnprintf.m4 @@ -1,6 +1,6 @@ # vasnprintf.m4 # serial 56 -dnl Copyright (C) 2002-2004, 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4 index 6ea602bd..3e6913e2 100644 --- a/gl/m4/vasprintf.m4 +++ b/gl/m4/vasprintf.m4 @@ -1,6 +1,6 @@ # vasprintf.m4 # serial 6 -dnl Copyright (C) 2002-2003, 2006-2007, 2009-2025 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4 index c2cd38d0..55ceb672 100644 --- a/gl/m4/visibility.m4 +++ b/gl/m4/visibility.m4 @@ -1,6 +1,6 @@ # visibility.m4 # serial 9 -dnl Copyright (C) 2005, 2008, 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4 index 68ab757d..df767486 100644 --- a/gl/m4/vsnprintf.m4 +++ b/gl/m4/vsnprintf.m4 @@ -1,6 +1,6 @@ # vsnprintf.m4 # serial 7 -dnl Copyright (C) 2002-2004, 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4 index 73cf16fb..3765368c 100644 --- a/gl/m4/warn-on-use.m4 +++ b/gl/m4/warn-on-use.m4 @@ -1,6 +1,6 @@ # warn-on-use.m4 # serial 11 -dnl Copyright (C) 2010-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4 index 722fcfc2..42338a00 100644 --- a/gl/m4/wchar_h.m4 +++ b/gl/m4/wchar_h.m4 @@ -1,6 +1,6 @@ # wchar_h.m4 -# serial 65 -dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. +# serial 66 +dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -65,8 +65,8 @@ dnl Check whether is usable at all. AC_DEFUN([gl_WCHAR_H_INLINE_OK], [ dnl Test whether suffers due to the transition from '__inline' to - dnl 'gnu_inline'. See - dnl and . In summary, + dnl 'gnu_inline'. See + dnl and . In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken . AC_REQUIRE([AC_CANONICAL_HOST]) @@ -239,7 +239,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) - HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + HAVE_WCTOB=1; AC_SUBST([HAVE_WCTOB]) HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4 index 91530176..a69f17c4 100644 --- a/gl/m4/wcrtomb.m4 +++ b/gl/m4/wcrtomb.m4 @@ -1,6 +1,6 @@ # wcrtomb.m4 -# serial 21 -dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. +# serial 22 +dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -33,7 +33,7 @@ AC_DEFUN([gl_FUNC_WCRTOMB], dnl fi if test $REPLACE_WCRTOMB = 0; then dnl On Android 4.3, wcrtomb produces wrong characters in the C locale. - dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL) + dnl On AIX 4.3 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL) dnl sometimes returns 0 instead of 1. AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR]) @@ -83,8 +83,8 @@ int main () dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on AIX 4, OSF/1, Solaris, native Windows. - aix4* | osf* | solaris* | mingw* | windows*) + # Guess no on AIX 4, Solaris, native Windows. + aix4* | solaris* | mingw* | windows*) gl_cv_func_wcrtomb_retval="guessing no" ;; # Guess yes otherwise. *) diff --git a/gl/m4/wctype.m4 b/gl/m4/wctype.m4 index 56593cd5..6a6cb3a4 100644 --- a/gl/m4/wctype.m4 +++ b/gl/m4/wctype.m4 @@ -1,6 +1,6 @@ # wctype.m4 # serial 6 -dnl Copyright (C) 2011-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4 index 8e54678d..12b4c618 100644 --- a/gl/m4/wctype_h.m4 +++ b/gl/m4/wctype_h.m4 @@ -3,7 +3,7 @@ dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/wcwidth.m4 b/gl/m4/wcwidth.m4 index 2cc6ebb1..515076ba 100644 --- a/gl/m4/wcwidth.m4 +++ b/gl/m4/wcwidth.m4 @@ -1,6 +1,6 @@ # wcwidth.m4 -# serial 38 -dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. +# serial 39 +dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -44,7 +44,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH], dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. dnl On macOS 12.5, NetBSD 9.3, OpenBSD 5.0, MidnightBSD 1.1, dnl wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. - dnl On macOS 12.5, NetBSD 9.3, MidnightBSD 1.1, OSF/1 5.1, + dnl On macOS 12.5, NetBSD 9.3, MidnightBSD 1.1, dnl wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0. dnl This leads to bugs in 'ls' (coreutils). diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4 index 8a3c7944..384462d2 100644 --- a/gl/m4/wint_t.m4 +++ b/gl/m4/wint_t.m4 @@ -1,6 +1,6 @@ # wint_t.m4 # serial 11 -dnl Copyright (C) 2003, 2007-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4 index c10c4189..a0d0f060 100644 --- a/gl/m4/xalloc.m4 +++ b/gl/m4/xalloc.m4 @@ -1,6 +1,6 @@ # xalloc.m4 # serial 18 -dnl Copyright (C) 2002-2006, 2009-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4 index 157d635c..4e35a5fe 100644 --- a/gl/m4/xsize.m4 +++ b/gl/m4/xsize.m4 @@ -1,6 +1,6 @@ # xsize.m4 # serial 5 -dnl Copyright (C) 2003-2004, 2008-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4 index 343bda5c..fed091ca 100644 --- a/gl/m4/zzgnulib.m4 +++ b/gl/m4/zzgnulib.m4 @@ -1,6 +1,6 @@ # zzgnulib.m4 # serial 1 -dnl Copyright (C) 2020-2025 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/malloc.c b/gl/malloc.c index 5642c83c..f7d11921 100644 --- a/gl/malloc.c +++ b/gl/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/malloc/dynarray-skeleton.c b/gl/malloc/dynarray-skeleton.c index 6b0585c1..9d83658e 100644 --- a/gl/malloc/dynarray-skeleton.c +++ b/gl/malloc/dynarray-skeleton.c @@ -1,5 +1,5 @@ /* Type-safe arrays which grow dynamically. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray.h b/gl/malloc/dynarray.h index 6cbbe50e..e6a998d3 100644 --- a/gl/malloc/dynarray.h +++ b/gl/malloc/dynarray.h @@ -1,5 +1,5 @@ /* Type-safe arrays which grow dynamically. Shared definitions. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray_at_failure.c b/gl/malloc/dynarray_at_failure.c index b94ac3df..c05807f0 100644 --- a/gl/malloc/dynarray_at_failure.c +++ b/gl/malloc/dynarray_at_failure.c @@ -1,5 +1,5 @@ /* Report an dynamic array index out of bounds condition. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray_emplace_enlarge.c b/gl/malloc/dynarray_emplace_enlarge.c index 53126863..d3bb0447 100644 --- a/gl/malloc/dynarray_emplace_enlarge.c +++ b/gl/malloc/dynarray_emplace_enlarge.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array in preparation of an emplace operation. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray_finalize.c b/gl/malloc/dynarray_finalize.c index 3178c687..b2e37837 100644 --- a/gl/malloc/dynarray_finalize.c +++ b/gl/malloc/dynarray_finalize.c @@ -1,5 +1,5 @@ /* Copy the dynamically-allocated area to an explicitly-sized heap allocation. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray_resize.c b/gl/malloc/dynarray_resize.c index 3cd1626a..d890b253 100644 --- a/gl/malloc/dynarray_resize.c +++ b/gl/malloc/dynarray_resize.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloc/dynarray_resize_clear.c b/gl/malloc/dynarray_resize_clear.c index 7bfc0005..34d01062 100644 --- a/gl/malloc/dynarray_resize_clear.c +++ b/gl/malloc/dynarray_resize_clear.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array and clear the new part. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/malloca.c b/gl/malloca.c index 4bce9a3d..943140c8 100644 --- a/gl/malloca.c +++ b/gl/malloca.c @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2003, 2018. This file is free software: you can redistribute it and/or modify diff --git a/gl/malloca.h b/gl/malloca.h index f131fd5a..1ebe6916 100644 --- a/gl/malloca.h +++ b/gl/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This file is free software: you can redistribute it and/or modify diff --git a/gl/math.c b/gl/math.c index febdf82a..8f0c9d78 100644 --- a/gl/math.c +++ b/gl/math.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/math.in.h b/gl/math.in.h index f4e80c53..14218ea0 100644 --- a/gl/math.in.h +++ b/gl/math.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2002-2003, 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -251,8 +251,8 @@ _NaN () #if !(defined FP_ILOGB0 && defined FP_ILOGBNAN) /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */ -# if defined __NetBSD__ || defined __sgi - /* NetBSD, IRIX 6.5: match what ilogb() does */ +# if defined __NetBSD__ + /* NetBSD: match what ilogb() does */ # define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */ # define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */ # elif defined _AIX @@ -288,7 +288,6 @@ _GL_CXXALIAS_SYS (acosf, float, (float x)); # endif _GL_CXXALIASWARN (acosf); #elif defined GNULIB_POSIXCHECK -# undef acosf # if HAVE_RAW_DECL_ACOSF _GL_WARN_ON_USE (acosf, "acosf is unportable - " "use gnulib module acosf for portability"); @@ -305,7 +304,6 @@ _GL_CXXALIAS_SYS (acosl, long double, (long double x)); _GL_CXXALIASWARN (acosl); # endif #elif defined GNULIB_POSIXCHECK -# undef acosl # if HAVE_RAW_DECL_ACOSL _GL_WARN_ON_USE (acosl, "acosl is unportable - " "use gnulib module acosl for portability"); @@ -330,7 +328,6 @@ _GL_CXXALIAS_SYS (asinf, float, (float x)); # endif _GL_CXXALIASWARN (asinf); #elif defined GNULIB_POSIXCHECK -# undef asinf # if HAVE_RAW_DECL_ASINF _GL_WARN_ON_USE (asinf, "asinf is unportable - " "use gnulib module asinf for portability"); @@ -347,7 +344,6 @@ _GL_CXXALIAS_SYS (asinl, long double, (long double x)); _GL_CXXALIASWARN (asinl); # endif #elif defined GNULIB_POSIXCHECK -# undef asinl # if HAVE_RAW_DECL_ASINL _GL_WARN_ON_USE (asinl, "asinl is unportable - " "use gnulib module asinl for portability"); @@ -372,7 +368,6 @@ _GL_CXXALIAS_SYS (atanf, float, (float x)); # endif _GL_CXXALIASWARN (atanf); #elif defined GNULIB_POSIXCHECK -# undef atanf # if HAVE_RAW_DECL_ATANF _GL_WARN_ON_USE (atanf, "atanf is unportable - " "use gnulib module atanf for portability"); @@ -389,7 +384,6 @@ _GL_CXXALIAS_SYS (atanl, long double, (long double x)); _GL_CXXALIASWARN (atanl); # endif #elif defined GNULIB_POSIXCHECK -# undef atanl # if HAVE_RAW_DECL_ATANL _GL_WARN_ON_USE (atanl, "atanl is unportable - " "use gnulib module atanl for portability"); @@ -414,7 +408,6 @@ _GL_CXXALIAS_SYS (atan2f, float, (float y, float x)); # endif _GL_CXXALIASWARN (atan2f); #elif defined GNULIB_POSIXCHECK -# undef atan2f # if HAVE_RAW_DECL_ATAN2F _GL_WARN_ON_USE (atan2f, "atan2f is unportable - " "use gnulib module atan2f for portability"); @@ -431,14 +424,13 @@ _GL_WARN_ON_USE (atan2f, "atan2f is unportable - " _GL_FUNCDECL_RPL (cbrtf, float, (float x), ); _GL_CXXALIAS_RPL (cbrtf, float, (float x)); # else -# if !@HAVE_DECL_CBRTF@ +# if !@HAVE_CBRTF@ _GL_FUNCDECL_SYS (cbrtf, float, (float x), ); # endif _GL_CXXALIAS_SYS (cbrtf, float, (float x)); # endif _GL_CXXALIASWARN (cbrtf); #elif defined GNULIB_POSIXCHECK -# undef cbrtf # if HAVE_RAW_DECL_CBRTF _GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - " "use gnulib module cbrtf for portability"); @@ -454,7 +446,6 @@ _GL_CXXALIAS_SYS (cbrt, double, (double x)); _GL_CXXALIASWARN1 (cbrt, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef cbrt # if HAVE_RAW_DECL_CBRT _GL_WARN_ON_USE (cbrt, "cbrt is unportable - " "use gnulib module cbrt for portability"); @@ -470,7 +461,7 @@ _GL_WARN_ON_USE (cbrt, "cbrt is unportable - " _GL_FUNCDECL_RPL (cbrtl, long double, (long double x), ); _GL_CXXALIAS_RPL (cbrtl, long double, (long double x)); # else -# if !@HAVE_DECL_CBRTL@ +# if !@HAVE_CBRTL@ _GL_FUNCDECL_SYS (cbrtl, long double, (long double x), ); # endif _GL_CXXALIAS_SYS (cbrtl, long double, (long double x)); @@ -479,7 +470,6 @@ _GL_CXXALIAS_SYS (cbrtl, long double, (long double x)); _GL_CXXALIASWARN (cbrtl); # endif #elif defined GNULIB_POSIXCHECK -# undef cbrtl # if HAVE_RAW_DECL_CBRTL _GL_WARN_ON_USE (cbrtl, "cbrtl is unportable - " "use gnulib module cbrtl for portability"); @@ -504,7 +494,6 @@ _GL_CXXALIAS_SYS (ceilf, float, (float x)); # endif _GL_CXXALIASWARN (ceilf); #elif defined GNULIB_POSIXCHECK -# undef ceilf # if HAVE_RAW_DECL_CEILF _GL_WARN_ON_USE (ceilf, "ceilf is unportable - " "use gnulib module ceilf for portability"); @@ -546,7 +535,6 @@ _GL_CXXALIAS_SYS (ceill, long double, (long double x)); _GL_CXXALIASWARN (ceill); # endif #elif defined GNULIB_POSIXCHECK -# undef ceill # if HAVE_RAW_DECL_CEILL _GL_WARN_ON_USE (ceill, "ceill is unportable - " "use gnulib module ceill for portability"); @@ -555,14 +543,13 @@ _GL_WARN_ON_USE (ceill, "ceill is unportable - " #if @GNULIB_COPYSIGNF@ -# if !@HAVE_DECL_COPYSIGNF@ +# if !@HAVE_COPYSIGNF@ # undef copysignf _GL_FUNCDECL_SYS (copysignf, float, (float x, float y), ); # endif _GL_CXXALIAS_SYS (copysignf, float, (float x, float y)); _GL_CXXALIASWARN (copysignf); #elif defined GNULIB_POSIXCHECK -# undef copysignf # if HAVE_RAW_DECL_COPYSIGNF _GL_WARN_ON_USE (copysignf, "copysignf is unportable - " "use gnulib module copysignf for portability"); @@ -578,7 +565,6 @@ _GL_CXXALIAS_SYS (copysign, double, (double x, double y)); _GL_CXXALIASWARN1 (copysign, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK -# undef copysign # if HAVE_RAW_DECL_COPYSIGN _GL_WARN_ON_USE (copysign, "copysign is unportable - " "use gnulib module copysign for portability"); @@ -594,7 +580,6 @@ _GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y)); _GL_CXXALIASWARN (copysignl); # endif #elif defined GNULIB_POSIXCHECK -# undef copysignl # if HAVE_RAW_DECL_COPYSIGNL _GL_WARN_ON_USE (copysign, "copysignl is unportable - " "use gnulib module copysignl for portability"); @@ -619,7 +604,6 @@ _GL_CXXALIAS_SYS (cosf, float, (float x)); # endif _GL_CXXALIASWARN (cosf); #elif defined GNULIB_POSIXCHECK -# undef cosf # if HAVE_RAW_DECL_COSF _GL_WARN_ON_USE (cosf, "cosf is unportable - " "use gnulib module cosf for portability"); @@ -636,7 +620,6 @@ _GL_CXXALIAS_SYS (cosl, long double, (long double x)); _GL_CXXALIASWARN (cosl); # endif #elif defined GNULIB_POSIXCHECK -# undef cosl # if HAVE_RAW_DECL_COSL _GL_WARN_ON_USE (cosl, "cosl is unportable - " "use gnulib module cosl for portability"); @@ -661,7 +644,6 @@ _GL_CXXALIAS_SYS (coshf, float, (float x)); # endif _GL_CXXALIASWARN (coshf); #elif defined GNULIB_POSIXCHECK -# undef coshf # if HAVE_RAW_DECL_COSHF _GL_WARN_ON_USE (coshf, "coshf is unportable - " "use gnulib module coshf for portability"); @@ -686,7 +668,6 @@ _GL_CXXALIAS_SYS (expf, float, (float x)); # endif _GL_CXXALIASWARN (expf); #elif defined GNULIB_POSIXCHECK -# undef expf # if HAVE_RAW_DECL_EXPF _GL_WARN_ON_USE (expf, "expf is unportable - " "use gnulib module expf for portability"); @@ -712,7 +693,6 @@ _GL_CXXALIAS_SYS (expl, long double, (long double x)); _GL_CXXALIASWARN (expl); # endif #elif defined GNULIB_POSIXCHECK -# undef expl # if HAVE_RAW_DECL_EXPL _GL_WARN_ON_USE (expl, "expl is unportable - " "use gnulib module expl for portability"); @@ -721,13 +701,12 @@ _GL_WARN_ON_USE (expl, "expl is unportable - " #if @GNULIB_EXP2F@ -# if !@HAVE_DECL_EXP2F@ +# if !@HAVE_EXP2F@ _GL_FUNCDECL_SYS (exp2f, float, (float x), ); # endif _GL_CXXALIAS_SYS (exp2f, float, (float x)); _GL_CXXALIASWARN (exp2f); #elif defined GNULIB_POSIXCHECK -# undef exp2f # if HAVE_RAW_DECL_EXP2F _GL_WARN_ON_USE (exp2f, "exp2f is unportable - " "use gnulib module exp2f for portability"); @@ -743,7 +722,7 @@ _GL_WARN_ON_USE (exp2f, "exp2f is unportable - " _GL_FUNCDECL_RPL (exp2, double, (double x), ); _GL_CXXALIAS_RPL (exp2, double, (double x)); # else -# if !@HAVE_DECL_EXP2@ +# if !@HAVE_EXP2@ _GL_FUNCDECL_SYS (exp2, double, (double x), ); # endif _GL_CXXALIAS_SYS (exp2, double, (double x)); @@ -752,7 +731,6 @@ _GL_CXXALIAS_SYS (exp2, double, (double x)); _GL_CXXALIASWARN1 (exp2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef exp2 # if HAVE_RAW_DECL_EXP2 _GL_WARN_ON_USE (exp2, "exp2 is unportable - " "use gnulib module exp2 for portability"); @@ -768,7 +746,7 @@ _GL_WARN_ON_USE (exp2, "exp2 is unportable - " _GL_FUNCDECL_RPL (exp2l, long double, (long double x), ); _GL_CXXALIAS_RPL (exp2l, long double, (long double x)); # else -# if !@HAVE_DECL_EXP2L@ +# if !@HAVE_EXP2L@ # undef exp2l _GL_FUNCDECL_SYS (exp2l, long double, (long double x), ); # endif @@ -778,7 +756,6 @@ _GL_CXXALIAS_SYS (exp2l, long double, (long double x)); _GL_CXXALIASWARN (exp2l); # endif #elif defined GNULIB_POSIXCHECK -# undef exp2l # if HAVE_RAW_DECL_EXP2L _GL_WARN_ON_USE (exp2l, "exp2l is unportable - " "use gnulib module exp2l for portability"); @@ -802,7 +779,6 @@ _GL_CXXALIAS_SYS (expm1f, float, (float x)); # endif _GL_CXXALIASWARN (expm1f); #elif defined GNULIB_POSIXCHECK -# undef expm1f # if HAVE_RAW_DECL_EXPM1F _GL_WARN_ON_USE (expm1f, "expm1f is unportable - " "use gnulib module expm1f for portability"); @@ -827,7 +803,6 @@ _GL_CXXALIAS_SYS (expm1, double, (double x)); _GL_CXXALIASWARN1 (expm1, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef expm1 # if HAVE_RAW_DECL_EXPM1 _GL_WARN_ON_USE (expm1, "expm1 is unportable - " "use gnulib module expm1 for portability"); @@ -843,7 +818,7 @@ _GL_WARN_ON_USE (expm1, "expm1 is unportable - " _GL_FUNCDECL_RPL (expm1l, long double, (long double x), ); _GL_CXXALIAS_RPL (expm1l, long double, (long double x)); # else -# if !@HAVE_DECL_EXPM1L@ +# if !@HAVE_EXPM1L@ # undef expm1l # if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (expm1l, long double, (long double x), ); @@ -855,7 +830,6 @@ _GL_CXXALIAS_SYS (expm1l, long double, (long double x)); _GL_CXXALIASWARN (expm1l); # endif #elif defined GNULIB_POSIXCHECK -# undef expm1l # if HAVE_RAW_DECL_EXPM1L _GL_WARN_ON_USE (expm1l, "expm1l is unportable - " "use gnulib module expm1l for portability"); @@ -873,7 +847,6 @@ _GL_CXXALIAS_SYS (fabsf, float, (float x)); _GL_CXXALIASWARN (fabsf); # endif #elif defined GNULIB_POSIXCHECK -# undef fabsf # if HAVE_RAW_DECL_FABSF _GL_WARN_ON_USE (fabsf, "fabsf is unportable - " "use gnulib module fabsf for portability"); @@ -899,7 +872,6 @@ _GL_CXXALIAS_SYS (fabsl, long double, (long double x)); _GL_CXXALIASWARN (fabsl); # endif #elif defined GNULIB_POSIXCHECK -# undef fabsl # if HAVE_RAW_DECL_FABSL _GL_WARN_ON_USE (fabsl, "fabsl is unportable - " "use gnulib module fabsl for portability"); @@ -924,7 +896,6 @@ _GL_CXXALIAS_SYS (floorf, float, (float x)); # endif _GL_CXXALIASWARN (floorf); #elif defined GNULIB_POSIXCHECK -# undef floorf # if HAVE_RAW_DECL_FLOORF _GL_WARN_ON_USE (floorf, "floorf is unportable - " "use gnulib module floorf for portability"); @@ -966,7 +937,6 @@ _GL_CXXALIAS_SYS (floorl, long double, (long double x)); _GL_CXXALIASWARN (floorl); # endif #elif defined GNULIB_POSIXCHECK -# undef floorl # if HAVE_RAW_DECL_FLOORL _GL_WARN_ON_USE (floorl, "floorl is unportable - " "use gnulib module floorl for portability"); @@ -991,7 +961,6 @@ _GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z)); # endif _GL_CXXALIASWARN (fmaf); #elif defined GNULIB_POSIXCHECK -# undef fmaf # if HAVE_RAW_DECL_FMAF _GL_WARN_ON_USE (fmaf, "fmaf is unportable - " "use gnulib module fmaf for portability"); @@ -1017,7 +986,6 @@ _GL_CXXALIAS_SYS (fma, double, (double x, double y, double z)); _GL_CXXALIASWARN1 (fma, double, (double x, double y, double z)); # endif #elif defined GNULIB_POSIXCHECK -# undef fma # if HAVE_RAW_DECL_FMA _GL_WARN_ON_USE (fma, "fma is unportable - " "use gnulib module fma for portability"); @@ -1049,7 +1017,6 @@ _GL_CXXALIAS_SYS (fmal, long double, _GL_CXXALIASWARN (fmal); # endif #elif defined GNULIB_POSIXCHECK -# undef fmal # if HAVE_RAW_DECL_FMAL _GL_WARN_ON_USE (fmal, "fmal is unportable - " "use gnulib module fmal for portability"); @@ -1074,7 +1041,6 @@ _GL_CXXALIAS_SYS (fmodf, float, (float x, float y)); # endif _GL_CXXALIASWARN (fmodf); #elif defined GNULIB_POSIXCHECK -# undef fmodf # if HAVE_RAW_DECL_FMODF _GL_WARN_ON_USE (fmodf, "fmodf is unportable - " "use gnulib module fmodf for portability"); @@ -1096,7 +1062,6 @@ _GL_CXXALIAS_SYS (fmod, double, (double x, double y)); _GL_CXXALIASWARN1 (fmod, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK -# undef fmod # if HAVE_RAW_DECL_FMOD _GL_WARN_ON_USE (fmod, "fmod has portability problems - " "use gnulib module fmod for portability"); @@ -1122,7 +1087,6 @@ _GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y)); _GL_CXXALIASWARN (fmodl); # endif #elif defined GNULIB_POSIXCHECK -# undef fmodl # if HAVE_RAW_DECL_FMODL _GL_WARN_ON_USE (fmodl, "fmodl is unportable - " "use gnulib module fmodl for portability"); @@ -1156,7 +1120,6 @@ _GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr)); _GL_CXXALIASWARN (frexpf); # endif #elif defined GNULIB_POSIXCHECK -# undef frexpf # if HAVE_RAW_DECL_FREXPF _GL_WARN_ON_USE (frexpf, "frexpf is unportable - " "use gnulib module frexpf for portability"); @@ -1224,7 +1187,6 @@ _GL_CXXALIASWARN (frexpl); # endif #endif #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK -# undef frexpl # if HAVE_RAW_DECL_FREXPL _GL_WARN_ON_USE (frexpl, "frexpl is unportable - " "use gnulib module frexpl for portability"); @@ -1251,7 +1213,6 @@ _GL_CXXALIAS_SYS (hypotf, float, (float x, float y)); _GL_CXXALIASWARN (hypotf); # endif #elif defined GNULIB_POSIXCHECK -# undef hypotf # if HAVE_RAW_DECL_HYPOTF _GL_WARN_ON_USE (hypotf, "hypotf is unportable - " "use gnulib module hypotf for portability"); @@ -1274,7 +1235,6 @@ _GL_CXXALIAS_SYS (hypot, double, (double x, double y)); _GL_CXXALIASWARN1 (hypot, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK -# undef hypot # if HAVE_RAW_DECL_HYPOT _GL_WARN_ON_USE (hypotf, "hypot has portability problems - " "use gnulib module hypot for portability"); @@ -1300,7 +1260,6 @@ _GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y)); _GL_CXXALIASWARN (hypotl); # endif #elif defined GNULIB_POSIXCHECK -# undef hypotl # if HAVE_RAW_DECL_HYPOTL _GL_WARN_ON_USE (hypotl, "hypotl is unportable - " "use gnulib module hypotl for portability"); @@ -1324,7 +1283,6 @@ _GL_CXXALIAS_SYS (ilogbf, int, (float x)); # endif _GL_CXXALIASWARN (ilogbf); #elif defined GNULIB_POSIXCHECK -# undef ilogbf # if HAVE_RAW_DECL_ILOGBF _GL_WARN_ON_USE (ilogbf, "ilogbf is unportable - " "use gnulib module ilogbf for portability"); @@ -1349,7 +1307,6 @@ _GL_CXXALIAS_SYS (ilogb, int, (double x)); _GL_CXXALIASWARN1 (ilogb, int, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef ilogb # if HAVE_RAW_DECL_ILOGB _GL_WARN_ON_USE (ilogb, "ilogb is unportable - " "use gnulib module ilogb for portability"); @@ -1375,7 +1332,6 @@ _GL_CXXALIAS_SYS (ilogbl, int, (long double x)); _GL_CXXALIASWARN (ilogbl); # endif #elif defined GNULIB_POSIXCHECK -# undef ilogbl # if HAVE_RAW_DECL_ILOGBL _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - " "use gnulib module ilogbl for portability"); @@ -1443,7 +1399,6 @@ _GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp)); _GL_CXXALIASWARN (ldexpf); # endif #elif defined GNULIB_POSIXCHECK -# undef ldexpf # if HAVE_RAW_DECL_LDEXPF _GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - " "use gnulib module ldexpf for portability"); @@ -1497,7 +1452,6 @@ _GL_CXXALIASWARN (ldexpl); # endif #endif #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK -# undef ldexpl # if HAVE_RAW_DECL_LDEXPL _GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - " "use gnulib module ldexpl for portability"); @@ -1522,7 +1476,6 @@ _GL_CXXALIAS_SYS (logf, float, (float x)); # endif _GL_CXXALIASWARN (logf); #elif defined GNULIB_POSIXCHECK -# undef logf # if HAVE_RAW_DECL_LOGF _GL_WARN_ON_USE (logf, "logf is unportable - " "use gnulib module logf for portability"); @@ -1544,7 +1497,6 @@ _GL_CXXALIAS_SYS (log, double, (double x)); _GL_CXXALIASWARN1 (log, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef log # if HAVE_RAW_DECL_LOG _GL_WARN_ON_USE (log, "log has portability problems - " "use gnulib module log for portability"); @@ -1570,7 +1522,6 @@ _GL_CXXALIAS_SYS (logl, long double, (long double x)); _GL_CXXALIASWARN (logl); # endif #elif defined GNULIB_POSIXCHECK -# undef logl # if HAVE_RAW_DECL_LOGL _GL_WARN_ON_USE (logl, "logl is unportable - " "use gnulib module logl for portability"); @@ -1595,7 +1546,6 @@ _GL_CXXALIAS_SYS (log10f, float, (float x)); # endif _GL_CXXALIASWARN (log10f); #elif defined GNULIB_POSIXCHECK -# undef log10f # if HAVE_RAW_DECL_LOG10F _GL_WARN_ON_USE (log10f, "log10f is unportable - " "use gnulib module log10f for portability"); @@ -1617,7 +1567,6 @@ _GL_CXXALIAS_SYS (log10, double, (double x)); _GL_CXXALIASWARN1 (log10, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef log10 # if HAVE_RAW_DECL_LOG10 _GL_WARN_ON_USE (log10, "log10 has portability problems - " "use gnulib module log10 for portability"); @@ -1643,7 +1592,6 @@ _GL_CXXALIAS_SYS (log10l, long double, (long double x)); _GL_CXXALIASWARN (log10l); # endif #elif defined GNULIB_POSIXCHECK -# undef log10l # if HAVE_RAW_DECL_LOG10L _GL_WARN_ON_USE (log10l, "log10l is unportable - " "use gnulib module log10l for portability"); @@ -1667,7 +1615,6 @@ _GL_CXXALIAS_SYS (log1pf, float, (float x)); # endif _GL_CXXALIASWARN (log1pf); #elif defined GNULIB_POSIXCHECK -# undef log1pf # if HAVE_RAW_DECL_LOG1PF _GL_WARN_ON_USE (log1pf, "log1pf is unportable - " "use gnulib module log1pf for portability"); @@ -1692,7 +1639,6 @@ _GL_CXXALIAS_SYS (log1p, double, (double x)); _GL_CXXALIASWARN1 (log1p, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef log1p # if HAVE_RAW_DECL_LOG1P _GL_WARN_ON_USE (log1p, "log1p has portability problems - " "use gnulib module log1p for portability"); @@ -1717,7 +1663,6 @@ _GL_CXXALIAS_SYS (log1pl, long double, (long double x)); _GL_CXXALIASWARN (log1pl); # endif #elif defined GNULIB_POSIXCHECK -# undef log1pl # if HAVE_RAW_DECL_LOG1PL _GL_WARN_ON_USE (log1pl, "log1pl has portability problems - " "use gnulib module log1pl for portability"); @@ -1734,7 +1679,7 @@ _GL_WARN_ON_USE (log1pl, "log1pl has portability problems - " _GL_FUNCDECL_RPL (log2f, float, (float x), ); _GL_CXXALIAS_RPL (log2f, float, (float x)); # else -# if !@HAVE_DECL_LOG2F@ +# if !@HAVE_LOG2F@ # undef log2f _GL_FUNCDECL_SYS (log2f, float, (float x), ); # endif @@ -1744,7 +1689,6 @@ _GL_CXXALIAS_SYS (log2f, float, (float x)); _GL_CXXALIASWARN (log2f); # endif #elif defined GNULIB_POSIXCHECK -# undef log2f # if HAVE_RAW_DECL_LOG2F _GL_WARN_ON_USE (log2f, "log2f is unportable - " "use gnulib module log2f for portability"); @@ -1760,7 +1704,7 @@ _GL_WARN_ON_USE (log2f, "log2f is unportable - " _GL_FUNCDECL_RPL (log2, double, (double x), ); _GL_CXXALIAS_RPL (log2, double, (double x)); # else -# if !@HAVE_DECL_LOG2@ +# if !@HAVE_LOG2@ # undef log2 _GL_FUNCDECL_SYS (log2, double, (double x), ); # endif @@ -1770,7 +1714,6 @@ _GL_CXXALIAS_SYS (log2, double, (double x)); _GL_CXXALIASWARN1 (log2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef log2 # if HAVE_RAW_DECL_LOG2 _GL_WARN_ON_USE (log2, "log2 is unportable - " "use gnulib module log2 for portability"); @@ -1786,7 +1729,7 @@ _GL_WARN_ON_USE (log2, "log2 is unportable - " _GL_FUNCDECL_RPL (log2l, long double, (long double x), ); _GL_CXXALIAS_RPL (log2l, long double, (long double x)); # else -# if !@HAVE_DECL_LOG2L@ +# if !@HAVE_LOG2L@ _GL_FUNCDECL_SYS (log2l, long double, (long double x), ); # endif _GL_CXXALIAS_SYS (log2l, long double, (long double x)); @@ -1795,7 +1738,6 @@ _GL_CXXALIAS_SYS (log2l, long double, (long double x)); _GL_CXXALIASWARN (log2l); # endif #elif defined GNULIB_POSIXCHECK -# undef log2l # if HAVE_RAW_DECL_LOG2L _GL_WARN_ON_USE (log2l, "log2l is unportable - " "use gnulib module log2l for portability"); @@ -1819,7 +1761,6 @@ _GL_CXXALIAS_SYS (logbf, float, (float x)); # endif _GL_CXXALIASWARN (logbf); #elif defined GNULIB_POSIXCHECK -# undef logbf # if HAVE_RAW_DECL_LOGBF _GL_WARN_ON_USE (logbf, "logbf is unportable - " "use gnulib module logbf for portability"); @@ -1844,7 +1785,6 @@ _GL_CXXALIAS_SYS (logb, double, (double x)); _GL_CXXALIASWARN1 (logb, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef logb # if HAVE_RAW_DECL_LOGB _GL_WARN_ON_USE (logb, "logb is unportable - " "use gnulib module logb for portability"); @@ -1869,7 +1809,6 @@ _GL_CXXALIAS_SYS (logbl, long double, (long double x)); _GL_CXXALIASWARN (logbl); # endif #elif defined GNULIB_POSIXCHECK -# undef logbl # if HAVE_RAW_DECL_LOGBL _GL_WARN_ON_USE (logbl, "logbl is unportable - " "use gnulib module logbl for portability"); @@ -1886,7 +1825,6 @@ _GL_CXXALIAS_SYS (logp1f, float, (float x)); _GL_CXXALIASWARN1 (logp1f, float, (float x)); # endif #elif defined GNULIB_POSIXCHECK -# undef logp1f # if HAVE_RAW_DECL_LOGP1F _GL_WARN_ON_USE (logp1f, "logp1f is unportable - " "use gnulib module logp1f for portability"); @@ -1902,7 +1840,6 @@ _GL_CXXALIAS_SYS (logp1, double, (double x)); _GL_CXXALIASWARN1 (logp1, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef logp1 # if HAVE_RAW_DECL_LOGP1 _GL_WARN_ON_USE (logp1, "logp1 is unportable - " "use gnulib module logp1 for portability"); @@ -1918,7 +1855,6 @@ _GL_CXXALIAS_SYS (logp1l, long double, (long double x)); _GL_CXXALIASWARN1 (logp1l, long double, (long double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef logp1l # if HAVE_RAW_DECL_LOGP1L _GL_WARN_ON_USE (logp1l, "logp1l is unportable - " "use gnulib module logp1l for portability"); @@ -1943,7 +1879,6 @@ _GL_CXXALIAS_SYS (modff, float, (float x, float *iptr)); # endif _GL_CXXALIASWARN (modff); #elif defined GNULIB_POSIXCHECK -# undef modff # if HAVE_RAW_DECL_MODFF _GL_WARN_ON_USE (modff, "modff is unportable - " "use gnulib module modff for portability"); @@ -1966,7 +1901,6 @@ _GL_CXXALIAS_SYS (modf, double, (double x, double *iptr)); _GL_CXXALIASWARN1 (modf, double, (double x, double *iptr)); # endif #elif defined GNULIB_POSIXCHECK -# undef modf # if HAVE_RAW_DECL_MODF _GL_WARN_ON_USE (modf, "modf has portability problems - " "use gnulib module modf for portability"); @@ -1994,7 +1928,6 @@ _GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr)); _GL_CXXALIASWARN (modfl); # endif #elif defined GNULIB_POSIXCHECK -# undef modfl # if HAVE_RAW_DECL_MODFL _GL_WARN_ON_USE (modfl, "modfl is unportable - " "use gnulib module modfl for portability"); @@ -2010,7 +1943,6 @@ _GL_FUNCDECL_SYS (powf, float, (float x, float y), ); _GL_CXXALIAS_SYS (powf, float, (float x, float y)); _GL_CXXALIASWARN (powf); #elif defined GNULIB_POSIXCHECK -# undef powf # if HAVE_RAW_DECL_POWF _GL_WARN_ON_USE (powf, "powf is unportable - " "use gnulib module powf for portability"); @@ -2034,7 +1966,6 @@ _GL_CXXALIAS_SYS (remainderf, float, (float x, float y)); # endif _GL_CXXALIASWARN (remainderf); #elif defined GNULIB_POSIXCHECK -# undef remainderf # if HAVE_RAW_DECL_REMAINDERF _GL_WARN_ON_USE (remainderf, "remainderf is unportable - " "use gnulib module remainderf for portability"); @@ -2050,7 +1981,7 @@ _GL_WARN_ON_USE (remainderf, "remainderf is unportable - " _GL_FUNCDECL_RPL (remainder, double, (double x, double y), ); _GL_CXXALIAS_RPL (remainder, double, (double x, double y)); # else -# if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@ +# if !@HAVE_REMAINDER@ _GL_FUNCDECL_SYS (remainder, double, (double x, double y), ); # endif _GL_CXXALIAS_SYS (remainder, double, (double x, double y)); @@ -2059,7 +1990,6 @@ _GL_CXXALIAS_SYS (remainder, double, (double x, double y)); _GL_CXXALIASWARN1 (remainder, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK -# undef remainder # if HAVE_RAW_DECL_REMAINDER _GL_WARN_ON_USE (remainder, "remainder is unportable - " "use gnulib module remainder for portability"); @@ -2075,7 +2005,7 @@ _GL_WARN_ON_USE (remainder, "remainder is unportable - " _GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y), ); _GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y)); # else -# if !@HAVE_DECL_REMAINDERL@ +# if !@HAVE_REMAINDERL@ # undef remainderl # if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y), ); @@ -2087,7 +2017,6 @@ _GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y)); _GL_CXXALIASWARN (remainderl); # endif #elif defined GNULIB_POSIXCHECK -# undef remainderl # if HAVE_RAW_DECL_REMAINDERL _GL_WARN_ON_USE (remainderl, "remainderl is unportable - " "use gnulib module remainderl for portability"); @@ -2096,13 +2025,12 @@ _GL_WARN_ON_USE (remainderl, "remainderl is unportable - " #if @GNULIB_RINTF@ -# if !@HAVE_DECL_RINTF@ +# if !@HAVE_RINTF@ _GL_FUNCDECL_SYS (rintf, float, (float x), ); # endif _GL_CXXALIAS_SYS (rintf, float, (float x)); _GL_CXXALIASWARN (rintf); #elif defined GNULIB_POSIXCHECK -# undef rintf # if HAVE_RAW_DECL_RINTF _GL_WARN_ON_USE (rintf, "rintf is unportable - " "use gnulib module rintf for portability"); @@ -2118,7 +2046,6 @@ _GL_CXXALIAS_SYS (rint, double, (double x)); _GL_CXXALIASWARN1 (rint, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef rint # if HAVE_RAW_DECL_RINT _GL_WARN_ON_USE (rint, "rint is unportable - " "use gnulib module rint for portability"); @@ -2143,7 +2070,6 @@ _GL_CXXALIAS_SYS (rintl, long double, (long double x)); _GL_CXXALIASWARN (rintl); # endif #elif defined GNULIB_POSIXCHECK -# undef rintl # if HAVE_RAW_DECL_RINTL _GL_WARN_ON_USE (rintl, "rintl is unportable - " "use gnulib module rintl for portability"); @@ -2160,14 +2086,13 @@ _GL_WARN_ON_USE (rintl, "rintl is unportable - " _GL_FUNCDECL_RPL (roundf, float, (float x), ); _GL_CXXALIAS_RPL (roundf, float, (float x)); # else -# if !@HAVE_DECL_ROUNDF@ +# if !@HAVE_ROUNDF@ _GL_FUNCDECL_SYS (roundf, float, (float x), ); # endif _GL_CXXALIAS_SYS (roundf, float, (float x)); # endif _GL_CXXALIASWARN (roundf); #elif defined GNULIB_POSIXCHECK -# undef roundf # if HAVE_RAW_DECL_ROUNDF _GL_WARN_ON_USE (roundf, "roundf is unportable - " "use gnulib module roundf for portability"); @@ -2183,7 +2108,7 @@ _GL_WARN_ON_USE (roundf, "roundf is unportable - " _GL_FUNCDECL_RPL (round, double, (double x), ); _GL_CXXALIAS_RPL (round, double, (double x)); # else -# if !@HAVE_DECL_ROUND@ +# if !@HAVE_ROUND@ _GL_FUNCDECL_SYS (round, double, (double x), ); # endif _GL_CXXALIAS_SYS (round, double, (double x)); @@ -2192,7 +2117,6 @@ _GL_CXXALIAS_SYS (round, double, (double x)); _GL_CXXALIASWARN1 (round, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef round # if HAVE_RAW_DECL_ROUND _GL_WARN_ON_USE (round, "round is unportable - " "use gnulib module round for portability"); @@ -2208,7 +2132,7 @@ _GL_WARN_ON_USE (round, "round is unportable - " _GL_FUNCDECL_RPL (roundl, long double, (long double x), ); _GL_CXXALIAS_RPL (roundl, long double, (long double x)); # else -# if !@HAVE_DECL_ROUNDL@ +# if !@HAVE_ROUNDL@ # undef roundl # if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (roundl, long double, (long double x), ); @@ -2220,7 +2144,6 @@ _GL_CXXALIAS_SYS (roundl, long double, (long double x)); _GL_CXXALIASWARN (roundl); # endif #elif defined GNULIB_POSIXCHECK -# undef roundl # if HAVE_RAW_DECL_ROUNDL _GL_WARN_ON_USE (roundl, "roundl is unportable - " "use gnulib module roundl for portability"); @@ -2245,7 +2168,6 @@ _GL_CXXALIAS_SYS (sinf, float, (float x)); # endif _GL_CXXALIASWARN (sinf); #elif defined GNULIB_POSIXCHECK -# undef sinf # if HAVE_RAW_DECL_SINF _GL_WARN_ON_USE (sinf, "sinf is unportable - " "use gnulib module sinf for portability"); @@ -2271,7 +2193,6 @@ _GL_CXXALIAS_SYS (sinl, long double, (long double x)); _GL_CXXALIASWARN (sinl); # endif #elif defined GNULIB_POSIXCHECK -# undef sinl # if HAVE_RAW_DECL_SINL _GL_WARN_ON_USE (sinl, "sinl is unportable - " "use gnulib module sinl for portability"); @@ -2296,7 +2217,6 @@ _GL_CXXALIAS_SYS (sinhf, float, (float x)); # endif _GL_CXXALIASWARN (sinhf); #elif defined GNULIB_POSIXCHECK -# undef sinhf # if HAVE_RAW_DECL_SINHF _GL_WARN_ON_USE (sinhf, "sinhf is unportable - " "use gnulib module sinhf for portability"); @@ -2321,7 +2241,6 @@ _GL_CXXALIAS_SYS (sqrtf, float, (float x)); # endif _GL_CXXALIASWARN (sqrtf); #elif defined GNULIB_POSIXCHECK -# undef sqrtf # if HAVE_RAW_DECL_SQRTF _GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - " "use gnulib module sqrtf for portability"); @@ -2347,7 +2266,6 @@ _GL_CXXALIAS_SYS (sqrtl, long double, (long double x)); _GL_CXXALIASWARN (sqrtl); # endif #elif defined GNULIB_POSIXCHECK -# undef sqrtl # if HAVE_RAW_DECL_SQRTL _GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - " "use gnulib module sqrtl for portability"); @@ -2372,7 +2290,6 @@ _GL_CXXALIAS_SYS (tanf, float, (float x)); # endif _GL_CXXALIASWARN (tanf); #elif defined GNULIB_POSIXCHECK -# undef tanf # if HAVE_RAW_DECL_TANF _GL_WARN_ON_USE (tanf, "tanf is unportable - " "use gnulib module tanf for portability"); @@ -2389,7 +2306,6 @@ _GL_CXXALIAS_SYS (tanl, long double, (long double x)); _GL_CXXALIASWARN (tanl); # endif #elif defined GNULIB_POSIXCHECK -# undef tanl # if HAVE_RAW_DECL_TANL _GL_WARN_ON_USE (tanl, "tanl is unportable - " "use gnulib module tanl for portability"); @@ -2414,7 +2330,6 @@ _GL_CXXALIAS_SYS (tanhf, float, (float x)); # endif _GL_CXXALIASWARN (tanhf); #elif defined GNULIB_POSIXCHECK -# undef tanhf # if HAVE_RAW_DECL_TANHF _GL_WARN_ON_USE (tanhf, "tanhf is unportable - " "use gnulib module tanhf for portability"); @@ -2438,7 +2353,6 @@ _GL_CXXALIAS_SYS (truncf, float, (float x)); # endif _GL_CXXALIASWARN (truncf); #elif defined GNULIB_POSIXCHECK -# undef truncf # if HAVE_RAW_DECL_TRUNCF _GL_WARN_ON_USE (truncf, "truncf is unportable - " "use gnulib module truncf for portability"); @@ -2463,7 +2377,6 @@ _GL_CXXALIAS_SYS (trunc, double, (double x)); _GL_CXXALIASWARN1 (trunc, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK -# undef trunc # if HAVE_RAW_DECL_TRUNC _GL_WARN_ON_USE (trunc, "trunc is unportable - " "use gnulib module trunc for portability"); @@ -2488,7 +2401,6 @@ _GL_CXXALIAS_SYS (truncl, long double, (long double x)); _GL_CXXALIASWARN (truncl); # endif #elif defined GNULIB_POSIXCHECK -# undef truncl # if HAVE_RAW_DECL_TRUNCL _GL_WARN_ON_USE (truncl, "truncl is unportable - " "use gnulib module truncl for portability"); @@ -2549,18 +2461,25 @@ _GL_CXXALIASWARN (yn); declarations. */ -#if @GNULIB_ISFINITE@ +#if @GNULIB_ISFINITE@ || @GNULIB_ISFINITE_NO_CXX@ # if @REPLACE_ISFINITE@ _GL_EXTERN_C int gl_isfinitef (float x); _GL_EXTERN_C int gl_isfinited (double x); _GL_EXTERN_C int gl_isfinitel (long double x); -# undef isfinite -# define isfinite(x) \ - (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \ - sizeof (x) == sizeof (double) ? gl_isfinited (x) : \ - gl_isfinitef (x)) +# ifdef __cplusplus +template int isfinite (T); +template <> inline int isfinite (float x) { return gl_isfinitef (x); } +template <> inline int isfinite (double x) { return gl_isfinited (x); } +template <> inline int isfinite (long double x) { return gl_isfinitel (x); } +# else +# undef isfinite +# define isfinite(x) \ + (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \ + sizeof (x) == sizeof (double) ? gl_isfinited (x) : \ + gl_isfinitef (x)) +# endif # endif -# ifdef __cplusplus +# if @GNULIB_ISFINITE@ && defined __cplusplus # if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite @@ -2584,18 +2503,25 @@ _GL_WARN_REAL_FLOATING_DECL (isfinite); #endif -#if @GNULIB_ISINF@ +#if @GNULIB_ISINF@ || @GNULIB_ISINF_NO_CXX@ # if @REPLACE_ISINF@ _GL_EXTERN_C int gl_isinff (float x); _GL_EXTERN_C int gl_isinfd (double x); _GL_EXTERN_C int gl_isinfl (long double x); -# undef isinf -# define isinf(x) \ - (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \ - sizeof (x) == sizeof (double) ? gl_isinfd (x) : \ - gl_isinff (x)) +# ifdef __cplusplus +template int isinf (T); +template <> inline int isinf (float x) { return gl_isinff (x); } +template <> inline int isinf (double x) { return gl_isinfd (x); } +template <> inline int isinf (long double x) { return gl_isinfl (x); } +# else +# undef isinf +# define isinf(x) \ + (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \ + sizeof (x) == sizeof (double) ? gl_isinfd (x) : \ + gl_isinff (x)) +# endif # endif -# ifdef __cplusplus +# if @GNULIB_ISINF@ && defined __cplusplus # if defined isinf || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf) # undef isinf @@ -2622,9 +2548,9 @@ _GL_WARN_REAL_FLOATING_DECL (isinf); #if @GNULIB_ISNANF@ /* Test for NaN for 'float' numbers. */ # if @HAVE_ISNANF@ -# if defined __sun || defined __sgi -/* Solaris and IRIX have isnanf() and declare it in . We cannot - define isnanf as a macro, because that would conflict with . */ +# if defined __sun +/* Solaris has isnanf() and declares it in . We cannot define isnanf + as a macro, because that would conflict with . */ _GL_EXTERN_C int isnanf (float x); # else /* The original included above provides a declaration of isnan macro @@ -2652,9 +2578,9 @@ _GL_EXTERN_C int isnanf (float x); This function is a gnulib extension, unlike isnan() which applied only to 'double' numbers earlier but now is a type-generic macro. */ # if @HAVE_ISNAND@ -# if defined __sun || defined __sgi -/* Solaris and IRIX have isnand() and declare it in . We cannot - define isnand as a macro, because that would conflict with . */ +# if defined __sun +/* Solaris has isnand() and declares it in . We cannot define isnand + as a macro, because that would conflict with . */ _GL_EXTERN_C int isnand (double x); # else /* The original included above provides a declaration of isnan @@ -2699,7 +2625,7 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST; #endif /* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */ -#if @GNULIB_ISNAN@ +#if @GNULIB_ISNAN@ || @GNULIB_ISNAN_NO_CXX@ # if @REPLACE_ISNAN@ /* We can't just use the isnanf macro (e.g.) as exposed by isnanf.h (e.g.) here, because those may end up being macros @@ -2723,19 +2649,35 @@ _GL_EXTERN_C int rpl_isnand (double x); _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST; # define gl_isnan_l(x) rpl_isnanl (x) # endif -# undef isnan -# define isnan(x) \ - (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ - sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ - gl_isnan_f (x)) +# ifdef __cplusplus +# undef isnan +template int isnan (T); +template <> inline int isnan (float x) { return gl_isnan_f (x); } +template <> inline int isnan (double x) { return gl_isnan_d (x); } +template <> inline int isnan (long double x) { return gl_isnan_l (x); } +# else +# undef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ + sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ + gl_isnan_f (x)) +# endif # elif (__GNUC__ >= 4) || (__clang_major__ >= 4) -# undef isnan -# define isnan(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \ - sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \ - __builtin_isnan ((float)(x))) +# ifdef __cplusplus +# undef isnan +template int isnan (T); +template <> inline int isnan (float x) { return __builtin_isnan (x); } +template <> inline int isnan (double x) { return __builtin_isnan (x); } +template <> inline int isnan (long double x) { return __builtin_isnan (x); } +# else +# undef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \ + sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \ + __builtin_isnan ((float)(x))) +# endif # endif -# ifdef __cplusplus +# if @GNULIB_ISNAN@ && defined __cplusplus # if defined isnan || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) # undef isnan @@ -2769,15 +2711,22 @@ _GL_WARN_REAL_FLOATING_DECL (isnan); #endif -#if @GNULIB_SIGNBIT@ +#if @GNULIB_SIGNBIT@ || @GNULIB_SIGNBIT_NO_CXX@ # if (@REPLACE_SIGNBIT_USING_BUILTINS@ \ && (!defined __cplusplus || __cplusplus < 201103)) # undef signbit /* GCC >= 4.0 and clang provide three built-ins for signbit. */ -# define signbit(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ - sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ - __builtin_signbitf (x)) +# if defined __cplusplus && !defined __clang__ +template int signbit (T); +template <> inline int signbit (float x) { return __builtin_signbitf (x); } +template <> inline int signbit (double x) { return __builtin_signbit (x); } +template <> inline int signbit (long double x) { return __builtin_signbitl (x); } +# else +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ + sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ + __builtin_signbitf (x)) +# endif # endif # if @REPLACE_SIGNBIT@ && !GNULIB_defined_signbit # undef signbit @@ -2821,13 +2770,20 @@ _GL_EXTERN_C int gl_signbitl (long double arg); }) # endif # endif -# define signbit(x) \ - (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \ - sizeof (x) == sizeof (double) ? gl_signbitd (x) : \ - gl_signbitf (x)) +# if defined __cplusplus && !defined __clang__ +template int signbit (T); +template <> inline int signbit (float x) { return gl_signbitf (x); } +template <> inline int signbit (double x) { return gl_signbitd (x); } +template <> inline int signbit (long double x) { return gl_signbitl (x); } +# else +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \ + sizeof (x) == sizeof (double) ? gl_signbitd (x) : \ + gl_signbitf (x)) +# endif # define GNULIB_defined_signbit 1 # endif -# ifdef __cplusplus +# if @GNULIB_SIGNBIT@ && defined __cplusplus # if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit @@ -2867,7 +2823,6 @@ _GL_CXXALIAS_SYS (getpayloadf, float, (const float *)); # endif _GL_CXXALIASWARN (getpayloadf); #elif defined GNULIB_POSIXCHECK -# undef getpayloadf # if HAVE_RAW_DECL_GETPAYLOADF _GL_WARN_ON_USE (getpayloadf, "getpayloadf is unportable - " "use gnulib module getpayloadf for portability"); @@ -2890,7 +2845,6 @@ _GL_CXXALIAS_SYS (getpayload, double, (const double *)); # endif _GL_CXXALIASWARN (getpayload); #elif defined GNULIB_POSIXCHECK -# undef getpayload # if HAVE_RAW_DECL_GETPAYLOAD _GL_WARN_ON_USE (getpayload, "getpayload is unportable - " "use gnulib module getpayload for portability"); @@ -2913,7 +2867,6 @@ _GL_CXXALIAS_SYS (getpayloadl, long double, (const long double *)); # endif _GL_CXXALIASWARN (getpayloadl); #elif defined GNULIB_POSIXCHECK -# undef getpayloadl # if HAVE_RAW_DECL_GETPAYLOADL _GL_WARN_ON_USE (getpayloadl, "getpayloadl is unportable - " "use gnulib module getpayloadl for portability"); @@ -2928,7 +2881,6 @@ _GL_FUNCDECL_SYS (setpayloadf, int, (float *, float), ); _GL_CXXALIAS_SYS (setpayloadf, int, (float *, float)); _GL_CXXALIASWARN (setpayloadf); #elif defined GNULIB_POSIXCHECK -# undef setpayloadf # if HAVE_RAW_DECL_SETPAYLOADF _GL_WARN_ON_USE (setpayloadf, "setpayloadf is unportable - " "use gnulib module setpayloadf for portability"); @@ -2942,7 +2894,6 @@ _GL_FUNCDECL_SYS (setpayload, int, (double *, double), ); _GL_CXXALIAS_SYS (setpayload, int, (double *, double)); _GL_CXXALIASWARN (setpayload); #elif defined GNULIB_POSIXCHECK -# undef setpayload # if HAVE_RAW_DECL_SETPAYLOAD _GL_WARN_ON_USE (setpayload, "setpayload is unportable - " "use gnulib module setpayload for portability"); @@ -2956,7 +2907,6 @@ _GL_FUNCDECL_SYS (setpayloadl, int, (long double *, long double), ); _GL_CXXALIAS_SYS (setpayloadl, int, (long double *, long double)); _GL_CXXALIASWARN (setpayloadl); #elif defined GNULIB_POSIXCHECK -# undef setpayloadl # if HAVE_RAW_DECL_SETPAYLOADL _GL_WARN_ON_USE (setpayloadl, "setpayloadl is unportable - " "use gnulib module setpayloadl for portability"); @@ -2971,7 +2921,6 @@ _GL_FUNCDECL_SYS (setpayloadsigf, int, (float *, float), ); _GL_CXXALIAS_SYS (setpayloadsigf, int, (float *, float)); _GL_CXXALIASWARN (setpayloadsigf); #elif defined GNULIB_POSIXCHECK -# undef setpayloadsigf # if HAVE_RAW_DECL_SETPAYLOADSIGF _GL_WARN_ON_USE (setpayloadsigf, "setpayloadsigf is unportable - " "use gnulib module setpayloadsigf for portability"); @@ -2985,7 +2934,6 @@ _GL_FUNCDECL_SYS (setpayloadsig, int, (double *, double), ); _GL_CXXALIAS_SYS (setpayloadsig, int, (double *, double)); _GL_CXXALIASWARN (setpayloadsig); #elif defined GNULIB_POSIXCHECK -# undef setpayloadsig # if HAVE_RAW_DECL_SETPAYLOADSIG _GL_WARN_ON_USE (setpayloadsig, "setpayloadsig is unportable - " "use gnulib module setpayloadsig for portability"); @@ -2999,7 +2947,6 @@ _GL_FUNCDECL_SYS (setpayloadsigl, int, (long double *, long double), ); _GL_CXXALIAS_SYS (setpayloadsigl, int, (long double *, long double)); _GL_CXXALIASWARN (setpayloadsigl); #elif defined GNULIB_POSIXCHECK -# undef setpayloadsigl # if HAVE_RAW_DECL_SETPAYLOADSIGL _GL_WARN_ON_USE (setpayloadsigl, "setpayloadsigl is unportable - " "use gnulib module setpayloadsigl for portability"); @@ -3023,7 +2970,6 @@ _GL_CXXALIAS_SYS (totalorderf, int, (float const *, float const *)); # endif _GL_CXXALIASWARN (totalorderf); #elif defined GNULIB_POSIXCHECK -# undef totalorderf # if HAVE_RAW_DECL_TOTALORDERF _GL_WARN_ON_USE (totalorderf, "totalorderf is unportable - " "use gnulib module totalorderf for portability"); @@ -3048,7 +2994,6 @@ _GL_CXXALIAS_SYS (totalorder, int, (double const *, double const *)); _GL_CXXALIASWARN1 (totalorder, int, (double const *, double const *)); # endif #elif defined GNULIB_POSIXCHECK -# undef totalorder # if HAVE_RAW_DECL_TOTALORDER _GL_WARN_ON_USE (totalorder, "totalorder is unportable - " "use gnulib module totalorder for portability"); @@ -3075,7 +3020,6 @@ _GL_CXXALIAS_SYS (totalorderl, int, # endif _GL_CXXALIASWARN (totalorderl); #elif defined GNULIB_POSIXCHECK -# undef totalorderl # if HAVE_RAW_DECL_TOTALORDERL _GL_WARN_ON_USE (totalorderl, "totalorderl is unportable - " "use gnulib module totalorderl for portability"); @@ -3101,7 +3045,6 @@ _GL_CXXALIAS_SYS (totalordermagf, int, (float const *, float const *)); _GL_CXXALIASWARN1 (totalordermagf, int, (float const *, float const *)); # endif #elif defined GNULIB_POSIXCHECK -# undef totalordermagf # if HAVE_RAW_DECL_TOTALORDERMAGF _GL_WARN_ON_USE (totalordermagf, "totalordermagf is unportable - " "use gnulib module totalordermagf for portability"); @@ -3126,7 +3069,6 @@ _GL_CXXALIAS_SYS (totalordermag, int, (double const *, double const *)); _GL_CXXALIASWARN1 (totalordermag, int, (double const *, double const *)); # endif #elif defined GNULIB_POSIXCHECK -# undef totalordermag # if HAVE_RAW_DECL_TOTALORDERMAG _GL_WARN_ON_USE (totalordermag, "totalordermag is unportable - " "use gnulib module totalordermag for portability"); @@ -3156,7 +3098,6 @@ _GL_CXXALIASWARN1 (totalordermagl, int, (long double const *, long double const *)); # endif #elif defined GNULIB_POSIXCHECK -# undef totalordermagl # if HAVE_RAW_DECL_TOTALORDERMAGL _GL_WARN_ON_USE (totalordermagl, "totalordermagl is unportable - " "use gnulib module totalordermagl for portability"); diff --git a/gl/mbchar.c b/gl/mbchar.c index 713c2f74..db9e2718 100644 --- a/gl/mbchar.c +++ b/gl/mbchar.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006, 2009-2025 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -14,9 +14,8 @@ along with this program. If not, see . */ -#include - #define MBCHAR_INLINE _GL_EXTERN_INLINE +#include #include diff --git a/gl/mbchar.h b/gl/mbchar.h index d77168e7..20e28e5f 100644 --- a/gl/mbchar.h +++ b/gl/mbchar.h @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -217,12 +217,12 @@ typedef struct mbchar mbchar_t; ((mbc1).wc_valid && (mbc2).wc_valid \ ? (mbc1).wc == (mbc2).wc \ : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) #define mb_caseequal(mbc1, mbc2) \ ((mbc1).wc_valid && (mbc2).wc_valid \ ? c32tolower ((mbc1).wc) == c32tolower ((mbc2).wc) \ : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) /* , classification. */ #define mb_isascii(mbc) \ @@ -262,9 +262,14 @@ mb_width_aux (char32_t wc) #if defined GNULIB_MBFILE /* Assignment. */ -# define mb_setascii(mbc, sc) \ - ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ - (mbc)->wc = (mbc)->buf[0] = (sc)) +MBCHAR_INLINE void +mb_setascii (mbchar_t *mbc, char sc) +{ + mbc->ptr = mbc->buf; + mbc->bytes = 1; + mbc->wc_valid = true; + mbc->wc = mbc->buf[0] = sc; +} #endif /* Copying a character. */ diff --git a/gl/mbiterf.c b/gl/mbiterf.c index ad354c55..bb0a5cc3 100644 --- a/gl/mbiterf.c +++ b/gl/mbiterf.c @@ -1,6 +1,6 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2023-2025 Free Software Foundation, Inc. + Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define MBITERF_INLINE _GL_EXTERN_INLINE +#include #include "mbiterf.h" diff --git a/gl/mbiterf.h b/gl/mbiterf.h index 99d8d11d..50a39c0f 100644 --- a/gl/mbiterf.h +++ b/gl/mbiterf.h @@ -1,5 +1,5 @@ /* Iterating through multibyte strings, faster: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -61,7 +61,7 @@ mbif_next (state, iter, endptr) returns the next multibyte character. - It asssumes that the state is initialized and that iter < endptr. + It assumes that the state is initialized and that iter < endptr. Here are the function prototypes of the macros. diff --git a/gl/mbrtoc32.c b/gl/mbrtoc32.c index c4625525..4c8f5267 100644 --- a/gl/mbrtoc32.c +++ b/gl/mbrtoc32.c @@ -1,5 +1,5 @@ /* Convert multibyte character to 32-bit wide character. - Copyright (C) 2020-2025 Free Software Foundation, Inc. + Copyright (C) 2020-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -30,7 +30,7 @@ # include "lc-charset-unicode.h" #endif -#if GNULIB_defined_mbstate_t /* AIX, IRIX */ +#if GNULIB_defined_mbstate_t /* AIX */ /* Implement mbrtoc32() on top of mbtowc() for the non-UTF-8 locales and directly for the UTF-8 locales. */ @@ -165,7 +165,6 @@ mbrtoc32 (char32_t *pwc, const char *s, size_t n, mbstate_t *ps) char buf[4]; const char *p; size_t m; - int res; switch (nstate) { @@ -198,6 +197,7 @@ mbrtoc32 (char32_t *pwc, const char *s, size_t n, mbstate_t *ps) /* Here m > 0. */ + int res; { # define FITS_IN_CHAR_TYPE(wc) 1 # include "mbrtowc-impl-utf8.h" diff --git a/gl/mbrtowc-impl-utf8.h b/gl/mbrtowc-impl-utf8.h index 98858e22..ad96ca84 100644 --- a/gl/mbrtowc-impl-utf8.h +++ b/gl/mbrtowc-impl-utf8.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2025 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/mbrtowc-impl.h b/gl/mbrtowc-impl.h index 61be6599..21a3998c 100644 --- a/gl/mbrtowc-impl.h +++ b/gl/mbrtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2025 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -41,8 +41,6 @@ char buf[4]; const char *p; size_t m; - enc_t enc; - int res; switch (nstate) { @@ -75,7 +73,8 @@ /* Here m > 0. */ - enc = locale_encoding_classification (); + enc_t enc = locale_encoding_classification (); + int res; if (enc == enc_utf8) /* UTF-8 */ { @@ -89,17 +88,19 @@ { /* The hidden internal state of mbtowc would make this function not multi-thread safe. Achieve multi-thread safety through a lock. */ - wchar_t wc; - res = mbtowc_with_lock (&wc, p, m); + { + wchar_t wc; + res = mbtowc_with_lock (&wc, p, m); - if (res >= 0) - { - if ((wc == 0) != (res == 0)) - abort (); - if (pwc != NULL) - *pwc = wc; - goto success; - } + if (res >= 0) + { + if ((wc == 0) != (res == 0)) + abort (); + if (pwc != NULL) + *pwc = wc; + goto success; + } + } /* mbtowc does not distinguish between invalid and incomplete multibyte sequences. But mbrtowc needs to make this distinction. diff --git a/gl/mbrtowc.c b/gl/mbrtowc.c index 6f0aa129..49831706 100644 --- a/gl/mbrtowc.c +++ b/gl/mbrtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2025 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify @@ -81,10 +81,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) size_t rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) { - size_t ret; - wchar_t wc; - -# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG +# if MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG if (s == NULL) { pwc = NULL; @@ -98,6 +95,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) return (size_t) -2; # endif + wchar_t wc; if (! pwc) pwc = &wc; @@ -116,7 +114,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) size_t count = 0; for (; n > 0; s++, n--) { - ret = mbrtowc (&wc, s, 1, ps); + size_t ret = mbrtowc (&wc, s, 1, ps); if (ret == (size_t)(-1)) return (size_t)(-1); @@ -133,6 +131,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } # endif + size_t ret; # if MBRTOWC_STORES_INCOMPLETE_BUG ret = mbrtowc (&wc, s, n, ps); if (ret < (size_t) -2 && pwc != NULL) diff --git a/gl/mbsinit.c b/gl/mbsinit.c index 2df30b32..6252aa7a 100644 --- a/gl/mbsinit.c +++ b/gl/mbsinit.c @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify diff --git a/gl/mbsnlen.c b/gl/mbsnlen.c index 9c25465a..bcca569b 100644 --- a/gl/mbsnlen.c +++ b/gl/mbsnlen.c @@ -1,5 +1,5 @@ /* Counting the multibyte characters in a string. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This file is free software: you can redistribute it and/or modify diff --git a/gl/mbszero.c b/gl/mbszero.c index 36fc9200..b63b2c04 100644 --- a/gl/mbszero.c +++ b/gl/mbszero.c @@ -1,5 +1,5 @@ /* Put an mbstate_t into an initial conversion state. - Copyright (C) 2023-2025 Free Software Foundation, Inc. + Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/mbtowc-impl.h b/gl/mbtowc-impl.h index 3366c9da..c6d61968 100644 --- a/gl/mbtowc-impl.h +++ b/gl/mbtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify @@ -27,11 +27,10 @@ mbtowc (wchar_t *pwc, const char *s, size_t n) else { mbstate_t state; - wchar_t wc; - size_t result; - mbszero (&state); - result = mbrtowc (&wc, s, n, &state); + + wchar_t wc; + size_t result = mbrtowc (&wc, s, n, &state); if (result == (size_t)-1 || result == (size_t)-2) { errno = EILSEQ; diff --git a/gl/mbtowc-lock.c b/gl/mbtowc-lock.c index e350608b..14106188 100644 --- a/gl/mbtowc-lock.c +++ b/gl/mbtowc-lock.c @@ -1,5 +1,5 @@ /* Return the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/mbtowc-lock.h b/gl/mbtowc-lock.h index 500f74cc..b3e4e28e 100644 --- a/gl/mbtowc-lock.h +++ b/gl/mbtowc-lock.h @@ -1,5 +1,5 @@ /* Use the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -23,7 +23,7 @@ mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m) { /* Put the hidden internal state of mbtowc into an initial state. This is needed at least with glibc, uClibc, and MSVC CRT. - See . */ + See . */ mbtowc (NULL, NULL, 0); return mbtowc (pwc, p, m); @@ -50,16 +50,15 @@ static int mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m) { CRITICAL_SECTION *lock = gl_get_mbtowc_lock (); - int ret; EnterCriticalSection (lock); - ret = mbtowc_unlocked (pwc, p, m); + int ret = mbtowc_unlocked (pwc, p, m); LeaveCriticalSection (lock); return ret; } -#elif HAVE_PTHREAD_API /* AIX, IRIX, Cygwin */ +#elif HAVE_PTHREAD_API /* AIX, Cygwin */ extern # if defined _WIN32 || defined __CYGWIN__ @@ -67,7 +66,7 @@ extern # endif pthread_mutex_t *gl_get_mbtowc_lock (void); -# if HAVE_WEAK_SYMBOLS /* IRIX */ +# if HAVE_WEAK_SYMBOLS /* Avoid the need to link with '-lpthread'. */ # pragma weak pthread_mutex_lock @@ -89,11 +88,10 @@ mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m) if (pthread_in_use()) { pthread_mutex_t *lock = gl_get_mbtowc_lock (); - int ret; if (pthread_mutex_lock (lock)) abort (); - ret = mbtowc_unlocked (pwc, p, m); + int ret = mbtowc_unlocked (pwc, p, m); if (pthread_mutex_unlock (lock)) abort (); @@ -111,11 +109,10 @@ static int mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m) { mtx_t *lock = gl_get_mbtowc_lock (); - int ret; if (mtx_lock (lock) != thrd_success) abort (); - ret = mbtowc_unlocked (pwc, p, m); + int ret = mbtowc_unlocked (pwc, p, m); if (mtx_unlock (lock) != thrd_success) abort (); diff --git a/gl/mbtowc.c b/gl/mbtowc.c index 27ff35c6..2f30b9fb 100644 --- a/gl/mbtowc.c +++ b/gl/mbtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify diff --git a/gl/memchr.c b/gl/memchr.c index ef0d15f7..6adac7e1 100644 --- a/gl/memchr.c +++ b/gl/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2025 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2026 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), @@ -65,105 +65,103 @@ __memchr (void const *s, int c_in, size_t n) performance. */ typedef unsigned long int longword; - const unsigned char *char_ptr; - const longword *longword_ptr; - longword repeated_one; - longword repeated_c; - unsigned reg_char c; + unsigned reg_char c = (unsigned char) c_in; - c = (unsigned char) c_in; + const longword *longword_ptr; /* Handle the first few bytes by reading one byte at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && (size_t) char_ptr % sizeof (longword) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (void *) char_ptr; + { + const unsigned char *char_ptr; + for (char_ptr = (const unsigned char *) s; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; + --n, ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; - longword_ptr = (const longword *) char_ptr; + longword_ptr = (const longword *) char_ptr; + } /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ - - /* Compute auxiliary longword values: - repeated_one is a value which has a 1 in every byte. - repeated_c has c in every byte. */ - repeated_one = 0x01010101; - repeated_c = c | (c << 8); - repeated_c |= repeated_c << 16; - if (0xffffffffU < (longword) -1) - { - repeated_one |= repeated_one << 31 << 1; - repeated_c |= repeated_c << 31 << 1; - if (8 < sizeof (longword)) - { - size_t i; - - for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + longword repeated_one = 0x01010101; + longword repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + for (size_t i = 64; i < sizeof (longword) * 8; i *= 2) { repeated_one |= repeated_one << i; repeated_c |= repeated_c << i; } - } - } - - /* Instead of the traditional loop which tests each byte, we will test a - longword at a time. The tricky part is testing if *any of the four* - bytes in the longword in question are equal to c. We first use an xor - with repeated_c. This reduces the task to testing whether *any of the - four* bytes in longword1 is zero. - - We compute tmp = - ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). - That is, we perform the following operations: - 1. Subtract repeated_one. - 2. & ~longword1. - 3. & a mask consisting of 0x80 in every byte. - Consider what happens in each byte: - - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, - and step 3 transforms it into 0x80. A carry can also be propagated - to more significant bytes. - - If a byte of longword1 is nonzero, let its lowest 1 bit be at - position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, - the byte ends in a single bit of value 0 and k bits of value 1. - After step 2, the result is just k bits of value 1: 2^k - 1. After - step 3, the result is 0. And no carry is produced. - So, if longword1 has only non-zero bytes, tmp is zero. - Whereas if longword1 has a zero byte, call j the position of the least - significant zero byte. Then the result has a zero at positions 0, ..., - j-1 and a 0x80 at position j. We cannot predict the result at the more - significant bytes (positions j+1..3), but it does not matter since we - already have a non-zero bit at position 8*j+7. - - So, the test whether any byte in longword1 is zero is equivalent to - testing whether tmp is nonzero. */ - - while (n >= sizeof (longword)) - { - longword longword1 = *longword_ptr ^ repeated_c; - - if ((((longword1 - repeated_one) & ~longword1) - & (repeated_one << 7)) != 0) - break; - longword_ptr++; - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - /* At this point, we know that either n < sizeof (longword), or one of the - sizeof (longword) bytes starting at char_ptr is == c. On little-endian - machines, we could determine the first such byte without any further - memory accesses, just by looking at the tmp result from the last loop - iteration. But this does not work on big-endian machines. Choose code - that works in both cases. */ - - for (; n > 0; --n, ++char_ptr) - { - if (*char_ptr == c) - return (void *) char_ptr; - } + } + + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c. We first use an xor + with repeated_c. This reduces the task to testing whether *any of the + four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + So, the test whether any byte in longword1 is zero is equivalent to + testing whether tmp is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); + } + } + + { + const unsigned char *char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c. On little-endian + machines, we could determine the first such byte without any further + memory accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. Choose code + that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) + { + if (*char_ptr == c) + return (void *) char_ptr; + } + } return NULL; } diff --git a/gl/memchr.valgrind b/gl/memchr.valgrind index 8e55c207..7ab1f6ff 100644 --- a/gl/memchr.valgrind +++ b/gl/memchr.valgrind @@ -1,6 +1,6 @@ # Suppress a valgrind message about use of uninitialized memory in memchr(). -# Copyright (C) 2009-2025 Free Software Foundation, Inc. +# Copyright (C) 2009-2026 Free Software Foundation, Inc. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as diff --git a/gl/minmax.h b/gl/minmax.h index 355de4b1..fd731fb7 100644 --- a/gl/minmax.h +++ b/gl/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2025 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ #define _MINMAX_H /* Note: MIN, MAX are also defined in on some systems - (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about - MIN, MAX macro redefinitions on some systems; the workaround is to + (glibc, HP-UX). Therefore you might get warnings about MIN, MAX + macro redefinitions on some systems; the workaround is to #include this file as the last one among the #include list. */ /* This file uses HAVE_MINMAX_IN_LIMITS_H, HAVE_MINMAX_IN_SYS_PARAM_H. */ diff --git a/gl/mktime-internal.h b/gl/mktime-internal.h index 215be914..6ccf651c 100644 --- a/gl/mktime-internal.h +++ b/gl/mktime-internal.h @@ -1,5 +1,5 @@ /* Internals of mktime and related functions - Copyright 2016-2025 Free Software Foundation, Inc. + Copyright 2016-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . diff --git a/gl/mktime.c b/gl/mktime.c index 4218fca6..c56c6f9a 100644 --- a/gl/mktime.c +++ b/gl/mktime.c @@ -1,5 +1,5 @@ /* Convert a 'struct tm' to a time_t value. - Copyright (C) 1993-2025 Free Software Foundation, Inc. + Copyright (C) 1993-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . @@ -468,11 +468,9 @@ __mktime_internal (struct tm *tp, bool local, mktime_offset_t *offset) int year_seconds_bound = 366 * 24 * 60 * 60 + 1; int delta_bound = year_seconds_bound + stride; - int delta, direction; - /* Search in both directions, closest first. */ - for (delta = stride; delta < delta_bound; delta += stride) - for (direction = -1; direction <= 1; direction += 2) + for (int delta = stride; delta < delta_bound; delta += stride) + for (int direction = -1; direction <= 1; direction += 2) { long_int ot; if (! ckd_add (&ot, t, delta * direction)) diff --git a/gl/mountlist.c b/gl/mountlist.c index dcff6f83..66b3f3d5 100644 --- a/gl/mountlist.c +++ b/gl/mountlist.c @@ -1,6 +1,6 @@ /* mountlist.c -- return a list of mounted file systems - Copyright (C) 1991-1992, 1997-2025 Free Software Foundation, Inc. + Copyright (C) 1991-1992, 1997-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ # include #endif -#if defined MOUNTED_GETFSSTAT /* OSF/1, also (obsolete) Apple Darwin 1.3 */ +#if defined MOUNTED_GETFSSTAT /* (obsolete) Apple Darwin 1.3 */ # if HAVE_SYS_UCRED_H # include /* needed on OSF V4.0 for definition of NGROUPS, NGROUPS is used as an array dimension in ucred.h */ @@ -60,7 +60,7 @@ # endif #endif /* MOUNTED_GETFSSTAT */ -#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android, +#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS */ # include # include @@ -171,23 +171,21 @@ #endif #define ME_DUMMY_0(Fs_name, Fs_type) \ - (strcmp (Fs_type, "autofs") == 0 \ - || strcmp (Fs_type, "proc") == 0 \ - || strcmp (Fs_type, "subfs") == 0 \ + (streq (Fs_type, "autofs") \ + || streq (Fs_type, "proc") \ + || streq (Fs_type, "subfs") \ /* for Linux 2.6/3.x */ \ - || strcmp (Fs_type, "debugfs") == 0 \ - || strcmp (Fs_type, "devpts") == 0 \ - || strcmp (Fs_type, "fusectl") == 0 \ - || strcmp (Fs_type, "fuse.portal") == 0 \ - || strcmp (Fs_type, "mqueue") == 0 \ - || strcmp (Fs_type, "rpc_pipefs") == 0 \ - || strcmp (Fs_type, "sysfs") == 0 \ + || streq (Fs_type, "debugfs") \ + || streq (Fs_type, "devpts") \ + || streq (Fs_type, "fusectl") \ + || streq (Fs_type, "fuse.portal") \ + || streq (Fs_type, "mqueue") \ + || streq (Fs_type, "rpc_pipefs") \ + || streq (Fs_type, "sysfs") \ /* FreeBSD, Linux 2.4 */ \ - || strcmp (Fs_type, "devfs") == 0 \ + || streq (Fs_type, "devfs") \ /* for NetBSD 3.0 */ \ - || strcmp (Fs_type, "kernfs") == 0 \ - /* for Irix 6.5 */ \ - || strcmp (Fs_type, "ignore") == 0) + || streq (Fs_type, "kernfs")) /* Historically, we have marked as "dummy" any file system of type "none", but now that programs like du need to know about bind-mounted directories, @@ -196,10 +194,10 @@ #ifdef MOUNTED_GETMNTENT1 # define ME_DUMMY(Fs_name, Fs_type, Bind) \ (ME_DUMMY_0 (Fs_name, Fs_type) \ - || (strcmp (Fs_type, "none") == 0 && !Bind)) + || (streq (Fs_type, "none") && !Bind)) #else # define ME_DUMMY(Fs_name, Fs_type) \ - (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0) + (ME_DUMMY_0 (Fs_name, Fs_type) || streq (Fs_type, "none")) #endif #ifdef __CYGWIN__ @@ -240,19 +238,19 @@ me_remote (char const *fs_name, _GL_UNUSED char const *fs_type) (strchr (Fs_name, ':') != NULL \ || ((Fs_name)[0] == '/' \ && (Fs_name)[1] == '/' \ - && (strcmp (Fs_type, "smbfs") == 0 \ - || strcmp (Fs_type, "smb3") == 0 \ - || strcmp (Fs_type, "cifs") == 0)) \ - || strcmp (Fs_type, "acfs") == 0 \ - || strcmp (Fs_type, "afs") == 0 \ - || strcmp (Fs_type, "coda") == 0 \ - || strcmp (Fs_type, "auristorfs") == 0 \ - || strcmp (Fs_type, "fhgfs") == 0 \ - || strcmp (Fs_type, "gpfs") == 0 \ - || strcmp (Fs_type, "ibrix") == 0 \ - || strcmp (Fs_type, "ocfs2") == 0 \ - || strcmp (Fs_type, "vxfs") == 0 \ - || strcmp ("-hosts", Fs_name) == 0) + && (streq (Fs_type, "smbfs") \ + || streq (Fs_type, "smb3") \ + || streq (Fs_type, "cifs"))) \ + || streq (Fs_type, "acfs") \ + || streq (Fs_type, "afs") \ + || streq (Fs_type, "coda") \ + || streq (Fs_type, "auristorfs") \ + || streq (Fs_type, "fhgfs") \ + || streq (Fs_type, "gpfs") \ + || streq (Fs_type, "ibrix") \ + || streq (Fs_type, "ocfs2") \ + || streq (Fs_type, "vxfs") \ + || streq ("-hosts", Fs_name)) #endif #if MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */ @@ -369,9 +367,7 @@ fsp_to_string (const struct statfs *fsp) static char * fstype_to_string (int t) { - struct vfs_ent *e; - - e = getvfsbytype (t); + struct vfs_ent *e = getvfsbytype (t); if (!e || !e->vfsent_name) return "none"; else @@ -400,10 +396,9 @@ dev_from_mount_options (char const *mount_options) char const *optval = devopt + sizeof dev_pattern - 1; if (c_isxdigit (*optval)) { - char *optvalend; - unsigned long int dev; errno = 0; - dev = strtoul (optval, &optvalend, 16); + char *optvalend; + unsigned long int dev = strtoul (optval, &optvalend, 16); if (optval != optvalend && (*optvalend == '\0' || *optvalend == ',') && ! (dev == ULONG_MAX && errno == ERANGE) @@ -427,9 +422,9 @@ dev_from_mount_options (char const *mount_options) static void unescape_tab (char *str) { - size_t i, j = 0; + size_t j = 0; size_t len = strlen (str) + 1; - for (i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) { if (str[i] == '\\' && (i + 4 < len) && str[i + 1] >= '0' && str[i + 1] <= '3' @@ -468,18 +463,16 @@ read_file_system_list (bool need_fs_type) struct mount_entry **mtail = &mount_list; (void) need_fs_type; -#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android, +#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS */ { - FILE *fp; - # if defined __linux__ || defined __ANDROID__ /* Try parsing mountinfo first, as that make device IDs available. Note we could use libmount routines to simplify this parsing a little (and that code is in previous versions of this function), however libmount depends on libselinux which pulls in many dependencies. */ char const *mountinfo = "/proc/self/mountinfo"; - fp = fopen (mountinfo, "re"); + FILE *fp = fopen (mountinfo, "re"); if (fp != NULL) { char *line = NULL; @@ -497,61 +490,61 @@ read_file_system_list (bool need_fs_type) &devmaj, &devmin, &mntroot_s); - if (rc != 2 && rc != 3) /* 3 if %n included in count. */ - continue; - - /* find end of MNTROOT. */ - char *mntroot = line + mntroot_s; - char *blank = terminate_at_blank (mntroot); - if (! blank) - continue; - - /* find end of TARGET. */ - char *target = blank + 1; - blank = terminate_at_blank (target); - if (! blank) - continue; - - /* skip optional fields, terminated by " - " */ - char *dash = strstr (blank + 1, " - "); - if (! dash) - continue; - - /* advance past the " - " separator. */ - char *fstype = dash + 3; - blank = terminate_at_blank (fstype); - if (! blank) - continue; - - /* find end of SOURCE. */ - char *source = blank + 1; - if (! terminate_at_blank (source)) - continue; - - /* manipulate the sub-strings in place. */ - unescape_tab (source); - unescape_tab (target); - unescape_tab (mntroot); - unescape_tab (fstype); - - me = xmalloc (sizeof *me); - - me->me_devname = xstrdup (source); - me->me_mountdir = xstrdup (target); - me->me_mntroot = xstrdup (mntroot); - me->me_type = xstrdup (fstype); - me->me_type_malloced = 1; - me->me_dev = makedev (devmaj, devmin); - /* we pass "false" for the "Bind" option as that's only - significant when the Fs_type is "none" which will not be - the case when parsing "/proc/self/mountinfo", and only - applies for static /etc/mtab files. */ - me->me_dummy = ME_DUMMY (me->me_devname, me->me_type, false); - me->me_remote = ME_REMOTE (me->me_devname, me->me_type); - - /* Add to the linked list. */ - *mtail = me; - mtail = &me->me_next; + if (rc == 2 || rc == 3) /* 3 if %n included in count. */ + { + /* find end of MNTROOT. */ + char *mntroot = line + mntroot_s; + char *blank = terminate_at_blank (mntroot); + if (blank) + { + /* find end of TARGET. */ + char *target = blank + 1; + blank = terminate_at_blank (target); + if (blank) + { + /* skip optional fields, terminated by " - " */ + char *dash = strstr (blank + 1, " - "); + if (dash) + { + /* advance past the " - " separator. */ + char *fstype = dash + 3; + blank = terminate_at_blank (fstype); + if (blank) + { + /* find end of SOURCE. */ + char *source = blank + 1; + if (terminate_at_blank (source)) + { + /* manipulate the sub-strings in place. */ + unescape_tab (source); + unescape_tab (target); + unescape_tab (mntroot); + unescape_tab (fstype); + + me = xmalloc (sizeof *me); + + me->me_devname = xstrdup (source); + me->me_mountdir = xstrdup (target); + me->me_mntroot = xstrdup (mntroot); + me->me_type = xstrdup (fstype); + me->me_type_malloced = 1; + me->me_dev = makedev (devmaj, devmin); + /* we pass "false" for the "Bind" option as that's only + significant when the Fs_type is "none" which will not be + the case when parsing "/proc/self/mountinfo", and only + applies for static /etc/mtab files. */ + me->me_dummy = ME_DUMMY (me->me_devname, me->me_type, false); + me->me_remote = ME_REMOTE (me->me_devname, me->me_type); + + /* Add to the linked list. */ + *mtail = me; + mtail = &me->me_next; + } + } + } + } + } + } } free (line); @@ -570,14 +563,14 @@ read_file_system_list (bool need_fs_type) else /* fallback to /proc/self/mounts (/etc/mtab). */ # endif /* __linux__ || __ANDROID__ */ { - struct mntent *mnt; char const *table = MOUNTED; - fp = setmntent (table, "r"); - if (fp == NULL) + FILE *mfp = setmntent (table, "r"); + if (mfp == NULL) return NULL; - while ((mnt = getmntent (fp))) + struct mntent *mnt; + while ((mnt = getmntent (mfp))) { bool bind = hasmntopt (mnt, "bind"); @@ -596,7 +589,7 @@ read_file_system_list (bool need_fs_type) mtail = &me->me_next; } - if (endmntent (fp) == 0) + if (endmntent (mfp) == 0) goto free_then_fail; } } @@ -605,9 +598,7 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */ { struct statfs *fsp; - int entries; - - entries = getmntinfo (&fsp, MNT_NOWAIT); + int entries = getmntinfo (&fsp, MNT_NOWAIT); if (entries < 0) return NULL; for (; entries-- > 0; fsp++) @@ -634,9 +625,7 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETMNTINFO2 /* NetBSD, Minix */ { struct statvfs *fsp; - int entries; - - entries = getmntinfo (&fsp, MNT_NOWAIT); + int entries = getmntinfo (&fsp, MNT_NOWAIT); if (entries < 0) return NULL; for (; entries-- > 0; fsp++) @@ -670,7 +659,6 @@ read_file_system_list (bool need_fs_type) We therefore get the list of subdirectories of /, and the list of all file systems, and match the two lists. */ - DIR *dirp; struct rootdir_entry { char *name; @@ -678,16 +666,11 @@ read_file_system_list (bool need_fs_type) ino_t ino; struct rootdir_entry *next; }; - struct rootdir_entry *rootdir_list; - struct rootdir_entry **rootdir_tail; - int32 pos; - dev_t dev; - fs_info fi; /* All volumes are mounted in the rootfs, directly under /. */ - rootdir_list = NULL; - rootdir_tail = &rootdir_list; - dirp = opendir ("/"); + struct rootdir_entry *rootdir_list = NULL; + struct rootdir_entry **rootdir_tail = &rootdir_list; + DIR *dirp = opendir ("/"); if (dirp) { struct dirent *d; @@ -697,61 +680,64 @@ read_file_system_list (bool need_fs_type) char *name; struct stat statbuf; - if (strcmp (d->d_name, "..") == 0) - continue; - - if (strcmp (d->d_name, ".") == 0) - name = xstrdup ("/"); - else + if (! streq (d->d_name, "..")) { - name = xmalloc (1 + strlen (d->d_name) + 1); - name[0] = '/'; - strcpy (name + 1, d->d_name); - } + if (streq (d->d_name, ".")) + name = xstrdup ("/"); + else + { + name = xmalloc (1 + strlen (d->d_name) + 1); + name[0] = '/'; + strcpy (name + 1, d->d_name); + } - if (lstat (name, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode)) - { - struct rootdir_entry *re = xmalloc (sizeof *re); - re->name = name; - re->dev = statbuf.st_dev; - re->ino = statbuf.st_ino; - - /* Add to the linked list. */ - *rootdir_tail = re; - rootdir_tail = &re->next; + if (lstat (name, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode)) + { + struct rootdir_entry *re = xmalloc (sizeof *re); + re->name = name; + re->dev = statbuf.st_dev; + re->ino = statbuf.st_ino; + + /* Add to the linked list. */ + *rootdir_tail = re; + rootdir_tail = &re->next; + } + else + free (name); } - else - free (name); } closedir (dirp); } *rootdir_tail = NULL; - for (pos = 0; (dev = next_dev (&pos)) >= 0; ) - if (fs_stat_dev (dev, &fi) >= 0) - { - /* Note: fi.dev == dev. */ - struct rootdir_entry *re; - - for (re = rootdir_list; re; re = re->next) - if (re->dev == fi.dev && re->ino == fi.root) - break; - - me = xmalloc (sizeof *me); - me->me_devname = xstrdup (fi.device_name[0] != '\0' - ? fi.device_name : fi.fsh_name); - me->me_mountdir = xstrdup (re != NULL ? re->name : fi.fsh_name); - me->me_mntroot = NULL; - me->me_type = xstrdup (fi.fsh_name); - me->me_type_malloced = 1; - me->me_dev = fi.dev; - me->me_dummy = 0; - me->me_remote = (fi.flags & B_FS_IS_SHARED) != 0; - - /* Add to the linked list. */ - *mtail = me; - mtail = &me->me_next; - } + dev_t dev; + for (int32 pos = 0; (dev = next_dev (&pos)) >= 0; ) + { + fs_info fi; + if (fs_stat_dev (dev, &fi) >= 0) + { + /* Note: fi.dev == dev. */ + struct rootdir_entry *re; + for (re = rootdir_list; re; re = re->next) + if (re->dev == fi.dev && re->ino == fi.root) + break; + + me = xmalloc (sizeof *me); + me->me_devname = xstrdup (fi.device_name[0] != '\0' + ? fi.device_name : fi.fsh_name); + me->me_mountdir = xstrdup (re != NULL ? re->name : fi.fsh_name); + me->me_mntroot = NULL; + me->me_type = xstrdup (fi.fsh_name); + me->me_type_malloced = 1; + me->me_dev = fi.dev; + me->me_dummy = 0; + me->me_remote = (fi.flags & B_FS_IS_SHARED) != 0; + + /* Add to the linked list. */ + *mtail = me; + mtail = &me->me_next; + } + } *mtail = NULL; while (rootdir_list != NULL) @@ -764,19 +750,17 @@ read_file_system_list (bool need_fs_type) } #endif /* MOUNTED_FS_STAT_DEV */ -#if defined MOUNTED_GETFSSTAT /* OSF/1, also (obsolete) Apple Darwin 1.3 */ +#if defined MOUNTED_GETFSSTAT /* (obsolete) Apple Darwin 1.3 */ { - int numsys, counter; - size_t bufsize; - struct statfs *stats; - numsys = getfsstat (NULL, 0L, MNT_NOWAIT); + int numsys = getfsstat (NULL, 0L, MNT_NOWAIT); if (numsys < 0) return NULL; + + struct statfs *stats; if (SIZE_MAX / sizeof *stats <= numsys) xalloc_die (); - - bufsize = (1 + numsys) * sizeof *stats; + size_t bufsize = (1 + numsys) * sizeof *stats; stats = xmalloc (bufsize); numsys = getfsstat (stats, bufsize, MNT_NOWAIT); @@ -786,7 +770,7 @@ read_file_system_list (bool need_fs_type) return NULL; } - for (counter = 0; counter < numsys; counter++) + for (int counter = 0; counter < numsys; counter++) { me = xmalloc (sizeof *me); me->me_devname = xstrdup (stats[counter].f_mntfromname); @@ -809,14 +793,13 @@ read_file_system_list (bool need_fs_type) #if defined MOUNTED_FREAD_FSTYP /* (obsolete) SVR3 */ { - struct mnttab mnt; char *table = "/etc/mnttab"; - FILE *fp; - fp = fopen (table, "re"); + FILE *fp = fopen (table, "re"); if (fp == NULL) return NULL; + struct mnttab mnt; while (fread (&mnt, sizeof mnt, 1, fp) > 0) { me = xmalloc (sizeof *me); @@ -862,20 +845,19 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETEXTMNTENT /* Solaris >= 8 */ { - struct extmnttab mnt; const char *table = MNTTAB; - FILE *fp; - int ret; /* No locking is needed, because the contents of /etc/mnttab is generated by the kernel. */ errno = 0; - fp = fopen (table, "re"); + FILE *fp = fopen (table, "re"); + int ret; if (fp == NULL) ret = errno; else { + struct extmnttab mnt; while ((ret = getextmntent (fp, &mnt, 1)) == 0) { me = xmalloc (sizeof *me); @@ -909,10 +891,7 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETMNTENT2 /* Solaris < 8, also (obsolete) SVR4 */ { - struct mnttab mnt; const char *table = MNTTAB; - FILE *fp; - int ret; int lockfd = -1; # if defined F_RDLCK && defined F_SETLKW @@ -945,11 +924,13 @@ read_file_system_list (bool need_fs_type) # endif errno = 0; - fp = fopen (table, "re"); + FILE *fp = fopen (table, "re"); + int ret; if (fp == NULL) ret = errno; else { + struct mnttab mnt; while ((ret = getmntent (fp, &mnt)) == 0) { me = xmalloc (sizeof *me); @@ -984,34 +965,24 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_VMOUNT /* AIX */ { - int bufsize; - void *entries; - char *thisent; - struct vmount *vmp; - int n_entries; - int i; - /* Ask how many bytes to allocate for the mounted file system info. */ - entries = &bufsize; - if (mntctl (MCTL_QUERY, sizeof bufsize, entries) != 0) + int bufsize; + if (mntctl (MCTL_QUERY, sizeof bufsize, &bufsize) != 0) return NULL; - entries = xmalloc (bufsize); + void *entries = xmalloc (bufsize); /* Get the list of mounted file systems. */ - n_entries = mntctl (MCTL_QUERY, bufsize, entries); + int n_entries = mntctl (MCTL_QUERY, bufsize, entries); if (n_entries < 0) { free (entries); return NULL; } - for (i = 0, thisent = entries; - i < n_entries; - i++, thisent += vmp->vmt_length) + char *thisent = entries; + for (int i = 0; i < n_entries; i++) { - char *options, *ignore; - - vmp = (struct vmount *) thisent; + struct vmount *vmp = (struct vmount *) thisent; me = xmalloc (sizeof *me); if (vmp->vmt_flags & MNT_REMOTE) { @@ -1036,8 +1007,8 @@ read_file_system_list (bool need_fs_type) me->me_mntroot = NULL; me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype)); me->me_type_malloced = 1; - options = thisent + vmp->vmt_data[VMT_ARGS].vmt_off; - ignore = strstr (options, "ignore"); + char *options = thisent + vmp->vmt_data[VMT_ARGS].vmt_off; + char *ignore = strstr (options, "ignore"); me->me_dummy = (ignore && (ignore == options || ignore[-1] == ',') && (ignore[sizeof "ignore" - 1] == ',' @@ -1047,6 +1018,8 @@ read_file_system_list (bool need_fs_type) /* Add to the linked list. */ *mtail = me; mtail = &me->me_next; + + thisent += vmp->vmt_length; } free (entries); } @@ -1055,25 +1028,23 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_INTERIX_STATVFS /* Interix */ { DIR *dirp = opendir ("/dev/fs"); - char node[9 + NAME_MAX]; - if (!dirp) goto free_then_fail; while (1) { - struct statvfs dev; - struct dirent entry; - struct dirent *result; - /* FIXME: readdir_r is planned to be withdrawn from POSIX and marked obsolescent in glibc. Use readdir instead. */ + struct dirent entry; + struct dirent *result; if (readdir_r (dirp, &entry, &result) || result == NULL) break; + char node[9 + NAME_MAX]; strcpy (node, "/dev/fs/"); strcat (node, entry.d_name); + struct statvfs dev; if (statvfs (node, &dev) == 0) { me = xmalloc (sizeof *me); @@ -1107,18 +1078,18 @@ read_file_system_list (bool need_fs_type) if ASCII 'A' + i is an available drive. See: . */ DWORD value = GetLogicalDrives (); - unsigned int i; - for (i = 0; i < 26; ++i) + for (unsigned int i = 0; i < 26; ++i) { if (value & (1U << i)) { char mountdir[4]; - char fs_name[MAX_PATH + 1]; mountdir[0] = 'A' + i; mountdir[1] = ':'; mountdir[2] = '\\'; mountdir[3] = '\0'; + + char fs_name[MAX_PATH + 1]; /* Test whether the drive actually exists, and get the name of the file system. See: . */ @@ -1141,10 +1112,10 @@ read_file_system_list (bool need_fs_type) For testing of SUBST: For testing of NET USE: */ wchar_t drive[3]; - wchar_t mapping[MAX_PATH + 1]; drive[0] = L'A' + i; drive[1] = L':'; drive[2] = L'\0'; + wchar_t mapping[MAX_PATH + 1]; DWORD mapping_len = QueryDosDeviceW (drive, mapping, sizeof (mapping) / sizeof (mapping[0])); if (mapping_len > 4 && wcsncmp (mapping, L"\\??\\", 4) == 0) { diff --git a/gl/mountlist.h b/gl/mountlist.h index e8ba1d96..de1ff712 100644 --- a/gl/mountlist.h +++ b/gl/mountlist.h @@ -1,6 +1,6 @@ /* mountlist.h -- declarations for list of mounted file systems - Copyright (C) 1991-1992, 1998, 2000-2005, 2009-2025 Free Software + Copyright (C) 1991-1992, 1998, 2000-2005, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gl/msvc-inval.c b/gl/msvc-inval.c index 1b51b1b0..774447b6 100644 --- a/gl/msvc-inval.c +++ b/gl/msvc-inval.c @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/msvc-inval.h b/gl/msvc-inval.h index 9bb8a156..25bb6a3a 100644 --- a/gl/msvc-inval.h +++ b/gl/msvc-inval.h @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -179,9 +179,9 @@ extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void); # define TRY_MSVC_INVAL \ do \ { \ - struct gl_msvc_inval_per_thread *msvc_inval_current; \ gl_msvc_inval_ensure_handler (); \ - msvc_inval_current = gl_msvc_inval_current (); \ + struct gl_msvc_inval_per_thread *msvc_inval_current = \ + gl_msvc_inval_current (); \ /* First, initialize gl_msvc_inval_restart. */ \ if (setjmp (msvc_inval_current->restart) == 0) \ { \ diff --git a/gl/msvc-nothrow.c b/gl/msvc-nothrow.c index 7cf7517e..dea273d5 100644 --- a/gl/msvc-nothrow.c +++ b/gl/msvc-nothrow.c @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/msvc-nothrow.h b/gl/msvc-nothrow.h index b02f36c4..f059d2d9 100644 --- a/gl/msvc-nothrow.h +++ b/gl/msvc-nothrow.h @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/netdb.in.h b/gl/netdb.in.h index 22059ea0..92f1220c 100644 --- a/gl/netdb.in.h +++ b/gl/netdb.in.h @@ -1,5 +1,5 @@ /* Provide a netdb.h header file for systems lacking it (read: MinGW). - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Simon Josefsson. This file is free software: you can redistribute it and/or modify @@ -41,8 +41,8 @@ #error "Please include config.h first." #endif -/* Get definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and - 'struct hostent' on MinGW. */ +/* Get definitions such as 'socklen_t' and 'struct hostent' + on MinGW. */ #include /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -277,25 +277,21 @@ _GL_CXXALIASWARN (getnameinfo); #elif defined GNULIB_POSIXCHECK -# undef getaddrinfo # if HAVE_RAW_DECL_GETADDRINFO _GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - " "use gnulib module getaddrinfo for portability"); # endif -# undef freeaddrinfo # if HAVE_RAW_DECL_FREEADDRINFO _GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - " "use gnulib module getaddrinfo for portability"); # endif -# undef gai_strerror # if HAVE_RAW_DECL_GAI_STRERROR _GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - " "use gnulib module getaddrinfo for portability"); # endif -# undef getnameinfo # if HAVE_RAW_DECL_GETNAMEINFO _GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - " "use gnulib module getaddrinfo for portability"); diff --git a/gl/netinet_in.in.h b/gl/netinet_in.in.h index 402d01a9..933f5823 100644 --- a/gl/netinet_in.in.h +++ b/gl/netinet_in.in.h @@ -1,5 +1,5 @@ /* Substitute for . - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/nl_langinfo-lock.c b/gl/nl_langinfo-lock.c index 1ac25515..810a510d 100644 --- a/gl/nl_langinfo-lock.c +++ b/gl/nl_langinfo-lock.c @@ -1,5 +1,5 @@ /* Return the internal lock used by nl_langinfo. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/nl_langinfo.c b/gl/nl_langinfo.c index 0180c26a..ff8fd89e 100644 --- a/gl/nl_langinfo.c +++ b/gl/nl_langinfo.c @@ -1,6 +1,6 @@ /* nl_langinfo() replacement: query locale dependent information. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -79,15 +79,13 @@ ctype_codeset (void) /* This function is only used on platforms which don't have uselocale(). Therefore we don't need to look at the per-thread locale first, here. */ static char result[2 + 10 + 1]; - char buf[2 + 10 + 1]; - char locale[SETLOCALE_NULL_MAX]; - char *codeset; - size_t codesetlen; + char locale[SETLOCALE_NULL_MAX]; if (setlocale_null_r (LC_CTYPE, locale, sizeof (locale))) locale[0] = '\0'; - codeset = buf; + char buf[2 + 10 + 1]; + char *codeset = buf; codeset[0] = '\0'; if (locale[0]) @@ -105,7 +103,7 @@ ctype_codeset (void) codeset = codeset_start; else { - codesetlen = modifier - codeset_start; + size_t codesetlen = modifier - codeset_start; if (codesetlen < sizeof buf) { codeset = memcpy (buf, codeset_start, codesetlen); @@ -121,14 +119,14 @@ ctype_codeset (void) GetACP, which returns the locale's codepage as a number (although this doesn't change according to what the 'setlocale' call specified). Either way, prepend "CP" to make it a valid codeset name. */ - codesetlen = strlen (codeset); + size_t codesetlen = strlen (codeset); if (0 < codesetlen && codesetlen < sizeof buf - 2) memmove (buf + 2, codeset, codesetlen + 1); else sprintf (buf + 2, "%u", GetACP ()); /* For a locale name such as "French_France.65001", in Windows 10, setlocale now returns "French_France.utf8" instead. */ - if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0) + if (streq (buf + 2, "65001") || streq (buf + 2, "utf8")) return (char *) "UTF-8"; else { @@ -209,10 +207,9 @@ static char * nl_langinfo_with_lock (nl_item item) { CRITICAL_SECTION *lock = gl_get_nl_langinfo_lock (); - char *ret; EnterCriticalSection (lock); - ret = nl_langinfo_unlocked (item); + char *ret = nl_langinfo_unlocked (item); LeaveCriticalSection (lock); return ret; @@ -248,11 +245,10 @@ nl_langinfo_with_lock (nl_item item) if (pthread_in_use()) { pthread_mutex_t *lock = gl_get_nl_langinfo_lock (); - char *ret; if (pthread_mutex_lock (lock)) abort (); - ret = nl_langinfo_unlocked (item); + char *ret = nl_langinfo_unlocked (item); if (pthread_mutex_unlock (lock)) abort (); @@ -270,11 +266,10 @@ static char * nl_langinfo_with_lock (nl_item item) { mtx_t *lock = gl_get_nl_langinfo_lock (); - char *ret; if (mtx_lock (lock) != thrd_success) abort (); - ret = nl_langinfo_unlocked (item); + char *ret = nl_langinfo_unlocked (item); if (mtx_unlock (lock) != thrd_success) abort (); @@ -299,10 +294,6 @@ rpl_nl_langinfo (nl_item item) case CODESET: return ctype_codeset (); # endif -# if GNULIB_defined_T_FMT_AMPM - case T_FMT_AMPM: - return (char *) "%I:%M:%S %p"; -# endif # if GNULIB_defined_ALTMON case ALTMON_1: case ALTMON_2: @@ -364,12 +355,6 @@ rpl_nl_langinfo (nl_item item) /* The format is not standardized. In glibc it is a sequence of 10 strings, appended in memory. */ return (char *) "\0\0\0\0\0\0\0\0\0\0"; -# endif -# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS - case YESEXPR: - return (char *) "^[yY]"; - case NOEXPR: - return (char *) "^[nN]"; # endif default: break; diff --git a/gl/open.c b/gl/open.c index d76372fd..c3b5648e 100644 --- a/gl/open.c +++ b/gl/open.c @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -38,13 +38,7 @@ orig_open (const char *filename, int flags, mode_t mode) } /* Specification. */ -#ifdef __osf__ -/* Write "fcntl.h" here, not , otherwise OSF/1 5.1 DTK cc eliminates - this include because of the preliminary #include above. */ -# include "fcntl.h" -#else -# include -#endif +#include #include "cloexec.h" @@ -100,7 +94,7 @@ open (const char *filename, int flags, ...) #endif #if defined _WIN32 && ! defined __CYGWIN__ - if (strcmp (filename, "/dev/null") == 0) + if (streq (filename, "/dev/null")) filename = "NUL"; #endif diff --git a/gl/pathmax.h b/gl/pathmax.h index 5f535517..11c13592 100644 --- a/gl/pathmax.h +++ b/gl/pathmax.h @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2025 Free Software + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/printf-args.c b/gl/printf-args.c index b83ec1e8..2f7bf3da 100644 --- a/gl/printf-args.c +++ b/gl/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2025 Free Software + Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/printf-args.h b/gl/printf-args.h index 6edc570c..e72863ef 100644 --- a/gl/printf-args.h +++ b/gl/printf-args.h @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2025 Free Software + Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/printf-parse.c b/gl/printf-parse.c index 79b35034..34d241a6 100644 --- a/gl/printf-parse.c +++ b/gl/printf-parse.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -323,8 +323,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) } { - arg_type type; - /* Parse argument type/size specifiers. */ /* Relevant for the conversion characters d, i. */ arg_type signed_type = TYPE_INT; @@ -561,6 +559,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) (void) pointer_type; /* Read the conversion character. */ + arg_type type; c = *cp++; switch (c) { @@ -654,17 +653,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) d->count++; if (d->count >= d_allocated) { - size_t memory_size; - DIRECTIVE *memory; - d_allocated = xtimes (d_allocated, 2); - memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); + size_t memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto out_of_memory; - memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir - ? realloc (d->dir, memory_size) - : malloc (memory_size)); + DIRECTIVE *memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir + ? realloc (d->dir, memory_size) + : malloc (memory_size)); if (memory == NULL) /* Out of memory. */ goto out_of_memory; diff --git a/gl/printf-parse.h b/gl/printf-parse.h index 673053b8..17164f0e 100644 --- a/gl/printf-parse.h +++ b/gl/printf-parse.h @@ -1,5 +1,5 @@ /* Parse printf format string. - Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2025 Free Software + Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/pthread-once.c b/gl/pthread-once.c index b19dae50..823f0639 100644 --- a/gl/pthread-once.c +++ b/gl/pthread-once.c @@ -1,5 +1,5 @@ /* POSIX once-only control. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/pthread.h b/gl/pthread.h deleted file mode 100644 index 599f1633..00000000 --- a/gl/pthread.h +++ /dev/null @@ -1,2571 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Implement the most essential subset of POSIX pthread.h. - - Copyright (C) 2009-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */ - -#if __GNUC__ >= 3 -#pragma GCC system_header -#endif - - -#if defined _GL_ALREADY_INCLUDING_PTHREAD_H -/* Special invocation convention: - On Android, we have a sequence of nested includes - -> -> -> -> - -> . - In this situation, PTHREAD_COND_INITIALIZER is not yet defined, - therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc. */ - -#include_next - -#else -/* Normal invocation convention. */ - -#ifndef _GL_PTHREAD_H_ - -#if 1 - -# define _GL_ALREADY_INCLUDING_PTHREAD_H - -/* The include_next requires a split double-inclusion guard. */ -# include_next - -# undef _GL_ALREADY_INCLUDING_PTHREAD_H - -#endif - -#ifndef _GL_PTHREAD_H_ -#define _GL_PTHREAD_H_ - -/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, - HAVE_RAW_DECL_*. */ -#if !_GL_CONFIG_H_INCLUDED - #error "Please include config.h first." -#endif - -#define __need_system_stdlib_h -#include -#undef __need_system_stdlib_h - - -/* The pthreads-win32 defines a couple of broken macros. */ -#undef asctime_r -#undef ctime_r -#undef gmtime_r -#undef localtime_r -#undef rand_r -#undef strtok_r - -#include -#include -#include -#include - -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The attribute __pure__ was added in gcc 2.96. */ -#ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define _GL_ATTRIBUTE_PURE /* empty */ -# endif -#endif - -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -/* C++ compatible function declaration macros. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _GL_CXXDEFS_H -#define _GL_CXXDEFS_H - -/* Begin/end the GNULIB_NAMESPACE namespace. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { -# define _GL_END_NAMESPACE } -#else -# define _GL_BEGIN_NAMESPACE -# define _GL_END_NAMESPACE -#endif - -/* The three most frequent use cases of these macros are: - - * For providing a substitute for a function that is missing on some - platforms, but is declared and works fine on the platforms on which - it exists: - - #if @GNULIB_FOO@ - # if !@HAVE_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on all platforms, - but is broken/insufficient and needs to be replaced on some platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on some platforms - but is broken/insufficient and needs to be replaced on some of them and - is additionally either missing or undeclared on some other platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif -*/ - -/* _GL_EXTERN_C declaration; - performs the declaration with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C extern "C" -#else -# define _GL_EXTERN_C extern -#endif - -/* _GL_EXTERN_C_FUNC declaration; - performs the declaration of a function with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C_FUNC extern "C" -#else -/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax - are not allowed between 'extern' and the return type (see gnulib-common.m4). - */ -# define _GL_EXTERN_C_FUNC -#endif - -/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]); - declares a replacement function, named rpl_func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...), - _GL_ARG_NONNULL ((1))); - - Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front - of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's - because - [[...]] extern "C" ; - is invalid syntax in C++.) - */ -#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \ - _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__) -#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters - -/* _GL_FUNCDECL_SYS_NAME (func) expands to plain func if C++, and to - parenthesized func otherwise. Parenthesization is needed in C23 if - the function is like strchr and so is a qualifier-generic macro - that expands to something more complicated. */ -#ifdef __cplusplus -# define _GL_FUNCDECL_SYS_NAME(func) func -#else -# define _GL_FUNCDECL_SYS_NAME(func) (func) -#endif - -/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); - declares the system function, named func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); - */ -#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype _GL_FUNCDECL_SYS_NAME (func) parameters - -/* _GL_CXXALIAS_RPL (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to rpl_func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - - Wrapping rpl_func in an object with an inline conversion operator - avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::rpl_func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA (func, rettype, parameters); - is to be used when func is a Microsoft deprecated alias, on native Windows. - It declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to _func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); - */ -#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); - is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); - except that the C function rpl_func may have a slightly different - declaration. A cast is used to silence the "invalid conversion" error - that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::rpl_func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_MDA (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_SYS (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to the system provided function func, if GNULIB_NAMESPACE - is defined. - Example: - _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - - Wrapping func in an object with an inline conversion operator - avoids a reference to func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function is picked among a set of overloaded functions, - namely the one with rettype2 and parameters2. Two consecutive casts - are used to silence the "cannot find a match" and "invalid conversion" - errors that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE - /* The outer cast must be a reinterpret_cast. - The inner cast: When the function is defined as a set of overloaded - functions, it works as a static_cast<>, choosing the designated variant. - When the function is defined as a single variant, it works as a - reinterpret_cast<>. The parenthesized cast syntax works both ways. */ -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast((rettype2 (*) parameters2)(::func)); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN (func); - causes a warning to be emitted when ::func is used but not when - GNULIB_NAMESPACE::func is used. func must be defined without overloaded - variants. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN(func) \ - _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN_1(func,namespace) \ - _GL_CXXALIASWARN_2 (func, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_WARN_ON_USE (func, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN_2(func,namespace) \ - extern __typeof__ (func) func -# else -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN(func) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); - causes a warning to be emitted when the given overloaded variant of ::func - is used but not when GNULIB_NAMESPACE::func is used. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ - GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ - _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# else -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -#endif /* _GL_CXXDEFS_H */ - -/* The definition of _Noreturn is copied here. */ -/* A C macro for declaring that a function does not return. - Copyright (C) 2011-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* The _Noreturn keyword of C11. - Do not use [[noreturn]], because with it the syntax - extern _Noreturn void func (...); - would not be valid; such a declaration would be valid only with 'extern' - and '_Noreturn' swapped, or without the 'extern' keyword. However, some - AIX system header files and several gnulib header files use precisely - this syntax with 'extern'. So even though C23 deprecates _Noreturn, - it is currently more portable to prefer it to [[noreturn]]. - - Also, do not try to work around LLVM bug 59792 (clang 15 or earlier). - This rare bug can be worked around by compiling with 'clang -D_Noreturn=', - though the workaround may generate many false-alarm warnings. */ -#ifndef _Noreturn -# if ((!defined __cplusplus || defined __clang__) \ - && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0))) - /* _Noreturn works as-is. */ -# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \ - || 0x5110 <= __SUNPRO_C) - /* Prefer __attribute__ ((__noreturn__)) to plain _Noreturn even if the - latter works, as 'gcc -std=gnu99 -Wpedantic' warns about _Noreturn. */ -# define _Noreturn __attribute__ ((__noreturn__)) -# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn -# endif -#endif - -/* The definition of _GL_ARG_NONNULL is copied here. */ -/* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools - that the values passed as arguments n, ..., m must be non-NULL pointers. - n = 1 stands for the first argument, n = 2 for the second argument etc. */ -#ifndef _GL_ARG_NONNULL -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ -# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) -# else -# define _GL_ARG_NONNULL(params) -# endif -#endif - -/* The definition of _GL_WARN_ON_USE is copied here. */ -/* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* _GL_WARN_ON_USE (function, "literal string") issues a declaration - for FUNCTION which will then trigger a compiler warning containing - the text of "literal string" anywhere that function is called, if - supported by the compiler. If the compiler does not support this - feature, the macro expands to an unused extern declaration. - - _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the - attribute used in _GL_WARN_ON_USE. If the compiler does not support - this feature, it expands to empty. - - These macros are useful for marking a function as a potential - portability trap, with the intent that "literal string" include - instructions on the replacement function that should be used - instead. - _GL_WARN_ON_USE is for functions with 'extern' linkage. - _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' - linkage. - - _GL_WARN_ON_USE should not be used more than once for a given function - in a given compilation unit (because this may generate a warning even - if the function is never called). - - However, one of the reasons that a function is a portability trap is - if it has the wrong signature. Declaring FUNCTION with a different - signature in C is a compilation error, so this macro must use the - same type as any existing declaration so that programs that avoid - the problematic FUNCTION do not fail to compile merely because they - included a header that poisoned the function. But this implies that - _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already - have a declaration. Use of this macro implies that there must not - be any other macro hiding the declaration of FUNCTION; but - undefining FUNCTION first is part of the poisoning process anyway - (although for symbols that are provided only via a macro, the result - is a compilation error rather than a warning containing - "literal string"). Also note that in C++, it is only safe to use if - FUNCTION has no overloads. - - For an example, it is possible to poison 'getline' by: - - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], - [getline]) in configure.ac, which potentially defines - HAVE_RAW_DECL_GETLINE - - adding this code to a header that wraps the system : - #undef getline - #if HAVE_RAW_DECL_GETLINE - _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" - "not universally present; use the gnulib module getline"); - #endif - - It is not possible to directly poison global variables. But it is - possible to write a wrapper accessor function, and poison that - (less common usage, like &environ, will cause a compilation error - rather than issue the nice warning, but the end result of informing - the developer about their portability problem is still achieved): - #if HAVE_RAW_DECL_ENVIRON - static char *** - rpl_environ (void) { return &environ; } - _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); - # undef environ - # define environ (*rpl_environ ()) - #endif - or better (avoiding contradictory use of 'static' and 'extern'): - #if HAVE_RAW_DECL_ENVIRON - static char *** - _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") - rpl_environ (void) { return &environ; } - # undef environ - # define environ (*rpl_environ ()) - #endif - */ -#ifndef _GL_WARN_ON_USE - -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__warning__ (message))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# else /* Unsupported. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# endif -#endif - -/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") - is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the - function is declared with the given prototype, consisting of return type, - parameters, and attributes. - This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does - not work in this case. */ -#ifndef _GL_WARN_ON_USE_CXX -# if !defined __cplusplus -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ - _GL_WARN_ON_USE (function, msg) -# else -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_clang function parameters_and_attributes \ - __attribute__ ((__diagnose_if__ (1, msg, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# endif -# endif -#endif - -/* _GL_WARN_EXTERN_C declaration; - performs the declaration with C linkage. */ -#ifndef _GL_WARN_EXTERN_C -# if defined __cplusplus -# define _GL_WARN_EXTERN_C extern "C" -# else -# define _GL_WARN_EXTERN_C extern -# endif -#endif - -/* =========== Thread types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-thread.h" -# if 1 -# define pthread_t rpl_pthread_t -# define pthread_attr_t rpl_pthread_attr_t -# endif -# if !GNULIB_defined_pthread_thread_types -typedef glwthread_thread_t pthread_t; -typedef unsigned int pthread_attr_t; -# define GNULIB_defined_pthread_thread_types 1 -# endif -# else -# if 1 -# define pthread_t rpl_pthread_t -# define pthread_attr_t rpl_pthread_attr_t -# endif -# if !GNULIB_defined_pthread_thread_types -typedef int pthread_t; -typedef unsigned int pthread_attr_t; -# define GNULIB_defined_pthread_thread_types 1 -# endif -# endif -# undef PTHREAD_CREATE_JOINABLE -# undef PTHREAD_CREATE_DETACHED -# define PTHREAD_CREATE_JOINABLE 0 -# define PTHREAD_CREATE_DETACHED 1 -#else -# if !1 -# if !GNULIB_defined_pthread_thread_types -typedef int pthread_t; -typedef unsigned int pthread_attr_t; -# define GNULIB_defined_pthread_thread_types 1 -# endif -# endif -# if !1 -# define PTHREAD_CREATE_JOINABLE 0 -# define PTHREAD_CREATE_DETACHED 1 -# endif -#endif - -/* =========== Once-only control (initialization) types and macros ========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 1 -# include "windows-once.h" -# if 1 -# define pthread_once_t rpl_pthread_once_t -# endif -# if !GNULIB_defined_pthread_once_types -typedef glwthread_once_t pthread_once_t; -# define GNULIB_defined_pthread_once_types 1 -# endif -# undef PTHREAD_ONCE_INIT -# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT -# else -# if 1 -# define pthread_once_t rpl_pthread_once_t -# endif -# if !GNULIB_defined_pthread_once_types -typedef int pthread_once_t; -# define GNULIB_defined_pthread_once_types 1 -# endif -# undef PTHREAD_ONCE_INIT -# define PTHREAD_ONCE_INIT { 0 } -# endif -#else -# if !1 -# if !GNULIB_defined_pthread_once_types -typedef int pthread_once_t; -# define GNULIB_defined_pthread_once_types 1 -# endif -# undef PTHREAD_ONCE_INIT -# define PTHREAD_ONCE_INIT { 0 } -# endif -#endif - -/* =========== Mutex types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-timedmutex.h" -# include "windows-timedrecmutex.h" -# if 1 -# define pthread_mutex_t rpl_pthread_mutex_t -# define pthread_mutexattr_t rpl_pthread_mutexattr_t -# endif -# if !GNULIB_defined_pthread_mutex_types -typedef struct - { - int type; - union - { - glwthread_timedmutex_t u_timedmutex; - glwthread_timedrecmutex_t u_timedrecmutex; - } - u; - } - pthread_mutex_t; -typedef unsigned int pthread_mutexattr_t; -# define GNULIB_defined_pthread_mutex_types 1 -# endif -# undef PTHREAD_MUTEX_INITIALIZER -# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } } -# else -# if 1 -# define pthread_mutex_t rpl_pthread_mutex_t -# define pthread_mutexattr_t rpl_pthread_mutexattr_t -# endif -# if !GNULIB_defined_pthread_mutex_types -typedef int pthread_mutex_t; -typedef unsigned int pthread_mutexattr_t; -# define GNULIB_defined_pthread_mutex_types 1 -# endif -# undef PTHREAD_MUTEX_INITIALIZER -# define PTHREAD_MUTEX_INITIALIZER { 0 } -# endif -# undef PTHREAD_MUTEX_DEFAULT -# undef PTHREAD_MUTEX_NORMAL -# undef PTHREAD_MUTEX_ERRORCHECK -# undef PTHREAD_MUTEX_RECURSIVE -# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL -# define PTHREAD_MUTEX_NORMAL 0 -# define PTHREAD_MUTEX_ERRORCHECK 1 -# define PTHREAD_MUTEX_RECURSIVE 2 -# undef PTHREAD_MUTEX_STALLED -# undef PTHREAD_MUTEX_ROBUST -# define PTHREAD_MUTEX_STALLED 0 -# define PTHREAD_MUTEX_ROBUST 1 -#else -# if !1 -# if !GNULIB_defined_pthread_mutex_types -typedef int pthread_mutex_t; -typedef unsigned int pthread_mutexattr_t; -# define GNULIB_defined_pthread_mutex_types 1 -# endif -# undef PTHREAD_MUTEX_INITIALIZER -# define PTHREAD_MUTEX_INITIALIZER { 0 } -# endif -# if !1 -# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL -# define PTHREAD_MUTEX_NORMAL 0 -# define PTHREAD_MUTEX_ERRORCHECK 1 -# define PTHREAD_MUTEX_RECURSIVE 2 -# endif -# if !1 -# define PTHREAD_MUTEX_STALLED 0 -# define PTHREAD_MUTEX_ROBUST 1 -# endif -#endif - -/* =========== Read-write lock types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-timedrwlock.h" -# if 1 -# define pthread_rwlock_t rpl_pthread_rwlock_t -# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t -# endif -# if !GNULIB_defined_pthread_rwlock_types -typedef glwthread_timedrwlock_t pthread_rwlock_t; -typedef unsigned int pthread_rwlockattr_t; -# define GNULIB_defined_pthread_rwlock_types 1 -# endif -# undef PTHREAD_RWLOCK_INITIALIZER -# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT -# else -# if 1 -# define pthread_rwlock_t rpl_pthread_rwlock_t -# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t -# endif -# if !GNULIB_defined_pthread_rwlock_types -typedef int pthread_rwlock_t; -typedef unsigned int pthread_rwlockattr_t; -# define GNULIB_defined_pthread_rwlock_types 1 -# endif -# undef PTHREAD_RWLOCK_INITIALIZER -# define PTHREAD_RWLOCK_INITIALIZER { 0 } -# endif -#elif 0 && 0 /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */ -# if 1 -# define pthread_rwlock_t rpl_pthread_rwlock_t -# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t -# endif -# if !GNULIB_defined_pthread_rwlock_types -typedef struct - { - pthread_mutex_t lock; /* protects the remaining fields */ - pthread_cond_t waiting_readers; /* waiting readers */ - pthread_cond_t waiting_writers; /* waiting writers */ - unsigned int waiting_writers_count; /* number of waiting writers */ - int runcount; /* number of readers running, or -1 when a writer runs */ - } - pthread_rwlock_t; -typedef unsigned int pthread_rwlockattr_t; -# define GNULIB_defined_pthread_rwlock_types 1 -# endif -# undef PTHREAD_RWLOCK_INITIALIZER -# define PTHREAD_RWLOCK_INITIALIZER \ - { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } -#elif 0 && 0 /* i.e. PTHREAD_RWLOCK_BAD_WAITQUEUE */ -/* Use rwlocks of kind PREFER_WRITER or PREFER_WRITER_NONRECURSIVE instead of - the DEFAULT. */ -# undef PTHREAD_RWLOCK_INITIALIZER -# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP -#else -# if 1 -# if !defined PTHREAD_RWLOCK_INITIALIZER && defined PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */ -# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP -# endif -# else -# if !GNULIB_defined_pthread_rwlock_types -typedef int pthread_rwlock_t; -typedef unsigned int pthread_rwlockattr_t; -# define GNULIB_defined_pthread_rwlock_types 1 -# endif -# undef PTHREAD_RWLOCK_INITIALIZER -# define PTHREAD_RWLOCK_INITIALIZER { 0 } -# endif -#endif - -/* =========== Condition variable types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-cond.h" -# if 1 -# define pthread_cond_t rpl_pthread_cond_t -# define pthread_condattr_t rpl_pthread_condattr_t -# endif -# if !GNULIB_defined_pthread_cond_types -typedef glwthread_cond_t pthread_cond_t; -typedef unsigned int pthread_condattr_t; -# define GNULIB_defined_pthread_cond_types 1 -# endif -# undef PTHREAD_COND_INITIALIZER -# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT -# else -# if 1 -# define pthread_cond_t rpl_pthread_cond_t -# define pthread_condattr_t rpl_pthread_condattr_t -# endif -# if !GNULIB_defined_pthread_cond_types -typedef int pthread_cond_t; -typedef unsigned int pthread_condattr_t; -# define GNULIB_defined_pthread_cond_types 1 -# endif -# undef PTHREAD_COND_INITIALIZER -# define PTHREAD_COND_INITIALIZER { 0 } -# endif -#else -# if !1 -# if !GNULIB_defined_pthread_cond_types -typedef int pthread_cond_t; -typedef unsigned int pthread_condattr_t; -# define GNULIB_defined_pthread_cond_types 1 -# endif -# undef PTHREAD_COND_INITIALIZER -# define PTHREAD_COND_INITIALIZER { 0 } -# endif -#endif - -/* =========== Thread-specific storage types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-tls.h" -# if 1 -# define pthread_key_t rpl_pthread_key_t -# endif -# if !GNULIB_defined_pthread_tss_types -typedef glwthread_tls_key_t pthread_key_t; -# define GNULIB_defined_pthread_tss_types 1 -# endif -# undef PTHREAD_DESTRUCTOR_ITERATIONS -# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS -# else -# if 1 -# define pthread_key_t rpl_pthread_key_t -# endif -# if !GNULIB_defined_pthread_tss_types -typedef void ** pthread_key_t; -# define GNULIB_defined_pthread_tss_types 1 -# endif -# undef PTHREAD_DESTRUCTOR_ITERATIONS -# define PTHREAD_DESTRUCTOR_ITERATIONS 0 -# endif -#else -# if !1 -# if !GNULIB_defined_pthread_tss_types -typedef void ** pthread_key_t; -# define GNULIB_defined_pthread_tss_types 1 -# endif -# undef PTHREAD_DESTRUCTOR_ITERATIONS -# define PTHREAD_DESTRUCTOR_ITERATIONS 0 -# endif -#endif - -/* =========== Spinlock types and macros =========== */ - -#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS -# if 0 -# include "windows-spin.h" -# if 1 -# define pthread_spinlock_t rpl_pthread_spinlock_t -# endif -# if !GNULIB_defined_pthread_spin_types -typedef glwthread_spinlock_t pthread_spinlock_t; -# define GNULIB_defined_pthread_spin_types 1 -# endif -# else -# if 1 -# define pthread_spinlock_t rpl_pthread_spinlock_t -# endif -# if !GNULIB_defined_pthread_spin_types -typedef pthread_mutex_t pthread_spinlock_t; -# define GNULIB_defined_pthread_spin_types 1 -# endif -# endif -# undef PTHREAD_PROCESS_PRIVATE -# undef PTHREAD_PROCESS_SHARED -# define PTHREAD_PROCESS_PRIVATE 0 -# define PTHREAD_PROCESS_SHARED 1 -#else -# if 1 -/* exists and defines pthread_spinlock_t. */ -# if !1 || 0 -/* If the 'pthread-spin' module is in use, it defines all the pthread_spin* - functions. Prepare for it by overriding pthread_spinlock_t if that might - be needed. */ -# if !(((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \ - || __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) \ - || (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \ - && !defined __ANDROID__) \ - || __clang_major__ >= 3)) \ - && !defined __ibmxl__) -/* We can't use GCC built-ins. Approximate spinlocks with mutexes. */ -# if !GNULIB_defined_pthread_spin_types -# define pthread_spinlock_t pthread_mutex_t -# define GNULIB_defined_pthread_spin_types 1 -# endif -# endif -# endif -# else -/* Approximate spinlocks with mutexes. */ -# if !GNULIB_defined_pthread_spin_types -typedef pthread_mutex_t pthread_spinlock_t; -# define GNULIB_defined_pthread_spin_types 1 -# endif -# endif -# if !1 -# define PTHREAD_PROCESS_PRIVATE 0 -# define PTHREAD_PROCESS_SHARED 1 -# endif -#endif - -/* =========== Other types and macros =========== */ - -#if !1 -# if !GNULIB_defined_other_pthread_types -typedef int pthread_barrier_t; -typedef unsigned int pthread_barrierattr_t; -# define GNULIB_defined_other_pthread_types 1 -# endif -#endif - -#if !defined PTHREAD_CANCELED - -# define PTHREAD_BARRIER_SERIAL_THREAD (-1) - -# define PTHREAD_CANCEL_DEFERRED 0 -# define PTHREAD_CANCEL_ASYNCHRONOUS 1 - -# define PTHREAD_CANCEL_ENABLE 0 -# define PTHREAD_CANCEL_DISABLE 1 - -# define PTHREAD_CANCELED ((void *) -1) - -# define PTHREAD_INHERIT_SCHED 0 -# define PTHREAD_EXPLICIT_SCHED 1 - -# define PTHREAD_PRIO_NONE 0 -# define PTHREAD_PRIO_INHERIT 1 -# define PTHREAD_PRIO_PROTECT 2 - -# define PTHREAD_SCOPE_SYSTEM 0 -# define PTHREAD_SCOPE_PROCESS 1 - -#endif - -/* =========== Thread functions =========== */ - -#if 0 -/* The 'restrict' qualifier on ARG is nonsense, but POSIX specifies it this way. - Sigh. */ -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_create -# define pthread_create rpl_pthread_create -# endif -_GL_FUNCDECL_RPL (pthread_create, int, - (pthread_t *restrict threadp, - const pthread_attr_t *restrict attr, - void * (*mainfunc) (void *), void *restrict arg), - _GL_ARG_NONNULL ((1, 3))); -_GL_CXXALIAS_RPL (pthread_create, int, - (pthread_t *restrict threadp, - const pthread_attr_t *restrict attr, - void * (*mainfunc) (void *), void *restrict arg)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_create, int, - (pthread_t *restrict threadp, - const pthread_attr_t *restrict attr, - void * (*mainfunc) (void *), void *restrict arg), - _GL_ARG_NONNULL ((1, 3))); -# endif -_GL_CXXALIAS_SYS_CAST (pthread_create, int, - (pthread_t *restrict threadp, - const pthread_attr_t *restrict attr, - void * (*mainfunc) (void *), void *restrict arg)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_create); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_CREATE -_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_attr_init -# define pthread_attr_init rpl_pthread_attr_init -# endif -_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_attr_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT -_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_attr_getdetachstate -# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate -# endif -_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int, - (const pthread_attr_t *attr, int *detachstatep), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int, - (const pthread_attr_t *attr, int *detachstatep)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int, - (const pthread_attr_t *attr, int *detachstatep), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int, - (const pthread_attr_t *attr, int *detachstatep)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_attr_getdetachstate); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE -_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_attr_setdetachstate -# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate -# endif -_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int, - (pthread_attr_t *attr, int detachstate), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int, - (pthread_attr_t *attr, int detachstate)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int, - (pthread_attr_t *attr, int detachstate), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int, - (pthread_attr_t *attr, int detachstate)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_attr_setdetachstate); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE -_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_attr_destroy -# define pthread_attr_destroy rpl_pthread_attr_destroy -# endif -_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_attr_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY -_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_self -# define pthread_self rpl_pthread_self -# endif -_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE); -_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE); -# endif -_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_self); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SELF -_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_equal -# define pthread_equal rpl_pthread_equal -# endif -_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2), ); -_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2), ); -# endif -_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_equal); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_EQUAL -_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_detach -# define pthread_detach rpl_pthread_detach -# endif -_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread), ); -_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread), ); -# endif -_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_detach); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_DETACH -_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_join -# define pthread_join rpl_pthread_join -# endif -_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep), ); -_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep), ); -# endif -_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_join); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_JOIN -_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_exit -# define pthread_exit rpl_pthread_exit -# endif -_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value), ); -_GL_CXXALIAS_RPL (pthread_exit, void, (void *value)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value), ); -# endif -/* Need to cast because of AIX with xlclang++. */ -_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_exit); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_EXIT -_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - " - "use gnulib module pthread-thread for portability"); -# endif -#endif - -/* =========== Once-only control (initialization) functions =========== */ - -#if 1 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_once -# define pthread_once rpl_pthread_once -# endif -_GL_FUNCDECL_RPL (pthread_once, int, - (pthread_once_t *once_control, void (*initfunction) (void)), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_once, int, - (pthread_once_t *once_control, void (*initfunction) (void))); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_once, int, - (pthread_once_t *once_control, void (*initfunction) (void)), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS_CAST (pthread_once, int, - (pthread_once_t *once_control, - void (*initfunction) (void))); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_once); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_ONCE -_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - " - "use gnulib module pthread-once for portability"); -# endif -#endif - -/* =========== Mutex functions =========== */ - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_init -# define pthread_mutex_init rpl_pthread_mutex_init -# endif -_GL_FUNCDECL_RPL (pthread_mutex_init, int, - (pthread_mutex_t *restrict mutex, - const pthread_mutexattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutex_init, int, - (pthread_mutex_t *restrict mutex, - const pthread_mutexattr_t *restrict attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_init, int, - (pthread_mutex_t *restrict mutex, - const pthread_mutexattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_init, int, - (pthread_mutex_t *restrict mutex, - const pthread_mutexattr_t *restrict attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT -_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_init -# define pthread_mutexattr_init rpl_pthread_mutexattr_init -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT -_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_gettype -# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict typep), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict typep)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict typep), - _GL_ARG_NONNULL ((1, 2))); -# endif -/* Need to cast, because on FreeBSD the first parameter is - pthread_mutexattr_t *attr. */ -_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict typep)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_gettype); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE -_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_settype -# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int, - (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int, - (pthread_mutexattr_t *attr, int type)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int, - (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int, - (pthread_mutexattr_t *attr, int type)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_settype); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE -_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_getrobust -# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict robustp), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict robustp)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict robustp), - _GL_ARG_NONNULL ((1, 2))); -# endif -/* Need to cast, because on FreeBSD the first parameter is - pthread_mutexattr_t *attr. */ -_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int, - (const pthread_mutexattr_t *restrict attr, - int *restrict robustp)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_getrobust); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST -_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_setrobust -# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int, - (pthread_mutexattr_t *attr, int robust), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int, - (pthread_mutexattr_t *attr, int robust)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int, - (pthread_mutexattr_t *attr, int robust), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int, - (pthread_mutexattr_t *attr, int robust)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_setrobust); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST -_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutexattr_destroy -# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy -# endif -_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutexattr_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY -_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_lock -# define pthread_mutex_lock rpl_pthread_mutex_lock -# endif -_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_lock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK -_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_trylock -# define pthread_mutex_trylock rpl_pthread_mutex_trylock -# endif -_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_trylock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK -_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_timedlock -# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock -# endif -_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int, - (pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int, - (pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int, - (pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, - (pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_timedlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK -_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - " - "use gnulib module pthread_mutex_timedlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_unlock -# define pthread_mutex_unlock rpl_pthread_mutex_unlock -# endif -_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_unlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK -_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_mutex_destroy -# define pthread_mutex_destroy rpl_pthread_mutex_destroy -# endif -_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_mutex_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY -_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - " - "use gnulib module pthread-mutex for portability"); -# endif -#endif - -/* =========== Read-write lock functions =========== */ - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_init -# define pthread_rwlock_init rpl_pthread_rwlock_init -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_init, int, - (pthread_rwlock_t *restrict lock, - const pthread_rwlockattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_init, int, - (pthread_rwlock_t *restrict lock, - const pthread_rwlockattr_t *restrict attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_init, int, - (pthread_rwlock_t *restrict lock, - const pthread_rwlockattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_init, int, - (pthread_rwlock_t *restrict lock, - const pthread_rwlockattr_t *restrict attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT -_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlockattr_init -# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init -# endif -_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlockattr_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT -_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlockattr_destroy -# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy -# endif -_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int, - (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int, - (pthread_rwlockattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int, - (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int, - (pthread_rwlockattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlockattr_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY -_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_rdlock -# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_rdlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK -_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_wrlock -# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_wrlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK -_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_tryrdlock -# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_tryrdlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK -_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_trywrlock -# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_trywrlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK -_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_timedrdlock -# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_timedrdlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK -_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_timedwrlock -# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int, - (pthread_rwlock_t *restrict lock, - const struct timespec *restrict abstime)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_timedwrlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK -_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_unlock -# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_unlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK -_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_rwlock_destroy -# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy -# endif -_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_rwlock_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY -_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - " - "use gnulib module pthread-rwlock for portability"); -# endif -#endif - -/* =========== Condition variable functions =========== */ - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_init -# define pthread_cond_init rpl_pthread_cond_init -# endif -_GL_FUNCDECL_RPL (pthread_cond_init, int, - (pthread_cond_t *restrict cond, - const pthread_condattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_cond_init, int, - (pthread_cond_t *restrict cond, - const pthread_condattr_t *restrict attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_init, int, - (pthread_cond_t *restrict cond, - const pthread_condattr_t *restrict attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_init, int, - (pthread_cond_t *restrict cond, - const pthread_condattr_t *restrict attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_INIT -_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_condattr_init -# define pthread_condattr_init rpl_pthread_condattr_init -# endif -_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_condattr_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT -_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_condattr_destroy -# define pthread_condattr_destroy rpl_pthread_condattr_destroy -# endif -_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_condattr_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY -_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_wait -# define pthread_cond_wait rpl_pthread_cond_wait -# endif -_GL_FUNCDECL_RPL (pthread_cond_wait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex), - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (pthread_cond_wait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_wait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex), - _GL_ARG_NONNULL ((1, 2))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_wait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_wait); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_WAIT -_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_timedwait -# define pthread_cond_timedwait rpl_pthread_cond_timedwait -# endif -_GL_FUNCDECL_RPL (pthread_cond_timedwait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2, 3))); -_GL_CXXALIAS_RPL (pthread_cond_timedwait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_timedwait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime), - _GL_ARG_NONNULL ((1, 2, 3))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_timedwait, int, - (pthread_cond_t *restrict cond, - pthread_mutex_t *restrict mutex, - const struct timespec *restrict abstime)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_timedwait); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT -_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_signal -# define pthread_cond_signal rpl_pthread_cond_signal -# endif -_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_signal); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL -_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_broadcast -# define pthread_cond_broadcast rpl_pthread_cond_broadcast -# endif -_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_broadcast); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST -_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_cond_destroy -# define pthread_cond_destroy rpl_pthread_cond_destroy -# endif -_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_cond_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY -_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - " - "use gnulib module pthread-cond for portability"); -# endif -#endif - -/* =========== Thread-specific storage functions =========== */ - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_key_create -# define pthread_key_create rpl_pthread_key_create -# endif -_GL_FUNCDECL_RPL (pthread_key_create, int, - (pthread_key_t *keyp, void (*destructor) (void *)), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_key_create, int, - (pthread_key_t *keyp, void (*destructor) (void *))); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_key_create, int, - (pthread_key_t *keyp, void (*destructor) (void *)), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS_CAST (pthread_key_create, int, - (pthread_key_t *keyp, void (*destructor) (void *))); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_key_create); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE -_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - " - "use gnulib module pthread-tss for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_setspecific -# define pthread_setspecific rpl_pthread_setspecific -# endif -_GL_FUNCDECL_RPL (pthread_setspecific, int, - (pthread_key_t key, const void *value), ); -_GL_CXXALIAS_RPL (pthread_setspecific, int, - (pthread_key_t key, const void *value)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_setspecific, int, - (pthread_key_t key, const void *value), ); -# endif -_GL_CXXALIAS_SYS (pthread_setspecific, int, - (pthread_key_t key, const void *value)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_setspecific); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC -_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - " - "use gnulib module pthread-tss for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_getspecific -# define pthread_getspecific rpl_pthread_getspecific -# endif -_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key), ); -_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key), ); -# endif -_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_getspecific); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC -_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - " - "use gnulib module pthread-tss for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_key_delete -# define pthread_key_delete rpl_pthread_key_delete -# endif -_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key), ); -_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key), ); -# endif -_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_key_delete); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE -_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - " - "use gnulib module pthread-tss for portability"); -# endif -#endif - -/* =========== Spinlock functions =========== */ - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_spin_init -# define pthread_spin_init rpl_pthread_spin_init -# endif -_GL_FUNCDECL_RPL (pthread_spin_init, int, - (pthread_spinlock_t *lock, int shared_across_processes), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_spin_init, int, - (pthread_spinlock_t *lock, int shared_across_processes)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_spin_init, int, - (pthread_spinlock_t *lock, int shared_across_processes), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_spin_init, int, - (pthread_spinlock_t *lock, int shared_across_processes)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_spin_init); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT -_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - " - "use gnulib module pthread-spin for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_spin_lock -# define pthread_spin_lock rpl_pthread_spin_lock -# endif -_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_spin_lock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK -_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - " - "use gnulib module pthread-spin for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_spin_trylock -# define pthread_spin_trylock rpl_pthread_spin_trylock -# endif -_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_spin_trylock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK -_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - " - "use gnulib module pthread-spin for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_spin_unlock -# define pthread_spin_unlock rpl_pthread_spin_unlock -# endif -_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_spin_unlock); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK -_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - " - "use gnulib module pthread-spin for portability"); -# endif -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef pthread_spin_destroy -# define pthread_spin_destroy rpl_pthread_spin_destroy -# endif -_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); -# else -# if !1 -_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (pthread_spin_destroy); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY -_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " - "use gnulib module pthread-spin for portability"); -# endif -#endif - - -#if defined __cplusplus && defined GNULIB_NAMESPACE && !1 && defined __MINGW32__ -/* Provide the symbols required by mingw's . */ -using GNULIB_NAMESPACE::pthread_create; -using GNULIB_NAMESPACE::pthread_self; -using GNULIB_NAMESPACE::pthread_equal; -using GNULIB_NAMESPACE::pthread_detach; -using GNULIB_NAMESPACE::pthread_join; -using GNULIB_NAMESPACE::pthread_once; -using GNULIB_NAMESPACE::pthread_mutex_init; -using GNULIB_NAMESPACE::pthread_mutexattr_init; -using GNULIB_NAMESPACE::pthread_mutexattr_settype; -using GNULIB_NAMESPACE::pthread_mutexattr_destroy; -using GNULIB_NAMESPACE::pthread_mutex_lock; -using GNULIB_NAMESPACE::pthread_mutex_trylock; -using GNULIB_NAMESPACE::pthread_mutex_timedlock; -using GNULIB_NAMESPACE::pthread_mutex_unlock; -using GNULIB_NAMESPACE::pthread_mutex_destroy; -using GNULIB_NAMESPACE::pthread_cond_wait; -using GNULIB_NAMESPACE::pthread_cond_timedwait; -using GNULIB_NAMESPACE::pthread_cond_signal; -using GNULIB_NAMESPACE::pthread_cond_broadcast; -using GNULIB_NAMESPACE::pthread_cond_destroy; -using GNULIB_NAMESPACE::pthread_key_create; -using GNULIB_NAMESPACE::pthread_setspecific; -using GNULIB_NAMESPACE::pthread_getspecific; -using GNULIB_NAMESPACE::pthread_key_delete; -#endif - - -#endif /* _GL_PTHREAD_H_ */ -#endif /* _GL_PTHREAD_H_ */ -#endif diff --git a/gl/pthread.in.h b/gl/pthread.in.h index 28592cfc..37deab82 100644 --- a/gl/pthread.in.h +++ b/gl/pthread.in.h @@ -1,6 +1,6 @@ /* Implement the most essential subset of POSIX pthread.h. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -522,7 +522,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_create, int, _GL_CXXALIASWARN (pthread_create); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_create # if HAVE_RAW_DECL_PTHREAD_CREATE _GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - " "use gnulib module pthread-thread for portability"); @@ -549,7 +548,6 @@ _GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr)); _GL_CXXALIASWARN (pthread_attr_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_attr_init # if HAVE_RAW_DECL_PTHREAD_ATTR_INIT _GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - " "use gnulib module pthread-thread for portability"); @@ -580,7 +578,6 @@ _GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int, _GL_CXXALIASWARN (pthread_attr_getdetachstate); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_attr_getdetachstate # if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE _GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - " "use gnulib module pthread-thread for portability"); @@ -611,7 +608,6 @@ _GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int, _GL_CXXALIASWARN (pthread_attr_setdetachstate); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_attr_setdetachstate # if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE _GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - " "use gnulib module pthread-thread for portability"); @@ -638,7 +634,6 @@ _GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)); _GL_CXXALIASWARN (pthread_attr_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_attr_destroy # if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY _GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - " "use gnulib module pthread-thread for portability"); @@ -663,7 +658,6 @@ _GL_CXXALIAS_SYS (pthread_self, pthread_t, (void)); _GL_CXXALIASWARN (pthread_self); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_self # if HAVE_RAW_DECL_PTHREAD_SELF _GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - " "use gnulib module pthread-thread for portability"); @@ -688,7 +682,6 @@ _GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); _GL_CXXALIASWARN (pthread_equal); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_equal # if HAVE_RAW_DECL_PTHREAD_EQUAL _GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - " "use gnulib module pthread-thread for portability"); @@ -713,7 +706,6 @@ _GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread)); _GL_CXXALIASWARN (pthread_detach); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_detach # if HAVE_RAW_DECL_PTHREAD_DETACH _GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - " "use gnulib module pthread-thread for portability"); @@ -738,7 +730,6 @@ _GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep)); _GL_CXXALIASWARN (pthread_join); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_join # if HAVE_RAW_DECL_PTHREAD_JOIN _GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - " "use gnulib module pthread-thread for portability"); @@ -764,7 +755,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value)); _GL_CXXALIASWARN (pthread_exit); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_exit # if HAVE_RAW_DECL_PTHREAD_EXIT _GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - " "use gnulib module pthread-thread for portability"); @@ -798,7 +788,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_once, int, _GL_CXXALIASWARN (pthread_once); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_once # if HAVE_RAW_DECL_PTHREAD_ONCE _GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - " "use gnulib module pthread-once for portability"); @@ -835,7 +824,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_init, int, _GL_CXXALIASWARN (pthread_mutex_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_init # if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT _GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - " "use gnulib module pthread-mutex for portability"); @@ -862,7 +850,6 @@ _GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); _GL_CXXALIASWARN (pthread_mutexattr_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_init # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT _GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - " "use gnulib module pthread-mutex for portability"); @@ -899,7 +886,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int, _GL_CXXALIASWARN (pthread_mutexattr_gettype); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_gettype # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE _GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - " "use gnulib module pthread-mutex for portability"); @@ -928,7 +914,6 @@ _GL_CXXALIAS_SYS (pthread_mutexattr_settype, int, _GL_CXXALIASWARN (pthread_mutexattr_settype); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_settype # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE _GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - " "use gnulib module pthread-mutex for portability"); @@ -965,7 +950,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int, _GL_CXXALIASWARN (pthread_mutexattr_getrobust); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_getrobust # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST _GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - " "use gnulib module pthread-mutex for portability"); @@ -996,7 +980,6 @@ _GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int, _GL_CXXALIASWARN (pthread_mutexattr_setrobust); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_setrobust # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST _GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1023,7 +1006,6 @@ _GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); _GL_CXXALIASWARN (pthread_mutexattr_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutexattr_destroy # if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY _GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1050,7 +1032,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); _GL_CXXALIASWARN (pthread_mutex_lock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_lock # if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK _GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1077,7 +1058,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); _GL_CXXALIASWARN (pthread_mutex_trylock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_trylock # if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK _GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1112,7 +1092,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, _GL_CXXALIASWARN (pthread_mutex_timedlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_timedlock # if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK _GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - " "use gnulib module pthread_mutex_timedlock for portability"); @@ -1139,7 +1118,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); _GL_CXXALIASWARN (pthread_mutex_unlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_unlock # if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK _GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1166,7 +1144,6 @@ _GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); _GL_CXXALIASWARN (pthread_mutex_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_destroy # if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY _GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - " "use gnulib module pthread-mutex for portability"); @@ -1203,7 +1180,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_init, int, _GL_CXXALIASWARN (pthread_rwlock_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_init # if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT _GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1230,7 +1206,6 @@ _GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); _GL_CXXALIASWARN (pthread_rwlockattr_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlockattr_init # if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT _GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1259,7 +1234,6 @@ _GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int, _GL_CXXALIASWARN (pthread_rwlockattr_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlockattr_destroy # if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY _GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1286,7 +1260,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_rdlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_rdlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK _GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1313,7 +1286,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_wrlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_wrlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK _GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1340,7 +1312,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_tryrdlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_tryrdlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK _GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1367,7 +1338,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_trywrlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_trywrlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK _GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1402,7 +1372,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int, _GL_CXXALIASWARN (pthread_rwlock_timedrdlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_timedrdlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK _GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1437,7 +1406,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int, _GL_CXXALIASWARN (pthread_rwlock_timedwrlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_timedwrlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK _GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1464,7 +1432,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_unlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_unlock # if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK _GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1491,7 +1458,6 @@ _GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); _GL_CXXALIASWARN (pthread_rwlock_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_rwlock_destroy # if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY _GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - " "use gnulib module pthread-rwlock for portability"); @@ -1528,7 +1494,6 @@ _GL_CXXALIAS_SYS (pthread_cond_init, int, _GL_CXXALIASWARN (pthread_cond_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_init # if HAVE_RAW_DECL_PTHREAD_COND_INIT _GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - " "use gnulib module pthread-cond for portability"); @@ -1555,7 +1520,6 @@ _GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)); _GL_CXXALIASWARN (pthread_condattr_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_condattr_init # if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT _GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - " "use gnulib module pthread-cond for portability"); @@ -1582,7 +1546,6 @@ _GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); _GL_CXXALIASWARN (pthread_condattr_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_condattr_destroy # if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY _GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - " "use gnulib module pthread-cond for portability"); @@ -1617,7 +1580,6 @@ _GL_CXXALIAS_SYS (pthread_cond_wait, int, _GL_CXXALIASWARN (pthread_cond_wait); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_wait # if HAVE_RAW_DECL_PTHREAD_COND_WAIT _GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - " "use gnulib module pthread-cond for portability"); @@ -1656,7 +1618,6 @@ _GL_CXXALIAS_SYS (pthread_cond_timedwait, int, _GL_CXXALIASWARN (pthread_cond_timedwait); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_timedwait # if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT _GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - " "use gnulib module pthread-cond for portability"); @@ -1683,7 +1644,6 @@ _GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)); _GL_CXXALIASWARN (pthread_cond_signal); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_signal # if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL _GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - " "use gnulib module pthread-cond for portability"); @@ -1710,7 +1670,6 @@ _GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)); _GL_CXXALIASWARN (pthread_cond_broadcast); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_broadcast # if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST _GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - " "use gnulib module pthread-cond for portability"); @@ -1737,7 +1696,6 @@ _GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)); _GL_CXXALIASWARN (pthread_cond_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_cond_destroy # if HAVE_RAW_DECL_PTHREAD_COND_DESTROY _GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - " "use gnulib module pthread-cond for portability"); @@ -1770,7 +1728,6 @@ _GL_CXXALIAS_SYS_CAST (pthread_key_create, int, _GL_CXXALIASWARN (pthread_key_create); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_key_create # if HAVE_RAW_DECL_PTHREAD_KEY_CREATE _GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - " "use gnulib module pthread-tss for portability"); @@ -1799,7 +1756,6 @@ _GL_CXXALIAS_SYS (pthread_setspecific, int, _GL_CXXALIASWARN (pthread_setspecific); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_setspecific # if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC _GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - " "use gnulib module pthread-tss for portability"); @@ -1824,7 +1780,6 @@ _GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key)); _GL_CXXALIASWARN (pthread_getspecific); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_getspecific # if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC _GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - " "use gnulib module pthread-tss for portability"); @@ -1849,7 +1804,6 @@ _GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key)); _GL_CXXALIASWARN (pthread_key_delete); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_key_delete # if HAVE_RAW_DECL_PTHREAD_KEY_DELETE _GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - " "use gnulib module pthread-tss for portability"); @@ -1882,7 +1836,6 @@ _GL_CXXALIAS_SYS (pthread_spin_init, int, _GL_CXXALIASWARN (pthread_spin_init); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_spin_init # if HAVE_RAW_DECL_PTHREAD_SPIN_INIT _GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - " "use gnulib module pthread-spin for portability"); @@ -1909,7 +1862,6 @@ _GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)); _GL_CXXALIASWARN (pthread_spin_lock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_spin_lock # if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK _GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - " "use gnulib module pthread-spin for portability"); @@ -1936,7 +1888,6 @@ _GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); _GL_CXXALIASWARN (pthread_spin_trylock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_spin_trylock # if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK _GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - " "use gnulib module pthread-spin for portability"); @@ -1963,7 +1914,6 @@ _GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); _GL_CXXALIASWARN (pthread_spin_unlock); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_spin_unlock # if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK _GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - " "use gnulib module pthread-spin for portability"); @@ -1990,7 +1940,6 @@ _GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); _GL_CXXALIASWARN (pthread_spin_destroy); # endif #elif defined GNULIB_POSIXCHECK -# undef pthread_spin_destroy # if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY _GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " "use gnulib module pthread-spin for portability"); diff --git a/gl/realloc.c b/gl/realloc.c index 04a28561..9b35c235 100644 --- a/gl/realloc.c +++ b/gl/realloc.c @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2025 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ /* Ensure that we call the system's realloc() below. */ #define _GL_USE_STDLIB_ALLOC 1 -#include #define _GL_REALLOC_INLINE _GL_EXTERN_INLINE +#include #include #include @@ -50,7 +50,7 @@ rpl_realloc (void *p, size_t n) undefined behavior even though C17 and earlier partially defined the behavior. Let the programmer know. When the undefined-behaviour sanitizers report this case, i.e. when - and + and have been closed and new releases of GCC and clang have been made, we can revisit this code. */ diff --git a/gl/reallocarray.c b/gl/reallocarray.c index 77e8d84c..60573fef 100644 --- a/gl/reallocarray.c +++ b/gl/reallocarray.c @@ -1,6 +1,6 @@ /* reallocarray function that is glibc compatible. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/regcomp.c b/gl/regcomp.c index 878b65ba..aa2f6800 100644 --- a/gl/regcomp.c +++ b/gl/regcomp.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/gl/regex.c b/gl/regex.c index f5f65526..f9f333d2 100644 --- a/gl/regex.c +++ b/gl/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -24,6 +24,7 @@ # if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +# pragma GCC diagnostic ignored "-Wswitch-enum" # pragma GCC diagnostic ignored "-Wvla" # endif #endif diff --git a/gl/regex.h b/gl/regex.h index e9ab85e8..df35c93e 100644 --- a/gl/regex.h +++ b/gl/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2025 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/regex_internal.c b/gl/regex_internal.c index 9b89cc93..4b9b80f6 100644 --- a/gl/regex_internal.c +++ b/gl/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/gl/regex_internal.h b/gl/regex_internal.h index 1f297299..11b745ef 100644 --- a/gl/regex_internal.h +++ b/gl/regex_internal.h @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -98,24 +98,14 @@ #endif /* This is for other GNU distributions with internationalized messages. */ -#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC +#ifdef _LIBC # include # undef gettext -# ifdef _LIBC -# define gettext(msgid) \ +# define gettext(msgid) \ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES) -# else -# define gettext(msgid) dgettext ("gnulib", msgid) -# endif -#else -# undef gettext -# define gettext(msgid) (msgid) -#endif - -#ifndef gettext_noop -/* This define is so xgettext can find the internationalizable - strings. */ # define gettext_noop(String) String +#else +# include "gettext.h" #endif /* Number of ASCII characters. */ diff --git a/gl/regexec.c b/gl/regexec.c index 0d14ac35..c84ce1ef 100644 --- a/gl/regexec.c +++ b/gl/regexec.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/gl/sched.h b/gl/sched.h deleted file mode 100644 index 4d9d546d..00000000 --- a/gl/sched.h +++ /dev/null @@ -1,631 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* A GNU-like . - Copyright (C) 2008-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _GL_SCHED_H - -#if __GNUC__ >= 3 -#pragma GCC system_header -#endif - - -/* This file uses #include_next of a system file that defines time_t. - For the 'year2038' module to work right, needs to have been - included before. */ -#if !_GL_CONFIG_H_INCLUDED - #error "Please include config.h first." -#endif - -/* The include_next requires a split double-inclusion guard. */ -#if 1 -# if 1 -# include -# endif -# include_next -#endif - -#ifndef _GL_SCHED_H -#define _GL_SCHED_H - -/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ -#if !_GL_CONFIG_H_INCLUDED - #error "Please include config.h first." -#endif - -/* Get pid_t. - This is needed on glibc 2.11 (see - glibc bug ) - and Mac OS X 10.5. */ -#include - -#ifdef __KLIBC__ -/* On OS/2 kLIBC, struct sched_param is in spawn.h. */ -# include -#endif - -#ifdef __VMS -/* On OpenVMS, struct sched_param is in . */ -# include -#endif - -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -/* C++ compatible function declaration macros. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _GL_CXXDEFS_H -#define _GL_CXXDEFS_H - -/* Begin/end the GNULIB_NAMESPACE namespace. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { -# define _GL_END_NAMESPACE } -#else -# define _GL_BEGIN_NAMESPACE -# define _GL_END_NAMESPACE -#endif - -/* The three most frequent use cases of these macros are: - - * For providing a substitute for a function that is missing on some - platforms, but is declared and works fine on the platforms on which - it exists: - - #if @GNULIB_FOO@ - # if !@HAVE_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on all platforms, - but is broken/insufficient and needs to be replaced on some platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on some platforms - but is broken/insufficient and needs to be replaced on some of them and - is additionally either missing or undeclared on some other platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif -*/ - -/* _GL_EXTERN_C declaration; - performs the declaration with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C extern "C" -#else -# define _GL_EXTERN_C extern -#endif - -/* _GL_EXTERN_C_FUNC declaration; - performs the declaration of a function with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C_FUNC extern "C" -#else -/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax - are not allowed between 'extern' and the return type (see gnulib-common.m4). - */ -# define _GL_EXTERN_C_FUNC -#endif - -/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]); - declares a replacement function, named rpl_func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...), - _GL_ARG_NONNULL ((1))); - - Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front - of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's - because - [[...]] extern "C" ; - is invalid syntax in C++.) - */ -#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \ - _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__) -#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters - -/* _GL_FUNCDECL_SYS_NAME (func) expands to plain func if C++, and to - parenthesized func otherwise. Parenthesization is needed in C23 if - the function is like strchr and so is a qualifier-generic macro - that expands to something more complicated. */ -#ifdef __cplusplus -# define _GL_FUNCDECL_SYS_NAME(func) func -#else -# define _GL_FUNCDECL_SYS_NAME(func) (func) -#endif - -/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); - declares the system function, named func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); - */ -#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype _GL_FUNCDECL_SYS_NAME (func) parameters - -/* _GL_CXXALIAS_RPL (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to rpl_func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - - Wrapping rpl_func in an object with an inline conversion operator - avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::rpl_func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA (func, rettype, parameters); - is to be used when func is a Microsoft deprecated alias, on native Windows. - It declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to _func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); - */ -#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); - is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); - except that the C function rpl_func may have a slightly different - declaration. A cast is used to silence the "invalid conversion" error - that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::rpl_func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_MDA (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_SYS (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to the system provided function func, if GNULIB_NAMESPACE - is defined. - Example: - _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - - Wrapping func in an object with an inline conversion operator - avoids a reference to func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function is picked among a set of overloaded functions, - namely the one with rettype2 and parameters2. Two consecutive casts - are used to silence the "cannot find a match" and "invalid conversion" - errors that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE - /* The outer cast must be a reinterpret_cast. - The inner cast: When the function is defined as a set of overloaded - functions, it works as a static_cast<>, choosing the designated variant. - When the function is defined as a single variant, it works as a - reinterpret_cast<>. The parenthesized cast syntax works both ways. */ -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast((rettype2 (*) parameters2)(::func)); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN (func); - causes a warning to be emitted when ::func is used but not when - GNULIB_NAMESPACE::func is used. func must be defined without overloaded - variants. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN(func) \ - _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN_1(func,namespace) \ - _GL_CXXALIASWARN_2 (func, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_WARN_ON_USE (func, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN_2(func,namespace) \ - extern __typeof__ (func) func -# else -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN(func) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); - causes a warning to be emitted when the given overloaded variant of ::func - is used but not when GNULIB_NAMESPACE::func is used. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ - GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ - _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# else -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -#endif /* _GL_CXXDEFS_H */ - -/* The definition of _GL_WARN_ON_USE is copied here. */ -/* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* _GL_WARN_ON_USE (function, "literal string") issues a declaration - for FUNCTION which will then trigger a compiler warning containing - the text of "literal string" anywhere that function is called, if - supported by the compiler. If the compiler does not support this - feature, the macro expands to an unused extern declaration. - - _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the - attribute used in _GL_WARN_ON_USE. If the compiler does not support - this feature, it expands to empty. - - These macros are useful for marking a function as a potential - portability trap, with the intent that "literal string" include - instructions on the replacement function that should be used - instead. - _GL_WARN_ON_USE is for functions with 'extern' linkage. - _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' - linkage. - - _GL_WARN_ON_USE should not be used more than once for a given function - in a given compilation unit (because this may generate a warning even - if the function is never called). - - However, one of the reasons that a function is a portability trap is - if it has the wrong signature. Declaring FUNCTION with a different - signature in C is a compilation error, so this macro must use the - same type as any existing declaration so that programs that avoid - the problematic FUNCTION do not fail to compile merely because they - included a header that poisoned the function. But this implies that - _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already - have a declaration. Use of this macro implies that there must not - be any other macro hiding the declaration of FUNCTION; but - undefining FUNCTION first is part of the poisoning process anyway - (although for symbols that are provided only via a macro, the result - is a compilation error rather than a warning containing - "literal string"). Also note that in C++, it is only safe to use if - FUNCTION has no overloads. - - For an example, it is possible to poison 'getline' by: - - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], - [getline]) in configure.ac, which potentially defines - HAVE_RAW_DECL_GETLINE - - adding this code to a header that wraps the system : - #undef getline - #if HAVE_RAW_DECL_GETLINE - _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" - "not universally present; use the gnulib module getline"); - #endif - - It is not possible to directly poison global variables. But it is - possible to write a wrapper accessor function, and poison that - (less common usage, like &environ, will cause a compilation error - rather than issue the nice warning, but the end result of informing - the developer about their portability problem is still achieved): - #if HAVE_RAW_DECL_ENVIRON - static char *** - rpl_environ (void) { return &environ; } - _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); - # undef environ - # define environ (*rpl_environ ()) - #endif - or better (avoiding contradictory use of 'static' and 'extern'): - #if HAVE_RAW_DECL_ENVIRON - static char *** - _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") - rpl_environ (void) { return &environ; } - # undef environ - # define environ (*rpl_environ ()) - #endif - */ -#ifndef _GL_WARN_ON_USE - -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__warning__ (message))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# else /* Unsupported. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# endif -#endif - -/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") - is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the - function is declared with the given prototype, consisting of return type, - parameters, and attributes. - This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does - not work in this case. */ -#ifndef _GL_WARN_ON_USE_CXX -# if !defined __cplusplus -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ - _GL_WARN_ON_USE (function, msg) -# else -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_clang function parameters_and_attributes \ - __attribute__ ((__diagnose_if__ (1, msg, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# endif -# endif -#endif - -/* _GL_WARN_EXTERN_C declaration; - performs the declaration with C linkage. */ -#ifndef _GL_WARN_EXTERN_C -# if defined __cplusplus -# define _GL_WARN_EXTERN_C extern "C" -# else -# define _GL_WARN_EXTERN_C extern -# endif -#endif - -#if !1 - -# if !GNULIB_defined_struct_sched_param -struct sched_param -{ - int sched_priority; -}; -# define GNULIB_defined_struct_sched_param 1 -# endif - -#endif - -#if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER) -# define SCHED_FIFO 1 -# define SCHED_RR 2 -# define SCHED_OTHER 0 -#endif - -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef sched_yield -# define sched_yield rpl_sched_yield -# endif -_GL_FUNCDECL_RPL (sched_yield, int, (void), ); -_GL_CXXALIAS_RPL (sched_yield, int, (void)); -# else -# if !1 -_GL_FUNCDECL_SYS (sched_yield, int, (void), ); -# endif -_GL_CXXALIAS_SYS (sched_yield, int, (void)); -# endif -# if __GLIBC__ >= 2 -_GL_CXXALIASWARN (sched_yield); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_SCHED_YIELD -_GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - " - "use gnulib module sched_yield for portability"); -# endif -#endif - -#endif /* _GL_SCHED_H */ -#endif /* _GL_SCHED_H */ diff --git a/gl/sched.in.h b/gl/sched.in.h index 5b4034c3..cb8ceca0 100644 --- a/gl/sched.in.h +++ b/gl/sched.in.h @@ -1,5 +1,5 @@ /* A GNU-like . - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -46,7 +46,7 @@ /* Get pid_t. This is needed on glibc 2.11 (see - glibc bug ) + glibc bug ) and Mac OS X 10.5. */ #include @@ -100,7 +100,6 @@ _GL_CXXALIAS_SYS (sched_yield, int, (void)); _GL_CXXALIASWARN (sched_yield); # endif #elif defined GNULIB_POSIXCHECK -# undef sched_yield # if HAVE_RAW_DECL_SCHED_YIELD _GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - " "use gnulib module sched_yield for portability"); diff --git a/gl/setenv.c b/gl/setenv.c index ef301d41..ae53146f 100644 --- a/gl/setenv.c +++ b/gl/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2003, 2005-2025 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2003, 2005-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is free software: you can redistribute it and/or modify @@ -126,8 +126,6 @@ int __add_to_environ (const char *name, const char *value, const char *combined, int replace) { - char **ep; - size_t size; const size_t namelen = strlen (name); const size_t vallen = value != NULL ? strlen (value) + 1 : 0; @@ -135,9 +133,9 @@ __add_to_environ (const char *name, const char *value, const char *combined, /* We have to get the pointer now that we have the lock and not earlier since another thread might have created a new environment. */ - ep = __environ; + char **ep = __environ; - size = 0; + size_t size = 0; if (ep != NULL) { for (; *ep != NULL; ++ep) @@ -149,13 +147,8 @@ __add_to_environ (const char *name, const char *value, const char *combined, if (ep == NULL || *ep == NULL) { - char **new_environ; -#ifdef USE_TSEARCH - char *new_value; -#endif - /* We allocated this space; we can extend it. */ - new_environ = + char **new_environ = (char **) (last_environ == NULL ? malloc ((size + 2) * sizeof (char *)) : realloc (last_environ, (size + 2) * sizeof (char *))); @@ -177,6 +170,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, { /* See whether the value is already known. */ #ifdef USE_TSEARCH + char *new_value; # ifdef _LIBC new_value = (char *) alloca (namelen + 1 + vallen); __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), @@ -448,7 +442,6 @@ extern int setenv (const char *, const char *, int); int rpl_setenv (const char *name, const char *value, int replace) { - int result; if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) { errno = EINVAL; @@ -456,13 +449,12 @@ rpl_setenv (const char *name, const char *value, int replace) } /* Call the real setenv even if replace is 0, in case implementation has underlying data to update, such as when environ changes. */ - result = setenv (name, value, replace); + int result = setenv (name, value, replace); if (result == 0 && replace && *value == '=') { char *tmp = getenv (name); if (!STREQ (tmp, value)) { - int saved_errno; size_t len = strlen (value); tmp = malloca (len + 2); if (tmp == NULL) @@ -474,7 +466,7 @@ rpl_setenv (const char *name, const char *value, int replace) *tmp = '='; memcpy (tmp + 1, value, len + 1); result = setenv (name, tmp, replace); - saved_errno = errno; + int saved_errno = errno; freea (tmp); errno = saved_errno; } diff --git a/gl/setlocale-lock.c b/gl/setlocale-lock.c index 87e0048c..afbcc046 100644 --- a/gl/setlocale-lock.c +++ b/gl/setlocale-lock.c @@ -1,5 +1,5 @@ /* Return the internal lock used by setlocale_null_r. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/setlocale_null-unlocked.c b/gl/setlocale_null-unlocked.c index 72729e6b..e7f155c7 100644 --- a/gl/setlocale_null-unlocked.c +++ b/gl/setlocale_null-unlocked.c @@ -1,5 +1,5 @@ /* Query the name of the current global locale, without locking. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -86,10 +86,8 @@ setlocale_null_r_unlocked (int category, char *buf, size_t bufsize) size_t length = wcslen (result); if (length < bufsize) { - size_t i; - /* Convert wchar_t[] -> char[], assuming plain ASCII. */ - for (i = 0; i <= length; i++) + for (size_t i = 0; i <= length; i++) buf[i] = result[i]; return 0; @@ -101,10 +99,8 @@ setlocale_null_r_unlocked (int category, char *buf, size_t bufsize) /* Return a truncated result in BUF. This is a convenience for callers that don't want to write explicit code for handling ERANGE. */ - size_t i; - /* Convert wchar_t[] -> char[], assuming plain ASCII. */ - for (i = 0; i < bufsize; i++) + for (size_t i = 0; i < bufsize; i++) buf[i] = result[i]; buf[bufsize - 1] = '\0'; } diff --git a/gl/setlocale_null.c b/gl/setlocale_null.c index 29889642..39b6766c 100644 --- a/gl/setlocale_null.c +++ b/gl/setlocale_null.c @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -77,10 +77,9 @@ static int setlocale_null_r_with_lock (int category, char *buf, size_t bufsize) { CRITICAL_SECTION *lock = gl_get_setlocale_null_lock (); - int ret; EnterCriticalSection (lock); - ret = setlocale_null_r_unlocked (category, buf, bufsize); + int ret = setlocale_null_r_unlocked (category, buf, bufsize); LeaveCriticalSection (lock); return ret; @@ -116,11 +115,10 @@ setlocale_null_r_with_lock (int category, char *buf, size_t bufsize) if (pthread_in_use()) { pthread_mutex_t *lock = gl_get_setlocale_null_lock (); - int ret; if (pthread_mutex_lock (lock)) abort (); - ret = setlocale_null_r_unlocked (category, buf, bufsize); + int ret = setlocale_null_r_unlocked (category, buf, bufsize); if (pthread_mutex_unlock (lock)) abort (); @@ -138,11 +136,10 @@ static int setlocale_null_r_with_lock (int category, char *buf, size_t bufsize) { mtx_t *lock = gl_get_setlocale_null_lock (); - int ret; if (mtx_lock (lock) != thrd_success) abort (); - ret = setlocale_null_r_unlocked (category, buf, bufsize); + int ret = setlocale_null_r_unlocked (category, buf, bufsize); if (mtx_unlock (lock) != thrd_success) abort (); @@ -252,9 +249,7 @@ setlocale_null (int category) i; char buf[SETLOCALE_NULL_MAX]; static char resultbuf[LC_INDICES_COUNT][SETLOCALE_NULL_MAX]; - int err; - - err = setlocale_null_r (category, buf, sizeof (buf)); + int err = setlocale_null_r (category, buf, sizeof (buf)); if (err == EINVAL) return NULL; if (err) diff --git a/gl/setlocale_null.h b/gl/setlocale_null.h index 3fcb7a82..dbd646b3 100644 --- a/gl/setlocale_null.h +++ b/gl/setlocale_null.h @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/sha256-stream.c b/gl/sha256-stream.c index e2668078..011b36e2 100644 --- a/gl/sha256-stream.c +++ b/gl/sha256-stream.c @@ -1,7 +1,7 @@ /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -67,7 +67,6 @@ shaxxx_stream (FILE *stream, char const *alg, void *resblock, /* We read the file in blocks of BLOCKSIZE bytes. One call of the computation function processes the whole buffer so that with the next round of the loop another block can be read. */ - size_t n; sum = 0; /* Read block. Take care for partial reads. */ @@ -77,11 +76,11 @@ shaxxx_stream (FILE *stream, char const *alg, void *resblock, or the fread() in afalg_stream may have gotten EOF. We need to avoid a subsequent fread() as EOF may not be sticky. For details of such systems, see: - https://sourceware.org/bugzilla/show_bug.cgi?id=1190 */ + https://sourceware.org/PR1190 */ if (feof (stream)) goto process_partial_block; - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); + size_t n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; diff --git a/gl/sha256.c b/gl/sha256.c index 9358faff..bada2d07 100644 --- a/gl/sha256.c +++ b/gl/sha256.c @@ -1,7 +1,7 @@ /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -96,10 +96,9 @@ set_uint32 (char *cp, uint32_t v) void * sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf) { - int i; char *r = resbuf; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; @@ -108,10 +107,9 @@ sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf) void * sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf) { - int i; char *r = resbuf; - for (i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; @@ -326,8 +324,8 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) + S0(x[(I-15)&0x0f]) + x[I&0x0f] \ , x[I&0x0f] = tm ) -#define R(A,B,C,D,E,F,G,H,K,M) do { t0 = SS0(A) + F2(A,B,C); \ - t1 = H + SS1(E) \ +#define R(A,B,C,D,E,F,G,H,K,M) do { uint32_t t0 = SS0(A) + F2(A,B,C); \ + uint32_t t1 = H + SS1(E) \ + F1(E,F,G) \ + K \ + M; \ @@ -336,16 +334,15 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) while (words < endp) { - uint32_t tm; - uint32_t t0, t1; - int t; /* FIXME: see sha1.c for a better implementation. */ - for (t = 0; t < 16; t++) + for (int t = 0; t < 16; t++) { x[t] = SWAP (*words); words++; } + uint32_t tm; + R( a, b, c, d, e, f, g, h, K( 0), x[ 0] ); R( h, a, b, c, d, e, f, g, K( 1), x[ 1] ); R( g, h, a, b, c, d, e, f, K( 2), x[ 2] ); diff --git a/gl/sha256.h b/gl/sha256.h index cd1a9fe3..db80ea5e 100644 --- a/gl/sha256.h +++ b/gl/sha256.h @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA256 and SHA224 sum library functions. - Copyright (C) 2005-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/size_max.h b/gl/size_max.h index 93eb96a6..b627e5ff 100644 --- a/gl/size_max.h +++ b/gl/size_max.h @@ -1,5 +1,5 @@ /* size_max.h -- declare SIZE_MAX through system headers - Copyright (C) 2005-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2026 Free Software Foundation, Inc. Written by Simon Josefsson. This file is free software: you can redistribute it and/or modify diff --git a/gl/snprintf.c b/gl/snprintf.c index edeee083..58ad5d7a 100644 --- a/gl/snprintf.c +++ b/gl/snprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -28,10 +28,8 @@ int snprintf (char *str, size_t size, const char *format, ...) { va_list args; - ptrdiff_t ret; - va_start (args, format); - ret = vsnzprintf (str, size, format, args); + ptrdiff_t ret = vsnzprintf (str, size, format, args); va_end (args); #if PTRDIFF_MAX > INT_MAX diff --git a/gl/sockets.c b/gl/sockets.c index 7accfdd3..ce98698d 100644 --- a/gl/sockets.c +++ b/gl/sockets.c @@ -1,6 +1,6 @@ /* sockets.c --- wrappers for Windows socket functions - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -46,11 +46,10 @@ close_fd_maybe_socket (const struct fd_hook *remaining_list, our calls to closesocket() and the primary close(), some other thread could make system calls that allocate precisely the same HANDLE value as sock; then the primary close() would call CloseHandle() on it. */ - SOCKET sock; - WSANETWORKEVENTS ev; /* Test whether fd refers to a socket. */ - sock = FD_TO_SOCKET (fd); + SOCKET sock = FD_TO_SOCKET (fd); + WSANETWORKEVENTS ev; ev.lNetworkEvents = 0xDEADBEEF; WSAEnumNetworkEvents (sock, NULL, &ev); if (ev.lNetworkEvents != 0xDEADBEEF) @@ -83,11 +82,9 @@ ioctl_fd_maybe_socket (const struct fd_hook *remaining_list, gl_ioctl_fn primary, int fd, int request, void *arg) { - SOCKET sock; - WSANETWORKEVENTS ev; - /* Test whether fd refers to a socket. */ - sock = FD_TO_SOCKET (fd); + SOCKET sock = FD_TO_SOCKET (fd); + WSANETWORKEVENTS ev; ev.lNetworkEvents = 0xDEADBEEF; WSAEnumNetworkEvents (sock, NULL, &ev); if (ev.lNetworkEvents != 0xDEADBEEF) @@ -119,9 +116,7 @@ gl_sockets_startup (_GL_UNUSED int version) if (version > initialized_sockets_version) { WSADATA data; - int err; - - err = WSAStartup (version, &data); + int err = WSAStartup (version, &data); if (err != 0) return 1; @@ -146,13 +141,11 @@ int gl_sockets_cleanup (void) { #if WINDOWS_SOCKETS - int err; - initialized_sockets_version = 0; unregister_fd_hook (&fd_sockets_hook); - err = WSACleanup (); + int err = WSACleanup (); if (err != 0) return 1; #endif diff --git a/gl/sockets.h b/gl/sockets.h index 5be5d3f6..ed12cf9a 100644 --- a/gl/sockets.h +++ b/gl/sockets.h @@ -1,6 +1,6 @@ /* sockets.h - wrappers for Windows socket functions - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/stat-time.c b/gl/stat-time.c index fa93e16c..9dcdc377 100644 --- a/gl/stat-time.c +++ b/gl/stat-time.c @@ -1,6 +1,6 @@ /* stat-related time functions. - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE +#include #include "stat-time.h" diff --git a/gl/stat-time.h b/gl/stat-time.h index 38315b9f..45364316 100644 --- a/gl/stat-time.h +++ b/gl/stat-time.h @@ -1,6 +1,6 @@ /* stat-related time functions. - Copyright (C) 2005, 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -232,8 +232,7 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st) short int const ts_off[] = { STAT_TIMESPEC_OFFSETOF (st_atim), STAT_TIMESPEC_OFFSETOF (st_mtim), STAT_TIMESPEC_OFFSETOF (st_ctim) }; - int i; - for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++) + for (int i = 0; i < sizeof ts_off / sizeof *ts_off; i++) { struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]); long int q = ts->tv_nsec / timespec_hz; diff --git a/gl/stat-w32.c b/gl/stat-w32.c index 8da8fe5c..583ef09b 100644 --- a/gl/stat-w32.c +++ b/gl/stat-w32.c @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -112,11 +112,11 @@ initialize (void) struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft) { - struct timespec result; /* FILETIME: */ unsigned long long since_1601 = ((unsigned long long) ft->dwHighDateTime << 32) | (unsigned long long) ft->dwLowDateTime; + struct timespec result; if (since_1601 == 0) { result.tv_sec = 0; @@ -289,8 +289,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf) && (path = fpath, 1))) { const char *last_dot = NULL; - const char *p; - for (p = path; *p != '\0'; p++) + for (const char *p = path; *p != '\0'; p++) if (*p == '.') last_dot = p; if (last_dot != NULL) diff --git a/gl/stat-w32.h b/gl/stat-w32.h index c70c1be3..f5cc82f4 100644 --- a/gl/stat-w32.h +++ b/gl/stat-w32.h @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2025 Free Software Foundation, Inc. + Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/stat.c b/gl/stat.c index 66637837..da6a9862 100644 --- a/gl/stat.c +++ b/gl/stat.c @@ -1,5 +1,5 @@ /* Work around platform bugs in stat. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -42,14 +42,7 @@ orig_stat (const char *filename, struct stat *buf) #endif /* Specification. */ -#ifdef __osf__ -/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc - eliminates this include because of the preliminary #include - above. */ -# include "sys/stat.h" -#else -# include -#endif +#include #include "stat-time.h" @@ -119,7 +112,7 @@ rpl_stat (char const *name, struct stat *buf) ? */ /* To ease portability. Like in open.c. */ - if (strcmp (name, "/dev/null") == 0) + if (streq (name, "/dev/null")) name = "NUL"; /* POSIX @@ -294,8 +287,7 @@ rpl_stat (char const *name, struct stat *buf) if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) { const char *last_dot = NULL; - const char *p; - for (p = info.cFileName; *p != '\0'; p++) + for (const char *p = info.cFileName; *p != '\0'; p++) if (*p == '.') last_dot = p; if (last_dot != NULL) diff --git a/gl/stdckdint.in.h b/gl/stdckdint.in.h index bb9089b4..ac12fd6c 100644 --- a/gl/stdckdint.in.h +++ b/gl/stdckdint.in.h @@ -1,6 +1,6 @@ /* stdckdint.h -- checked integer arithmetic - Copyright 2022-2025 Free Software Foundation, Inc. + Copyright 2022-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published diff --git a/gl/stddef.in.h b/gl/stddef.in.h index e8c55ff1..2fe9e044 100644 --- a/gl/stddef.in.h +++ b/gl/stddef.in.h @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 , for platforms that have issues. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -32,7 +32,7 @@ || defined __need_wint_t) \ /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \ in GCC 13.3 and 14.2 \ - . */ \ + . */ \ && !@STDDEF_NOT_IDEMPOTENT@ /* Special invocation convention inside gcc header files. In particular, in some ancient versions of GCC blindly @@ -91,7 +91,7 @@ typedef long max_align_t; # if !defined _GCC_NULLPTR_T && !@NULLPTR_T_NEEDS_STDDEF@ /* Suppress unwanted nullptr_t typedef. See - . */ + . */ # define _GCC_NULLPTR_T # endif diff --git a/gl/stdint.in.h b/gl/stdint.in.h index ca566b30..f6066094 100644 --- a/gl/stdint.in.h +++ b/gl/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2025 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2026 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -51,13 +51,6 @@ in public interfaces due to compiler differences. */ #if @HAVE_STDINT_H@ -# if defined __sgi && ! defined __c99 - /* Bypass IRIX's if in C89 mode, since it merely annoys users - with "This header file is to be used only for c99 mode compilations" - diagnostics. */ -# define __STDINT_H__ -# endif - /* Some pre-C++11 implementations need this. */ # ifdef __cplusplus # ifndef __STDC_CONSTANT_MACROS @@ -94,8 +87,8 @@ #if ! @HAVE_C99_STDINT_H@ -/* defines some of the stdint.h types as well, on glibc, - IRIX 6.5, and OpenBSD 3.8 (via ). +/* defines some of the stdint.h types as well, on glibc and + OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. Mac OS X 10.4.6 includes (which is us), but relies on the system definitions, so include @@ -584,11 +577,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # endif /* wchar_t limits */ -/* Get WCHAR_MIN, WCHAR_MAX. - This include is not on the top, above, because on OSF/1 4.0 we have a - sequence of nested includes - -> -> -> , and the latter includes - and assumes its types are already defined. */ +/* Get WCHAR_MIN, WCHAR_MAX. */ # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include diff --git a/gl/stdio-consolesafe.c b/gl/stdio-consolesafe.c index 80561a6d..f634de13 100644 --- a/gl/stdio-consolesafe.c +++ b/gl/stdio-consolesafe.c @@ -1,5 +1,5 @@ /* msvcrt workarounds. - Copyright (C) 2025 Free Software Foundation, Inc. + Copyright (C) 2025-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -85,7 +85,7 @@ gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp) specifiers as the mingw *printf functions. */ static int -vasprintf (char **resultp, const char *format, va_list args) +local_vasprintf (char **resultp, const char *format, va_list args) { /* First try: Use a stack-allocated buffer. */ char buf[2048]; @@ -123,6 +123,9 @@ vasprintf (char **resultp, const char *format, va_list args) return nbytes; } +# undef vasprintf +# define vasprintf local_vasprintf + # endif /* Bypass the functions __mingw_[v][f]printf, that trigger a bug in msvcrt, @@ -133,8 +136,8 @@ int gl_consolesafe_fprintf (FILE *restrict fp, const char *restrict format, ...) { va_list args; - char *tmpstring; va_start (args, format); + char *tmpstring; int result = vasprintf (&tmpstring, format, args); va_end (args); if (result >= 0) @@ -151,8 +154,8 @@ int gl_consolesafe_printf (const char *restrict format, ...) { va_list args; - char *tmpstring; va_start (args, format); + char *tmpstring; int result = vasprintf (&tmpstring, format, args); va_end (args); if (result >= 0) diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h index e4a69a8d..c90f64df 100644 --- a/gl/stdio-impl.h +++ b/gl/stdio-impl.h @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/stdio-read.c b/gl/stdio-read.c index 70452b48..0ca956dc 100644 --- a/gl/stdio-read.c +++ b/gl/stdio-read.c @@ -1,5 +1,5 @@ /* POSIX compatible FILE stream read function. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify @@ -52,9 +52,8 @@ return (EXPRESSION); \ else \ { \ - RETTYPE ret; \ SetLastError (0); \ - ret = (EXPRESSION); \ + RETTYPE ret = (EXPRESSION); \ if (FAILED) \ { \ if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \ @@ -86,11 +85,9 @@ int scanf (const char *format, ...) { - int retval; va_list args; - va_start (args, format); - retval = vfscanf (stdin, format, args); + int retval = vfscanf (stdin, format, args); va_end (args); return retval; @@ -103,11 +100,9 @@ scanf (const char *format, ...) int fscanf (FILE *stream, const char *format, ...) { - int retval; va_list args; - va_start (args, format); - retval = vfscanf (stream, format, args); + int retval = vfscanf (stream, format, args); va_end (args); return retval; diff --git a/gl/stdio-write.c b/gl/stdio-write.c index 59ba8fc4..fc7f74fe 100644 --- a/gl/stdio-write.c +++ b/gl/stdio-write.c @@ -1,5 +1,5 @@ /* POSIX compatible FILE stream write function. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify @@ -107,10 +107,9 @@ return (EXPRESSION); \ else \ { \ - RETTYPE ret; \ CLEAR_ERRNO \ CLEAR_LastError \ - ret = (EXPRESSION); \ + RETTYPE ret = (EXPRESSION); \ if (FAILED) \ { \ HANDLE_ENOSPC \ @@ -124,11 +123,9 @@ int printf (const char *format, ...) { - int retval; va_list args; - va_start (args, format); - retval = vfprintf (stdout, format, args); + int retval = vfprintf (stdout, format, args); va_end (args); return retval; @@ -139,11 +136,9 @@ printf (const char *format, ...) int fprintf (FILE *stream, const char *format, ...) { - int retval; va_list args; - va_start (args, format); - retval = vfprintf (stream, format, args); + int retval = vfprintf (stream, format, args); va_end (args); return retval; diff --git a/gl/stdio.in.h b/gl/stdio.in.h index bc454454..33b0b8e4 100644 --- a/gl/stdio.in.h +++ b/gl/stdio.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2004, 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -22,12 +22,7 @@ #if defined __need_FILE || defined __need___FILE || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H || defined _GL_SKIP_GNULIB_STDIO_H /* Special invocation convention: - - Inside glibc header files. - - On OSF/1 5.1 we have a sequence of nested includes - -> -> -> -> - -> -> -> . - In this situation, the functions are not yet declared, therefore we cannot - provide the C++ aliases. */ + - Inside glibc header files. */ #@INCLUDE_NEXT@ @NEXT_STDIO_H@ @@ -269,10 +264,6 @@ - with MSVC ucrt: "[-]nan" or "[-]nan(ind)" or "[-]nan(snan)", - with mingw: "[-]1.#IND" or "[-]1.#QNAN". */ # define _PRINTF_NAN_LEN_MAX 10 -# elif defined __sgi -/* On IRIX, the output typically is "[-]nan0xNNNNNNNN" with 8 hexadecimal - digits. */ -# define _PRINTF_NAN_LEN_MAX 14 # else /* We don't know, but 32 should be a safe maximum. */ # define _PRINTF_NAN_LEN_MAX 32 @@ -347,7 +338,7 @@ _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...)); _GL_CXXALIASWARN (dprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef dprintf +# undef dprintf /* https://lists.gnu.org/r/bug-gnulib/2025-11/msg00254.html */ # if HAVE_RAW_DECL_DPRINTF _GL_WARN_ON_USE (dprintf, "dprintf is unportable - " "use gnulib module dprintf for portability"); @@ -369,7 +360,6 @@ _GL_CXXALIAS_SYS (fclose, int, (FILE *stream)); _GL_CXXALIASWARN (fclose); # endif #elif defined GNULIB_POSIXCHECK -# undef fclose /* Assume fclose is always declared. */ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - " "use gnulib module fclose for portable POSIX compliance"); @@ -456,7 +446,6 @@ _GL_FUNCDECL_SYS (fdopen, FILE *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef fdopen /* Assume fdopen is always declared. */ _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - " "use gnulib module fdopen for portability"); @@ -497,7 +486,6 @@ _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream)); _GL_CXXALIASWARN (fflush); # endif #elif defined GNULIB_POSIXCHECK -# undef fflush /* Assume fflush is always declared. */ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - " "use gnulib module fflush for portable POSIX compliance"); @@ -590,7 +578,6 @@ _GL_FUNCDECL_SYS (fopen, FILE *, _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)); # endif # if defined GNULIB_POSIXCHECK -# undef fopen /* Assume fopen is always declared. */ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - " "use gnulib module fopen for portability"); @@ -650,9 +637,6 @@ _GL_CXXALIASWARN (fprintf); # endif #endif #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK -# if !GNULIB_overrides_fprintf -# undef fprintf -# endif /* Assume fprintf is always declared. */ _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - " "use gnulib module fprintf-posix for portable " @@ -682,7 +666,6 @@ _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream)); _GL_CXXALIASWARN (fpurge); # endif #elif defined GNULIB_POSIXCHECK -# undef fpurge # if HAVE_RAW_DECL_FPURGE _GL_WARN_ON_USE (fpurge, "fpurge is not always present - " "use gnulib module fpurge for portability"); @@ -770,7 +753,6 @@ _GL_CXXALIAS_SYS (freopen, FILE *, _GL_CXXALIASWARN (freopen); # endif #elif defined GNULIB_POSIXCHECK -# undef freopen /* Assume freopen is always declared. */ _GL_WARN_ON_USE (freopen, "freopen on native Windows platforms is not POSIX compliant - " @@ -877,7 +859,6 @@ _GL_CXXALIASWARN (fseeko); #elif defined GNULIB_POSIXCHECK # define _GL_FSEEK_WARN /* Category 1, above. */ # undef fseek -# undef fseeko # if HAVE_RAW_DECL_FSEEKO _GL_WARN_ON_USE (fseeko, "fseeko is unportable - " "use gnulib module fseeko for portability"); @@ -941,7 +922,6 @@ _GL_CXXALIASWARN (ftello); #elif defined GNULIB_POSIXCHECK # define _GL_FTELL_WARN /* Category 1, above. */ # undef ftell -# undef ftello # if HAVE_RAW_DECL_FTELLO _GL_WARN_ON_USE (ftello, "ftello is unportable - " "use gnulib module ftello for portability"); @@ -977,7 +957,7 @@ _GL_CXXALIAS_SYS (fwrite, size_t, FILE *restrict stream)); /* Work around bug 11959 when fortifying glibc 2.4 through 2.15 - , + , which sometimes causes an unwanted diagnostic for fwrite calls. This affects only function declaration attributes under certain versions of gcc and clang, and is not needed for C++. */ @@ -1053,6 +1033,17 @@ _GL_CXXALIASWARN (getchar); # undef getdelim # define getdelim rpl_getdelim # endif +# ifndef __has_feature +# define __has_feature(a) 0 +# endif +# if __GLIBC__ >= 2 && !(defined __SANITIZE_ADDRESS__ \ + || __has_feature (address_sanitizer)) +/* Arrange for the inline definition of getline() in + to call our getdelim() override. Do not use the __getdelim symbol + if address sanitizer is in use, otherwise it may be overridden by + __interceptor_trampoline___getdelim. */ +# define rpl_getdelim __getdelim +# endif _GL_FUNCDECL_RPL (getdelim, ssize_t, (char **restrict lineptr, size_t *restrict linesize, int delimiter, @@ -1079,7 +1070,6 @@ _GL_CXXALIAS_SYS (getdelim, ssize_t, _GL_CXXALIASWARN (getdelim); # endif #elif defined GNULIB_POSIXCHECK -# undef getdelim # if HAVE_RAW_DECL_GETDELIM _GL_WARN_ON_USE (getdelim, "getdelim is unportable - " "use gnulib module getdelim for portability"); @@ -1094,14 +1084,27 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - " Return the number of bytes read and stored at *LINEPTR (not including the NUL terminator), or -1 on error or EOF. */ # if @REPLACE_GETLINE@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef getline -# define getline rpl_getline -# endif _GL_FUNCDECL_RPL (getline, ssize_t, (char **restrict lineptr, size_t *restrict linesize, FILE *restrict stream), _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD); +# if defined __cplusplus +/* The C++ standard library defines std::basic_istream::getline in + or . */ +# if !(__GLIBC__ >= 2) +extern "C" { +inline ssize_t +getline (char **restrict lineptr, size_t *restrict linesize, + FILE *restrict stream) +{ + return rpl_getline (lineptr, linesize, stream); +} +} +# endif +# else +# undef getline +# define getline rpl_getline +# endif _GL_CXXALIAS_RPL (getline, ssize_t, (char **restrict lineptr, size_t *restrict linesize, FILE *restrict stream)); @@ -1120,7 +1123,6 @@ _GL_CXXALIAS_SYS (getline, ssize_t, _GL_CXXALIASWARN (getline); # endif #elif defined GNULIB_POSIXCHECK -# undef getline # if HAVE_RAW_DECL_GETLINE _GL_WARN_ON_USE (getline, "getline is unportable - " "use gnulib module getline for portability"); @@ -1130,7 +1132,6 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " /* It is very rare that the developer ever has full control of stdin, so any use of gets warrants an unconditional warning; besides, C11 removed it. */ -#undef gets #if HAVE_RAW_DECL_GETS && !defined __cplusplus _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif @@ -1243,7 +1244,6 @@ _GL_FUNCDECL_SYS (pclose, int, (FILE *stream), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_SYS (pclose, int, (FILE *stream)); _GL_CXXALIASWARN (pclose); #elif defined GNULIB_POSIXCHECK -# undef pclose # if HAVE_RAW_DECL_PCLOSE _GL_WARN_ON_USE (pclose, "pclose is unportable - " "use gnulib module pclose for more portability"); @@ -1267,7 +1267,6 @@ _GL_CXXALIAS_SYS (perror, void, (const char *string)); _GL_CXXALIASWARN (perror); # endif #elif defined GNULIB_POSIXCHECK -# undef perror /* Assume perror is always declared. */ _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - " "use gnulib module perror for portability"); @@ -1304,7 +1303,6 @@ _GL_FUNCDECL_SYS (popen, FILE *, _GL_ATTRIBUTE_MALLOC); # endif # if defined GNULIB_POSIXCHECK -# undef popen # if HAVE_RAW_DECL_POPEN _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - " "use gnulib module popen or pipe for more portability"); @@ -1377,9 +1375,6 @@ _GL_CXXALIASWARN (printf); # endif #endif #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK -# if !GNULIB_overrides_printf -# undef printf -# endif /* Assume printf is always declared. */ _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - " "use gnulib module printf-posix for portable " @@ -1473,7 +1468,6 @@ _GL_CXXALIAS_SYS (remove, int, (const char *name)); _GL_CXXALIASWARN (remove); # endif #elif defined GNULIB_POSIXCHECK -# undef remove /* Assume remove is always declared. */ _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - " "use gnulib module remove for more portability"); @@ -1498,7 +1492,6 @@ _GL_CXXALIAS_SYS (rename, int, _GL_CXXALIASWARN (rename); # endif #elif defined GNULIB_POSIXCHECK -# undef rename /* Assume rename is always declared. */ _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - " "use gnulib module rename for more portability"); @@ -1526,7 +1519,6 @@ _GL_CXXALIAS_SYS (renameat, int, # endif _GL_CXXALIASWARN (renameat); #elif defined GNULIB_POSIXCHECK -# undef renameat # if HAVE_RAW_DECL_RENAMEAT _GL_WARN_ON_USE (renameat, "renameat is not portable - " "use gnulib module renameat for portability"); @@ -1620,7 +1612,6 @@ _GL_CXXALIAS_SYS (snprintf, int, _GL_CXXALIASWARN (snprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef snprintf # if HAVE_RAW_DECL_SNPRINTF _GL_WARN_ON_USE (snprintf, "snprintf is unportable - " "use gnulib module snprintf for portability"); @@ -1676,7 +1667,6 @@ _GL_CXXALIAS_SYS (sprintf, int, _GL_CXXALIASWARN (sprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef sprintf /* Assume sprintf is always declared. */ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - " "use gnulib module sprintf-posix for portable " @@ -1731,7 +1721,6 @@ _GL_FUNCDECL_SYS (tmpfile, FILE *, (void), _GL_ATTRIBUTE_MALLOC); # endif # if defined GNULIB_POSIXCHECK -# undef tmpfile # if HAVE_RAW_DECL_TMPFILE _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - " "use gnulib module tmpfile for portability"); @@ -1865,7 +1854,6 @@ _GL_CXXALIAS_SYS_CAST (vdprintf, int, _GL_CXXALIASWARN (vdprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef vdprintf # if HAVE_RAW_DECL_VDPRINTF _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - " "use gnulib module vdprintf for portability"); @@ -1934,9 +1922,6 @@ _GL_CXXALIASWARN (vfprintf); # endif #endif #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK -# if !GNULIB_overrides_vfprintf -# undef vfprintf -# endif /* Assume vfprintf is always declared. */ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - " "use gnulib module vfprintf-posix for portable " @@ -2020,9 +2005,6 @@ _GL_CXXALIASWARN (vprintf); # endif #endif #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK -# if !GNULIB_overrides_vprintf -# undef vprintf -# endif /* Assume vprintf is always declared. */ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - " "use gnulib module vprintf-posix for portable " @@ -2101,7 +2083,6 @@ _GL_CXXALIAS_SYS (vsnprintf, int, _GL_CXXALIASWARN (vsnprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef vsnprintf # if HAVE_RAW_DECL_VSNPRINTF _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - " "use gnulib module vsnprintf for portability"); @@ -2154,7 +2135,6 @@ _GL_CXXALIAS_SYS_CAST (vsprintf, int, _GL_CXXALIASWARN (vsprintf); # endif #elif defined GNULIB_POSIXCHECK -# undef vsprintf /* Assume vsprintf is always declared. */ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - " "use gnulib module vsprintf-posix for portable " diff --git a/gl/stdlib.c b/gl/stdlib.c index 6a06f5ba..f51a25c3 100644 --- a/gl/stdlib.c +++ b/gl/stdlib.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2024-2025 Free Software Foundation, Inc. + Copyright (C) 2024-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index 1342db48..95237f2a 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -62,12 +62,6 @@ /* NetBSD 5.0 mis-defines NULL. */ #include -/* MirBSD 10 defines WEXITSTATUS in , not in . - glibc 2.41 defines WCOREDUMP in , not in . */ -#if @GNULIB_SYSTEM_POSIX@ && !(defined WEXITSTATUS && defined WCOREDUMP) -# include -#endif - /* Solaris declares getloadavg() in . */ #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ /* OpenIndiana has a bug: must be included before @@ -76,6 +70,11 @@ # include #endif +/* QNX declares getprogname() in . */ +#if (@GNULIB_GETPROGNAME@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_PROCESS_H@ +# include +#endif + /* Native Windows platforms declare _mktemp() in . */ #if defined _WIN32 && !defined __CYGWIN__ # include @@ -83,13 +82,6 @@ #if @GNULIB_RANDOM_R@ -/* OSF/1 5.1 declares 'struct random_data' in , which is included - from if _REENTRANT is defined. Include it whenever we need - 'struct random_data'. */ -# if @HAVE_RANDOM_H@ -# include -# endif - # include # if !@HAVE_STRUCT_RANDOM_DATA@ @@ -237,9 +229,9 @@ _GL_INLINE_HEADER_BEGIN /* Declarations for ISO C N3322. */ #if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ -_GL_EXTERN_C void *bsearch (const void *__key, - const void *__base, size_t __nmemb, size_t __size, - int (*__compare) (const void *, const void *)) +_GL_EXTERN_C void *_GL_FUNCDECL_SYS_NAME (bsearch) + (const void *__key, const void *__base, size_t __nmemb, size_t __size, + int (*__compare) (const void *, const void *)) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5)); _GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size, int (*__compare) (const void *, const void *)) @@ -267,7 +259,6 @@ _GL_CXXALIAS_SYS (_Exit, void, (int status)); _GL_CXXALIASWARN (_Exit); # endif #elif defined GNULIB_POSIXCHECK -# undef _Exit # if HAVE_RAW_DECL__EXIT _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " "use gnulib module _Exit for portability"); @@ -314,7 +305,6 @@ _GL_CXXALIAS_SYS (free, void, (void *ptr)); _GL_CXXALIASWARN (free); # endif #elif defined GNULIB_POSIXCHECK -# undef free /* Assume free is always declared. */ _GL_WARN_ON_USE (free, "free is not POSIX:2024 compliant everywhere - " "use gnulib module free-posix for portability"); @@ -372,7 +362,6 @@ _GL_FUNCDECL_SYS (aligned_alloc, void *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef aligned_alloc # if HAVE_RAW_DECL_ALIGNED_ALLOC _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " "use gnulib module aligned_alloc for portability"); @@ -392,7 +381,6 @@ _GL_FUNCDECL_SYS (atoll, long long, _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); _GL_CXXALIASWARN (atoll); #elif defined GNULIB_POSIXCHECK -# undef atoll # if HAVE_RAW_DECL_ATOLL _GL_WARN_ON_USE (atoll, "atoll is unportable - " "use gnulib module atoll for portability"); @@ -449,7 +437,6 @@ _GL_FUNCDECL_SYS (calloc, void *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef calloc /* Assume calloc is always declared. */ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " "use gnulib module calloc-posix for portability"); @@ -510,7 +497,6 @@ _GL_FUNCDECL_SYS (canonicalize_file_name, char *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef canonicalize_file_name # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME _GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable - " @@ -610,7 +596,6 @@ _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); _GL_CXXALIASWARN (getloadavg); # endif #elif defined GNULIB_POSIXCHECK -# undef getloadavg # if HAVE_RAW_DECL_GETLOADAVG _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " "use gnulib module getloadavg for portability"); @@ -645,7 +630,6 @@ _GL_CXXALIAS_SYS (getprogname, const char *, (void)); _GL_CXXALIASWARN (getprogname); # endif #elif defined GNULIB_POSIXCHECK -# undef getprogname # if HAVE_RAW_DECL_GETPROGNAME _GL_WARN_ON_USE (getprogname, "getprogname is unportable - " "use gnulib module getprogname for portability"); @@ -687,7 +671,6 @@ _GL_CXXALIAS_SYS (getsubopt, int, _GL_CXXALIASWARN (getsubopt); # endif #elif defined GNULIB_POSIXCHECK -# undef getsubopt # if HAVE_RAW_DECL_GETSUBOPT _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " "use gnulib module getsubopt for portability"); @@ -703,7 +686,6 @@ _GL_FUNCDECL_SYS (grantpt, int, (int fd), ); _GL_CXXALIAS_SYS (grantpt, int, (int fd)); _GL_CXXALIASWARN (grantpt); #elif defined GNULIB_POSIXCHECK -# undef grantpt # if HAVE_RAW_DECL_GRANTPT _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " "use gnulib module grantpt for portability"); @@ -764,7 +746,6 @@ _GL_FUNCDECL_SYS (malloc, void *, # endif # endif # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC -# undef malloc /* Assume malloc is always declared. */ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " "use gnulib module malloc-posix for portability"); @@ -815,7 +796,6 @@ _GL_CXXALIAS_SYS (mbstowcs, size_t, _GL_CXXALIASWARN (mbstowcs); # endif #elif defined GNULIB_POSIXCHECK -# undef mbstowcs # if HAVE_RAW_DECL_MBSTOWCS _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - " "use gnulib module mbstowcs for portability"); @@ -845,7 +825,6 @@ _GL_CXXALIAS_SYS (mbtowc, int, _GL_CXXALIASWARN (mbtowc); # endif #elif defined GNULIB_POSIXCHECK -# undef mbtowc # if HAVE_RAW_DECL_MBTOWC _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " "use gnulib module mbtowc for portability"); @@ -866,7 +845,6 @@ _GL_FUNCDECL_SYS (mkdtemp, char *, _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); _GL_CXXALIASWARN (mkdtemp); #elif defined GNULIB_POSIXCHECK -# undef mkdtemp # if HAVE_RAW_DECL_MKDTEMP _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " "use gnulib module mkdtemp for portability"); @@ -905,7 +883,6 @@ _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); _GL_CXXALIASWARN (mkostemp); # endif #elif defined GNULIB_POSIXCHECK -# undef mkostemp # if HAVE_RAW_DECL_MKOSTEMP _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " "use gnulib module mkostemp for portability"); @@ -949,7 +926,6 @@ _GL_CXXALIAS_SYS (mkostemps, int, _GL_CXXALIASWARN (mkostemps); # endif #elif defined GNULIB_POSIXCHECK -# undef mkostemps # if HAVE_RAW_DECL_MKOSTEMPS _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " "use gnulib module mkostemps for portability"); @@ -982,7 +958,6 @@ _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); # endif _GL_CXXALIASWARN (mkstemp); #elif defined GNULIB_POSIXCHECK -# undef mkstemp # if HAVE_RAW_DECL_MKSTEMP _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " "use gnulib module mkstemp for portability"); @@ -1007,7 +982,6 @@ _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/), _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); _GL_CXXALIASWARN (mkstemps); #elif defined GNULIB_POSIXCHECK -# undef mkstemps # if HAVE_RAW_DECL_MKSTEMPS _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " "use gnulib module mkstemps for portability"); @@ -1052,7 +1026,6 @@ _GL_CXXALIAS_SYS (posix_memalign, int, _GL_CXXALIASWARN (posix_memalign); # endif #elif defined GNULIB_POSIXCHECK -# undef posix_memalign # if HAVE_RAW_DECL_POSIX_MEMALIGN _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " "use gnulib module posix_memalign for portability"); @@ -1079,7 +1052,6 @@ _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); _GL_CXXALIASWARN (posix_openpt); # endif #elif defined GNULIB_POSIXCHECK -# undef posix_openpt # if HAVE_RAW_DECL_POSIX_OPENPT _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " "use gnulib module posix_openpt for portability"); @@ -1104,7 +1076,6 @@ _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); # endif _GL_CXXALIASWARN (ptsname); #elif defined GNULIB_POSIXCHECK -# undef ptsname # if HAVE_RAW_DECL_PTSNAME _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " "use gnulib module ptsname for portability"); @@ -1133,7 +1104,6 @@ _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); # endif _GL_CXXALIASWARN (ptsname_r); #elif defined GNULIB_POSIXCHECK -# undef ptsname_r # if HAVE_RAW_DECL_PTSNAME_R _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " "use gnulib module ptsname_r for portability"); @@ -1227,7 +1197,6 @@ _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_CXXALIASWARN (qsort_r); # endif #elif defined GNULIB_POSIXCHECK -# undef qsort_r # if HAVE_RAW_DECL_QSORT_R _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " "use gnulib module qsort_r for portability"); @@ -1279,7 +1248,6 @@ _GL_CXXALIAS_SYS_CAST (random, long, (void)); _GL_CXXALIASWARN (random); # endif #elif defined GNULIB_POSIXCHECK -# undef random # if HAVE_RAW_DECL_RANDOM _GL_WARN_ON_USE (random, "random is unportable - " "use gnulib module random for portability"); @@ -1306,7 +1274,6 @@ _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed)); _GL_CXXALIASWARN (srandom); # endif #elif defined GNULIB_POSIXCHECK -# undef srandom # if HAVE_RAW_DECL_SRANDOM _GL_WARN_ON_USE (srandom, "srandom is unportable - " "use gnulib module random for portability"); @@ -1339,7 +1306,6 @@ _GL_CXXALIAS_SYS_CAST (initstate, char *, _GL_CXXALIASWARN (initstate); # endif #elif defined GNULIB_POSIXCHECK -# undef initstate # if HAVE_RAW_DECL_INITSTATE _GL_WARN_ON_USE (initstate, "initstate is unportable - " "use gnulib module random for portability"); @@ -1366,7 +1332,6 @@ _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state)); _GL_CXXALIASWARN (setstate); # endif #elif defined GNULIB_POSIXCHECK -# undef setstate # if HAVE_RAW_DECL_SETSTATE _GL_WARN_ON_USE (setstate, "setstate is unportable - " "use gnulib module random for portability"); @@ -1392,7 +1357,6 @@ _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); # endif _GL_CXXALIASWARN (random_r); #elif defined GNULIB_POSIXCHECK -# undef random_r # if HAVE_RAW_DECL_RANDOM_R _GL_WARN_ON_USE (random_r, "random_r is unportable - " "use gnulib module random_r for portability"); @@ -1421,7 +1385,6 @@ _GL_CXXALIAS_SYS (srandom_r, int, # endif _GL_CXXALIASWARN (srandom_r); #elif defined GNULIB_POSIXCHECK -# undef srandom_r # if HAVE_RAW_DECL_SRANDOM_R _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " "use gnulib module random_r for portability"); @@ -1456,7 +1419,6 @@ _GL_CXXALIAS_SYS_CAST (initstate_r, int, # endif _GL_CXXALIASWARN (initstate_r); #elif defined GNULIB_POSIXCHECK -# undef initstate_r # if HAVE_RAW_DECL_INITSTATE_R _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " "use gnulib module random_r for portability"); @@ -1487,7 +1449,6 @@ _GL_CXXALIAS_SYS_CAST (setstate_r, int, # endif _GL_CXXALIASWARN (setstate_r); #elif defined GNULIB_POSIXCHECK -# undef setstate_r # if HAVE_RAW_DECL_SETSTATE_R _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " "use gnulib module random_r for portability"); @@ -1557,7 +1518,6 @@ _GL_FUNCDECL_SYS (realloc, void *, # endif # endif # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC -# undef realloc /* Assume realloc is always declared. */ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " "use gnulib module realloc-posix for portability"); @@ -1589,7 +1549,6 @@ _GL_CXXALIAS_SYS (reallocarray, void *, _GL_CXXALIASWARN (reallocarray); # endif #elif defined GNULIB_POSIXCHECK -# undef reallocarray # if HAVE_RAW_DECL_REALLOCARRAY _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " "use gnulib module reallocarray for portability"); @@ -1617,7 +1576,6 @@ _GL_CXXALIAS_SYS (realpath, char *, # endif _GL_CXXALIASWARN (realpath); #elif defined GNULIB_POSIXCHECK -# undef realpath # if HAVE_RAW_DECL_REALPATH _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " "canonicalize or canonicalize-lgpl for portability"); @@ -1634,7 +1592,6 @@ _GL_FUNCDECL_SYS (rpmatch, int, (const char *response), _GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); _GL_CXXALIASWARN (rpmatch); #elif defined GNULIB_POSIXCHECK -# undef rpmatch # if HAVE_RAW_DECL_RPMATCH _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " "use gnulib module rpmatch for portability"); @@ -1651,7 +1608,6 @@ _GL_FUNCDECL_SYS (secure_getenv, char *, _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); _GL_CXXALIASWARN (secure_getenv); #elif defined GNULIB_POSIXCHECK -# undef secure_getenv # if HAVE_RAW_DECL_SECURE_GETENV _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " "use gnulib module secure_getenv for portability"); @@ -1684,7 +1640,6 @@ _GL_CXXALIAS_SYS (setenv, int, _GL_CXXALIASWARN (setenv); # endif #elif defined GNULIB_POSIXCHECK -# undef setenv # if HAVE_RAW_DECL_SETENV _GL_WARN_ON_USE (setenv, "setenv is unportable - " "use gnulib module setenv for portability"); @@ -1729,7 +1684,6 @@ _GL_CXXALIAS_SYS (strtod, double, _GL_CXXALIASWARN (strtod); # endif #elif defined GNULIB_POSIXCHECK -# undef strtod # if HAVE_RAW_DECL_STRTOD _GL_WARN_ON_USE (strtod, "strtod is unportable - " "use gnulib module strtod for portability"); @@ -1761,7 +1715,6 @@ _GL_CXXALIAS_SYS (strtof, float, _GL_CXXALIASWARN (strtof); # endif #elif defined GNULIB_POSIXCHECK -# undef strtof # if HAVE_RAW_DECL_STRTOF _GL_WARN_ON_USE (strtof, "strtof is unportable - " "use gnulib module strtof for portability"); @@ -1791,7 +1744,6 @@ _GL_CXXALIAS_SYS (strtold, long double, # endif _GL_CXXALIASWARN (strtold); #elif defined GNULIB_POSIXCHECK -# undef strtold # if HAVE_RAW_DECL_STRTOLD _GL_WARN_ON_USE (strtold, "strtold is unportable - " "use gnulib module strtold for portability"); @@ -1834,7 +1786,6 @@ _GL_CXXALIAS_SYS (strtol, long, _GL_CXXALIASWARN (strtol); # endif #elif defined GNULIB_POSIXCHECK -# undef strtol # if HAVE_RAW_DECL_STRTOL _GL_WARN_ON_USE (strtol, "strtol is unportable - " "use gnulib module strtol for portability"); @@ -1875,7 +1826,6 @@ _GL_CXXALIAS_SYS (strtoll, long long, # endif _GL_CXXALIASWARN (strtoll); #elif defined GNULIB_POSIXCHECK -# undef strtoll # if HAVE_RAW_DECL_STRTOLL _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " "use gnulib module strtoll for portability"); @@ -1917,7 +1867,6 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long, _GL_CXXALIASWARN (strtoul); # endif #elif defined GNULIB_POSIXCHECK -# undef strtoul # if HAVE_RAW_DECL_STRTOUL _GL_WARN_ON_USE (strtoul, "strtoul is unportable - " "use gnulib module strtoul for portability"); @@ -1958,7 +1907,6 @@ _GL_CXXALIAS_SYS (strtoull, unsigned long long, # endif _GL_CXXALIASWARN (strtoull); #elif defined GNULIB_POSIXCHECK -# undef strtoull # if HAVE_RAW_DECL_STRTOULL _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " "use gnulib module strtoull for portability"); @@ -1974,7 +1922,6 @@ _GL_FUNCDECL_SYS (unlockpt, int, (int fd), ); _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); _GL_CXXALIASWARN (unlockpt); #elif defined GNULIB_POSIXCHECK -# undef unlockpt # if HAVE_RAW_DECL_UNLOCKPT _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " "use gnulib module unlockpt for portability"); @@ -2000,7 +1947,6 @@ _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); _GL_CXXALIASWARN (unsetenv); # endif #elif defined GNULIB_POSIXCHECK -# undef unsetenv # if HAVE_RAW_DECL_UNSETENV _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " "use gnulib module unsetenv for portability"); @@ -2027,6 +1973,18 @@ _GL_CXXALIASWARN (wctomb); _GL_INLINE_HEADER_END + +/* Includes that provide only macros that don't need to be overridden. + (Includes that are needed for type definitions and function declarations + have their place above, before the function overrides.) */ + +/* MirBSD 10 defines WEXITSTATUS in , not in . + glibc 2.41 defines WCOREDUMP in , not in . */ +#if @GNULIB_SYSTEM_POSIX@ && !(defined WEXITSTATUS && defined WCOREDUMP) +# include +#endif + + #endif /* _@GUARD_PREFIX@_STDLIB_H */ #endif /* _@GUARD_PREFIX@_STDLIB_H */ #endif diff --git a/gl/str-two-way.h b/gl/str-two-way.h index d13fb298..7cf91ffd 100644 --- a/gl/str-two-way.h +++ b/gl/str-two-way.h @@ -1,5 +1,5 @@ /* Byte-wise substring search, using the Two-Way algorithm. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Eric Blake , 2008. @@ -108,13 +108,6 @@ static size_t critical_factorization (const unsigned char *needle, size_t needle_len, size_t *period) { - /* Index of last byte of left half, or SIZE_MAX. */ - size_t max_suffix, max_suffix_rev; - size_t j; /* Index into NEEDLE for current candidate suffix. */ - size_t k; /* Offset into current period. */ - size_t p; /* Intermediate period. */ - unsigned char a, b; /* Current comparison bytes. */ - /* Special case NEEDLE_LEN of 1 or 2 (all callers already filtered out 0-length needles. */ if (needle_len < 3) @@ -133,73 +126,83 @@ critical_factorization (const unsigned char *needle, size_t needle_len, */ /* Perform lexicographic search. */ - max_suffix = SIZE_MAX; - j = 0; - k = p = 1; - while (j + k < needle_len) - { - a = CANON_ELEMENT (needle[j + k]); - b = CANON_ELEMENT (needle[max_suffix + k]); - if (a < b) - { - /* Suffix is smaller, period is entire prefix so far. */ - j += k; - k = 1; - p = j - max_suffix; - } - else if (a == b) - { - /* Advance through repetition of the current period. */ - if (k != p) - ++k; - else - { - j += p; - k = 1; - } - } - else /* b < a */ - { - /* Suffix is larger, start over from current location. */ - max_suffix = j++; - k = p = 1; - } - } - *period = p; + size_t max_suffix = /* Index of last byte of left half, or SIZE_MAX. */ + SIZE_MAX; + { + size_t j = 0; /* Index into NEEDLE for current candidate suffix. */ + size_t k = 1; /* Offset into current period. */ + size_t p = 1; /* Intermediate period. */ + while (j + k < needle_len) + { + unsigned char a = CANON_ELEMENT (needle[j + k]); + unsigned char b = CANON_ELEMENT (needle[max_suffix + k]); + if (a < b) + { + /* Suffix is smaller, period is entire prefix so far. */ + j += k; + k = 1; + p = j - max_suffix; + } + else if (a == b) + { + /* Advance through repetition of the current period. */ + if (k != p) + ++k; + else + { + j += p; + k = 1; + } + } + else /* b < a */ + { + /* Suffix is larger, start over from current location. */ + max_suffix = j++; + k = p = 1; + } + } + *period = p; + } /* Perform reverse lexicographic search. */ - max_suffix_rev = SIZE_MAX; - j = 0; - k = p = 1; - while (j + k < needle_len) - { - a = CANON_ELEMENT (needle[j + k]); - b = CANON_ELEMENT (needle[max_suffix_rev + k]); - if (b < a) - { - /* Suffix is smaller, period is entire prefix so far. */ - j += k; - k = 1; - p = j - max_suffix_rev; - } - else if (a == b) - { - /* Advance through repetition of the current period. */ - if (k != p) - ++k; - else - { - j += p; - k = 1; - } - } - else /* a < b */ - { - /* Suffix is larger, start over from current location. */ - max_suffix_rev = j++; - k = p = 1; - } - } + size_t max_suffix_rev = /* Index of last byte of left half, or SIZE_MAX. */ + SIZE_MAX; + size_t p_rev; + { + size_t j = 0; /* Index into NEEDLE for current candidate suffix. */ + size_t k = 1; /* Offset into current period. */ + size_t p = 1; /* Intermediate period. */ + while (j + k < needle_len) + { + unsigned char a = CANON_ELEMENT (needle[j + k]); + unsigned char b = CANON_ELEMENT (needle[max_suffix_rev + k]); + if (b < a) + { + /* Suffix is smaller, period is entire prefix so far. */ + j += k; + k = 1; + p = j - max_suffix_rev; + } + else if (a == b) + { + /* Advance through repetition of the current period. */ + if (k != p) + ++k; + else + { + j += p; + k = 1; + } + } + else /* a < b */ + { + /* Suffix is larger, start over from current location. */ + max_suffix_rev = j++; + k = p = 1; + } + } + p_rev = p; + } /* Choose the shorter suffix. Return the index of the first byte of the right half, rather than the last byte of the left half. @@ -217,7 +220,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len, factorization. */ if (max_suffix_rev + 1 < max_suffix + 1) return max_suffix + 1; - *period = p; + *period = p_rev; return max_suffix_rev + 1; } @@ -235,15 +238,12 @@ static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_short_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { - size_t i; /* Index into current byte of NEEDLE. */ - size_t j; /* Index into current window of HAYSTACK. */ - size_t period; /* The period of the right half of needle. */ - size_t suffix; /* The index of the right half of needle. */ - /* Factor the needle into two halves, such that the left half is smaller than the global period, and the right half is periodic (with a period as large as NEEDLE_LEN - suffix). */ - suffix = critical_factorization (needle, needle_len, &period); + size_t period; /* The period of the right half of needle. */ + size_t suffix = /* The index of the right half of needle. */ + critical_factorization (needle, needle_len, &period); /* Perform the search. Each iteration compares the right half first. */ @@ -253,11 +253,12 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len, only advance by the period, so use memory to avoid rescanning known occurrences of the period in the right half. */ size_t memory = 0; - j = 0; + size_t j = 0; /* Index into current window of HAYSTACK. */ while (AVAILABLE (haystack, haystack_len, j, needle_len)) { /* Scan for matches in right half. */ - i = MAX (suffix, memory); + size_t i = /* Index into current byte of NEEDLE. */ + MAX (suffix, memory); while (i < needle_len && (CANON_ELEMENT (needle[i]) == CANON_ELEMENT (haystack[i + j]))) ++i; @@ -287,11 +288,12 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len, /* The two halves of needle are distinct; no extra memory is required, and any mismatch results in a maximal shift. */ period = MAX (suffix, needle_len - suffix) + 1; - j = 0; + size_t j = 0; /* Index into current window of HAYSTACK. */ while (AVAILABLE (haystack, haystack_len, j, needle_len)) { /* Scan for matches in right half. */ - i = suffix; + size_t i = /* Index into current byte of NEEDLE. */ + suffix; while (i < needle_len && (CANON_ELEMENT (needle[i]) == CANON_ELEMENT (haystack[i + j]))) ++i; @@ -329,24 +331,21 @@ static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_long_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { - size_t i; /* Index into current byte of NEEDLE. */ - size_t j; /* Index into current window of HAYSTACK. */ - size_t period; /* The period of the right half of needle. */ - size_t suffix; /* The index of the right half of needle. */ - size_t shift_table[1U << CHAR_BIT]; /* See below. */ - /* Factor the needle into two halves, such that the left half is smaller than the global period, and the right half is periodic (with a period as large as NEEDLE_LEN - suffix). */ - suffix = critical_factorization (needle, needle_len, &period); + size_t period; /* The period of the right half of needle. */ + size_t suffix = /* The index of the right half of needle. */ + critical_factorization (needle, needle_len, &period); /* Populate shift_table. For each possible byte value c, shift_table[c] is the distance from the last occurrence of c to the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE. shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */ - for (i = 0; i < 1U << CHAR_BIT; i++) + size_t shift_table[1U << CHAR_BIT]; + for (size_t i = 0; i < 1U << CHAR_BIT; i++) shift_table[i] = needle_len; - for (i = 0; i < needle_len; i++) + for (size_t i = 0; i < needle_len; i++) shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1; /* Perform the search. Each iteration compares the right half @@ -357,13 +356,13 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, only advance by the period, so use memory to avoid rescanning known occurrences of the period in the right half. */ size_t memory = 0; - size_t shift; - j = 0; + size_t j = 0; /* Index into current window of HAYSTACK. */ while (AVAILABLE (haystack, haystack_len, j, needle_len)) { /* Check the last byte first; if it does not match, then shift to the next possible match location. */ - shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; + size_t shift = + shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; if (0 < shift) { if (memory && shift < period) @@ -375,32 +374,34 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, } memory = 0; j += shift; - continue; - } - /* Scan for matches in right half. The last byte has - already been matched, by virtue of the shift table. */ - i = MAX (suffix, memory); - while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) - == CANON_ELEMENT (haystack[i + j]))) - ++i; - if (needle_len - 1 <= i) - { - /* Scan for matches in left half. */ - i = suffix - 1; - while (memory < i + 1 && (CANON_ELEMENT (needle[i]) - == CANON_ELEMENT (haystack[i + j]))) - --i; - if (i + 1 < memory + 1) - return (RETURN_TYPE) (haystack + j); - /* No match, so remember how many repetitions of period - on the right half were scanned. */ - j += period; - memory = needle_len - period; } else { - j += i - suffix + 1; - memory = 0; + /* Scan for matches in right half. The last byte has + already been matched, by virtue of the shift table. */ + size_t i = MAX (suffix, memory); + while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len - 1 <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (memory < i + 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i + 1 < memory + 1) + return (RETURN_TYPE) (haystack + j); + /* No match, so remember how many repetitions of period + on the right half were scanned. */ + j += period; + memory = needle_len - period; + } + else + { + j += i - suffix + 1; + memory = 0; + } } } } @@ -408,38 +409,40 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, { /* The two halves of needle are distinct; no extra memory is required, and any mismatch results in a maximal shift. */ - size_t shift; period = MAX (suffix, needle_len - suffix) + 1; - j = 0; + size_t j = 0; /* Index into current window of HAYSTACK. */ while (AVAILABLE (haystack, haystack_len, j, needle_len)) { /* Check the last byte first; if it does not match, then shift to the next possible match location. */ - shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; + size_t shift = + shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])]; if (0 < shift) { j += shift; - continue; } - /* Scan for matches in right half. The last byte has - already been matched, by virtue of the shift table. */ - i = suffix; - while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) - == CANON_ELEMENT (haystack[i + j]))) - ++i; - if (needle_len - 1 <= i) + else { - /* Scan for matches in left half. */ - i = suffix - 1; - while (i != SIZE_MAX && (CANON_ELEMENT (needle[i]) - == CANON_ELEMENT (haystack[i + j]))) - --i; - if (i == SIZE_MAX) - return (RETURN_TYPE) (haystack + j); - j += period; + /* Scan for matches in right half. The last byte has + already been matched, by virtue of the shift table. */ + size_t i = suffix; + while (i < needle_len - 1 && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + ++i; + if (needle_len - 1 <= i) + { + /* Scan for matches in left half. */ + i = suffix - 1; + while (i != SIZE_MAX && (CANON_ELEMENT (needle[i]) + == CANON_ELEMENT (haystack[i + j]))) + --i; + if (i == SIZE_MAX) + return (RETURN_TYPE) (haystack + j); + j += period; + } + else + j += i - suffix + 1; } - else - j += i - suffix + 1; } } return NULL; diff --git a/gl/strcasecmp.c b/gl/strcasecmp.c index 16626d4d..67192a31 100644 --- a/gl/strcasecmp.c +++ b/gl/strcasecmp.c @@ -1,5 +1,5 @@ /* Case-insensitive string comparison function for unibyte locales. - Copyright (C) 1998-1999, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -32,29 +32,24 @@ strcasecmp (const char *s1, const char *s2) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; if (p1 == p2) return 0; - do + for (;; p1++, p2++) { - c1 = tolower (*p1); - c2 = tolower (*p2); - - if (c1 == '\0') - break; - - ++p1; - ++p2; + unsigned char c1 = tolower (*p1); + unsigned char c2 = tolower (*p2); + + if (c1 == '\0' || c1 != c2) + { + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, + the difference of two 'unsigned char' values - including the + sign bit - doesn't fit in an 'int'. */ + return _GL_CMP (c1, c2); + } } - while (c1 == c2); - - if (UCHAR_MAX <= INT_MAX) - return c1 - c2; - else - /* On machines where 'char' and 'int' are types of the same size, the - difference of two 'unsigned char' values - including the sign bit - - doesn't fit in an 'int'. */ - return _GL_CMP (c1, c2); } diff --git a/gl/strcasestr.c b/gl/strcasestr.c index fd0e2c3e..fcfbcf3b 100644 --- a/gl/strcasestr.c +++ b/gl/strcasestr.c @@ -1,5 +1,5 @@ /* Case-insensitive searching in a string. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2005. This file is free software: you can redistribute it and/or modify @@ -39,29 +39,32 @@ char * strcasestr (const char *haystack_start, const char *needle_start) { - const char *haystack = haystack_start; const char *needle = needle_start; - size_t needle_len; /* Length of NEEDLE. */ - size_t haystack_len; /* Known minimum length of HAYSTACK. */ - bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */ /* Determine length of NEEDLE, and in the process, make sure HAYSTACK is at least as long (no point processing all of a long NEEDLE if HAYSTACK is too short). */ - while (*haystack && *needle) - { - ok &= (tolower ((unsigned char) *haystack) - == tolower ((unsigned char) *needle)); - haystack++; - needle++; - } - if (*needle) - return NULL; - if (ok) - return (char *) haystack_start; - needle_len = needle - needle_start; - haystack = haystack_start + 1; - haystack_len = needle_len - 1; + { + const char *haystack = haystack_start; + bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */ + while (*haystack && *needle) + { + ok &= (tolower ((unsigned char) *haystack) + == tolower ((unsigned char) *needle)); + haystack++; + needle++; + } + if (*needle) + return NULL; + if (ok) + return (char *) haystack_start; + } + + size_t needle_len = /* Length of NEEDLE. */ + needle - needle_start; + const char *haystack = haystack_start + 1; + size_t haystack_len = /* Known minimum length of HAYSTACK. */ + needle_len - 1; /* Perform the search. Abstract memory is considered to be an array of 'unsigned char' values, not an array of 'char' values. See diff --git a/gl/streq.h b/gl/streq.h index 1f1ff38f..505fc4ae 100644 --- a/gl/streq.h +++ b/gl/streq.h @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -39,7 +39,7 @@ extern "C" { static inline int streq9 (const char *s1, const char *s2) { - return strcmp (s1 + 9, s2 + 9) == 0; + return streq (s1 + 9, s2 + 9); } static inline int diff --git a/gl/strerror-override.c b/gl/strerror-override.c index 3cc25905..a07ed62f 100644 --- a/gl/strerror-override.c +++ b/gl/strerror-override.c @@ -1,6 +1,6 @@ /* strerror-override.c --- POSIX compatible system error routine - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/strerror-override.h b/gl/strerror-override.h index 653ea0ad..1e84bdbc 100644 --- a/gl/strerror-override.h +++ b/gl/strerror-override.h @@ -1,6 +1,6 @@ /* strerror-override.h --- POSIX compatible system error routine - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/strerror.c b/gl/strerror.c index 72572ae4..c451f055 100644 --- a/gl/strerror.c +++ b/gl/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -42,7 +42,6 @@ strerror (int n) #undef strerror { static char buf[STACKBUF_LEN]; - size_t len; /* Cast away const, due to the historical signature of strerror; callers should not be modifying the string. */ @@ -67,7 +66,7 @@ strerror (int n) } /* Fix STACKBUF_LEN if this ever aborts. */ - len = strlen (msg); + size_t len = strlen (msg); if (sizeof buf <= len) abort (); diff --git a/gl/string.c b/gl/string.c new file mode 100644 index 00000000..c2e1b1f4 --- /dev/null +++ b/gl/string.c @@ -0,0 +1,19 @@ +/* streq and memeq functions. + Copyright (C) 2025-2026 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#define _GL_STRING_INLINE _GL_EXTERN_INLINE +#include +#include diff --git a/gl/string.in.h b/gl/string.in.h index 25e6a087..b54ec0ca 100644 --- a/gl/string.in.h +++ b/gl/string.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995-1996, 2001-2025 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -80,6 +80,12 @@ # include #endif +_GL_INLINE_HEADER_BEGIN + +#ifndef _GL_STRING_INLINE +# define _GL_STRING_INLINE _GL_INLINE +#endif + /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers that can be freed by passing them as the Ith argument to the function F. */ @@ -96,7 +102,7 @@ /* Applies to: functions. Cannot be used on inline functions. */ #ifndef _GL_ATTRIBUTE_DEALLOC_FREE # if defined __cplusplus && defined __GNUC__ && !defined __clang__ -/* Work around GCC bug */ +/* Work around GCC bug */ # define _GL_ATTRIBUTE_DEALLOC_FREE \ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1) # else @@ -306,7 +312,6 @@ _GL_FUNCDECL_SYS (explicit_bzero, void, _GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n)); _GL_CXXALIASWARN (explicit_bzero); #elif defined GNULIB_POSIXCHECK -# undef explicit_bzero # if HAVE_RAW_DECL_EXPLICIT_BZERO _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - " "use gnulib module explicit_bzero for portability"); @@ -322,7 +327,6 @@ _GL_FUNCDECL_SYS (ffsl, int, (long int i), ); _GL_CXXALIAS_SYS (ffsl, int, (long int i)); _GL_CXXALIASWARN (ffsl); #elif defined GNULIB_POSIXCHECK -# undef ffsl # if HAVE_RAW_DECL_FFSL _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); # endif @@ -345,7 +349,6 @@ _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); # endif _GL_CXXALIASWARN (ffsll); #elif defined GNULIB_POSIXCHECK -# undef ffsll # if HAVE_RAW_DECL_FFSLL _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module"); # endif @@ -403,7 +406,6 @@ _GL_CXXALIASWARN1 (memchr, void const *, _GL_CXXALIASWARN (memchr); # endif #elif defined GNULIB_POSIXCHECK -# undef memchr /* Assume memchr is always declared. */ _GL_WARN_ON_USE_CXX (memchr, const void *, void *, (void const *, int, size_t), @@ -411,6 +413,21 @@ _GL_WARN_ON_USE_CXX (memchr, "use gnulib module memchr for portability" ); #endif +/* Are S1 and S2, of size N, bytewise equal? */ +#if @GNULIB_STRINGEQ@ && !@HAVE_DECL_MEMEQ@ +# ifdef __cplusplus +extern "C" { +# endif +_GL_STRING_INLINE bool +memeq (void const *__s1, void const *__s2, size_t __n) +{ + return !memcmp (__s1, __s2, __n); +} +# ifdef __cplusplus +} +# endif +#endif + /* Return the first occurrence of NEEDLE in HAYSTACK. */ #if @GNULIB_MEMMEM@ # if @REPLACE_MEMMEM@ @@ -439,7 +456,6 @@ _GL_CXXALIAS_SYS (memmem, void *, # endif _GL_CXXALIASWARN (memmem); #elif defined GNULIB_POSIXCHECK -# undef memmem # if HAVE_RAW_DECL_MEMMEM _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - " "use gnulib module memmem-simple for portability, " @@ -477,7 +493,6 @@ _GL_CXXALIAS_SYS (mempcpy, void *, _GL_CXXALIASWARN (mempcpy); # endif #elif defined GNULIB_POSIXCHECK -# undef mempcpy # if HAVE_RAW_DECL_MEMPCPY _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " "use gnulib module mempcpy for portability"); @@ -510,7 +525,6 @@ _GL_CXXALIASWARN1 (memrchr, void const *, _GL_CXXALIASWARN (memrchr); # endif #elif defined GNULIB_POSIXCHECK -# undef memrchr # if HAVE_RAW_DECL_MEMRCHR _GL_WARN_ON_USE (memrchr, "memrchr is unportable - " "use gnulib module memrchr for portability"); @@ -541,7 +555,6 @@ _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); _GL_CXXALIASWARN (memset_explicit); # endif #elif defined GNULIB_POSIXCHECK -# undef memset_explicit # if HAVE_RAW_DECL_MEMSET_EXPLICIT _GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - " "use gnulib module memset_explicit for portability"); @@ -576,7 +589,6 @@ _GL_CXXALIASWARN1 (rawmemchr, void const *, _GL_CXXALIASWARN (rawmemchr); # endif #elif defined GNULIB_POSIXCHECK -# undef rawmemchr # if HAVE_RAW_DECL_RAWMEMCHR _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - " "use gnulib module rawmemchr for portability"); @@ -608,7 +620,6 @@ _GL_CXXALIAS_SYS (stpcpy, char *, _GL_CXXALIASWARN (stpcpy); # endif #elif defined GNULIB_POSIXCHECK -# undef stpcpy # if HAVE_RAW_DECL_STPCPY _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - " "use gnulib module stpcpy for portability"); @@ -645,7 +656,6 @@ _GL_CXXALIAS_SYS (stpncpy, char *, _GL_CXXALIASWARN (stpncpy); # endif #elif defined GNULIB_POSIXCHECK -# undef stpncpy # if HAVE_RAW_DECL_STPNCPY _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " "use gnulib module stpncpy for portability"); @@ -655,7 +665,6 @@ _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " #if defined GNULIB_POSIXCHECK /* strchr() does not work with multibyte strings if the locale encoding is GB18030 and the character to be searched is a digit. */ -# undef strchr /* Assume strchr is always declared. */ _GL_WARN_ON_USE_CXX (strchr, const char *, char *, (const char *, int), @@ -701,7 +710,6 @@ _GL_CXXALIASWARN1 (strchrnul, char const *, _GL_CXXALIASWARN (strchrnul); # endif #elif defined GNULIB_POSIXCHECK -# undef strchrnul # if HAVE_RAW_DECL_STRCHRNUL _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " "use gnulib module strchrnul for portability"); @@ -766,7 +774,6 @@ _GL_FUNCDECL_SYS (strdup, char *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef strdup # if HAVE_RAW_DECL_STRDUP _GL_WARN_ON_USE (strdup, "strdup is unportable - " "use gnulib module strdup for portability"); @@ -791,6 +798,21 @@ _GL_CXXALIASWARN (strdup); # endif #endif +/* Are strings S1 and S2 equal? */ +#if @GNULIB_STRINGEQ@ && !@HAVE_DECL_STREQ@ +# ifdef __cplusplus +extern "C" { +# endif +_GL_STRING_INLINE bool +streq (char const *__s1, char const *__s2) +{ + return !strcmp (__s1, __s2); +} +# ifdef __cplusplus +} +# endif +#endif + /* Append no more than N characters from SRC onto DEST. */ #if @GNULIB_STRNCAT@ # if @REPLACE_STRNCAT@ @@ -812,7 +834,6 @@ _GL_CXXALIAS_SYS (strncat, char *, _GL_CXXALIASWARN (strncat); # endif #elif defined GNULIB_POSIXCHECK -# undef strncat # if HAVE_RAW_DECL_STRNCAT _GL_WARN_ON_USE (strncat, "strncat is unportable - " "use gnulib module strncat for portability"); @@ -896,7 +917,6 @@ _GL_FUNCDECL_SYS (strndup, char *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef strndup # if HAVE_RAW_DECL_STRNDUP _GL_WARN_ON_USE (strndup, "strndup is unportable - " "use gnulib module strndup for portability"); @@ -927,7 +947,6 @@ _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)); # endif _GL_CXXALIASWARN (strnlen); #elif defined GNULIB_POSIXCHECK -# undef strnlen # if HAVE_RAW_DECL_STRNLEN _GL_WARN_ON_USE (strnlen, "strnlen is unportable - " "use gnulib module strnlen for portability"); @@ -939,7 +958,6 @@ _GL_WARN_ON_USE (strnlen, "strnlen is unportable - " Even in this simple case, it does not work with multibyte strings if the locale encoding is GB18030 and one of the characters to be searched is a digit. */ -# undef strcspn /* Assume strcspn is always declared. */ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings " "in multibyte locales - " @@ -976,7 +994,6 @@ _GL_CXXALIASWARN (strpbrk); Even in this simple case, it does not work with multibyte strings if the locale encoding is GB18030 and one of the characters to be searched is a digit. */ -# undef strpbrk _GL_WARN_ON_USE_CXX (strpbrk, const char *, char *, (const char *, const char *), "strpbrk cannot work correctly on character strings " @@ -996,7 +1013,6 @@ _GL_WARN_ON_USE_CXX (strpbrk, #if defined GNULIB_POSIXCHECK /* strspn() assumes the second argument is a list of single-byte characters. Even in this simple case, it cannot work with multibyte strings. */ -# undef strspn /* Assume strspn is always declared. */ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " "in multibyte locales - " @@ -1006,7 +1022,6 @@ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " #if defined GNULIB_POSIXCHECK /* strrchr() does not work with multibyte strings if the locale encoding is GB18030 and the character to be searched is a digit. */ -# undef strrchr /* Assume strrchr is always declared. */ _GL_WARN_ON_USE_CXX (strrchr, const char *, char *, (const char *, int), @@ -1041,13 +1056,11 @@ _GL_CXXALIAS_SYS (strsep, char *, (char **restrict __stringp, char const *restrict __delim)); _GL_CXXALIASWARN (strsep); # if defined GNULIB_POSIXCHECK -# undef strsep _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings " "in multibyte locales - " "use mbssep if you care about internationalization"); # endif #elif defined GNULIB_POSIXCHECK -# undef strsep # if HAVE_RAW_DECL_STRSEP _GL_WARN_ON_USE (strsep, "strsep is unportable - " "use gnulib module strsep for portability"); @@ -1142,7 +1155,6 @@ _GL_CXXALIASWARN (strcasestr); /* strcasestr() does not work with multibyte strings: It is a glibc extension, and glibc implements it only for unibyte locales. */ -# undef strcasestr # if HAVE_RAW_DECL_STRCASESTR _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character " "strings in multibyte locales - " @@ -1188,7 +1200,7 @@ _GL_CXXALIAS_RPL (strtok_r, char *, (char *restrict s, char const *restrict delim, char **restrict save_ptr)); # else -# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK +# if @UNDEFINE_STRTOK_R@ # undef strtok_r # endif # if ! @HAVE_DECL_STRTOK_R@ @@ -1208,7 +1220,6 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character " "use mbstok_r if you care about internationalization"); # endif #elif defined GNULIB_POSIXCHECK -# undef strtok_r # if HAVE_RAW_DECL_STRTOK_R _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - " "use gnulib module strtok_r for portability"); @@ -1241,7 +1252,7 @@ _GL_EXTERN_C bool str_endswith (const char *string, const char *prefix) # ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */ # undef mbslen # endif -# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */ +# if @HAVE_MBSLEN@ /* AIX, MirBSD define mbslen already in libc. */ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define mbslen rpl_mbslen # endif @@ -1546,8 +1557,6 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim, _GL_EXTERN_C bool mbs_startswith (const char *string, const char *prefix) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1, 2)); -/* No extra code is needed for multibyte locales for this function. */ -# define mbs_startswith str_startswith #endif #if @GNULIB_MBS_ENDSWITH@ @@ -1576,7 +1585,6 @@ _GL_CXXALIAS_SYS (strerror, char *, (int)); _GL_CXXALIASWARN (strerror); # endif #elif defined GNULIB_POSIXCHECK -# undef strerror /* Assume strerror is always declared. */ _GL_WARN_ON_USE (strerror, "strerror is unportable - " "use gnulib module strerror to guarantee non-NULL result"); @@ -1604,7 +1612,6 @@ _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); _GL_CXXALIASWARN (strerror_r); # endif #elif defined GNULIB_POSIXCHECK -# undef strerror_r # if HAVE_RAW_DECL_STRERROR_R _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " "use gnulib module strerror_r-posix for portability"); @@ -1633,7 +1640,6 @@ _GL_CXXALIAS_SYS (strerror_l, char *, (int errnum, locale_t locale)); _GL_CXXALIASWARN (strerror_l); # endif #elif defined GNULIB_POSIXCHECK -# undef strerror_l # if HAVE_RAW_DECL_STRERROR_L _GL_WARN_ON_USE (strerror_l, "strerror_l is unportable - " "use gnulib module strerror_l for portability"); @@ -1668,7 +1674,6 @@ _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); _GL_CXXALIASWARN (strerrorname_np); # endif #elif defined GNULIB_POSIXCHECK -# undef strerrorname_np # if HAVE_RAW_DECL_STRERRORNAME_NP _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " "use gnulib module strerrorname_np for portability"); @@ -1683,7 +1688,6 @@ _GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig), ); _GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); _GL_CXXALIASWARN (sigabbrev_np); #elif defined GNULIB_POSIXCHECK -# undef sigabbrev_np # if HAVE_RAW_DECL_SIGABBREV_NP _GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - " "use gnulib module sigabbrev_np for portability"); @@ -1698,7 +1702,6 @@ _GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig), ); _GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); _GL_CXXALIASWARN (sigdescr_np); #elif defined GNULIB_POSIXCHECK -# undef sigdescr_np # if HAVE_RAW_DECL_SIGDESCR_NP _GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - " "use gnulib module sigdescr_np for portability"); @@ -1722,7 +1725,6 @@ _GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig)); # endif _GL_CXXALIASWARN (strsignal); #elif defined GNULIB_POSIXCHECK -# undef strsignal # if HAVE_RAW_DECL_STRSIGNAL _GL_WARN_ON_USE (strsignal, "strsignal is unportable - " "use gnulib module strsignal for portability"); @@ -1748,13 +1750,13 @@ _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *)); # endif _GL_CXXALIASWARN (strverscmp); #elif defined GNULIB_POSIXCHECK -# undef strverscmp # if HAVE_RAW_DECL_STRVERSCMP _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - " "use gnulib module strverscmp for portability"); # endif #endif +_GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_STRING_H */ #endif /* _@GUARD_PREFIX@_STRING_H */ diff --git a/gl/strings.in.h b/gl/strings.in.h index 40c891d7..fd7cd2df 100644 --- a/gl/strings.in.h +++ b/gl/strings.in.h @@ -1,6 +1,6 @@ /* A substitute . - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -76,7 +76,6 @@ _GL_FUNCDECL_SYS (ffs, int, (int i), ); _GL_CXXALIAS_SYS (ffs, int, (int i)); _GL_CXXALIASWARN (ffs); #elif defined GNULIB_POSIXCHECK -# undef ffs # if HAVE_RAW_DECL_FFS _GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module"); # endif @@ -109,7 +108,6 @@ _GL_CXXALIASWARN (strcasecmp); /* strcasecmp() does not work with multibyte strings: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ -# undef strcasecmp # if HAVE_RAW_DECL_STRCASECMP _GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character " "strings in multibyte locales and is unportable - " @@ -147,7 +145,6 @@ _GL_CXXALIASWARN (strcasecmp_l); /* strcasecmp_l() does not work with multibyte strings: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ -# undef strcasecmp_l # if HAVE_RAW_DECL_STRCASECMP_L _GL_WARN_ON_USE (strcasecmp_l, "strcasecmp_l cannot work correctly on " "character strings in multibyte locales and is unportable - " @@ -182,7 +179,6 @@ _GL_CXXALIASWARN (strncasecmp); /* strncasecmp() does not work with multibyte strings: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ -# undef strncasecmp # if HAVE_RAW_DECL_STRNCASECMP _GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character " "strings in multibyte locales and is unportable - " @@ -220,7 +216,6 @@ _GL_CXXALIASWARN (strncasecmp_l); /* strncasecmp_l() does not work with multibyte strings: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ -# undef strncasecmp_l # if HAVE_RAW_DECL_STRNCASECMP_L _GL_WARN_ON_USE (strncasecmp_l, "strncasecmp_l cannot work correctly on " "character strings in multibyte locales and is unportable - " diff --git a/gl/stripslash.c b/gl/stripslash.c index d5b07bca..8f8c38e3 100644 --- a/gl/stripslash.c +++ b/gl/stripslash.c @@ -1,6 +1,6 @@ /* stripslash.c -- remove redundant trailing slashes from a file name - Copyright (C) 1990, 2001, 2003-2006, 2009-2025 Free Software Foundation, + Copyright (C) 1990, 2001, 2003-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify @@ -31,15 +31,13 @@ bool strip_trailing_slashes (char *file) { char *base = last_component (file); - char *base_lim; - bool had_slash; /* last_component returns "" for file system roots, but we need to turn "///" into "/". */ if (! *base) base = file; - base_lim = base + base_len (base); - had_slash = (*base_lim != '\0'); + char *base_lim = base + base_len (base); + bool had_slash = (*base_lim != '\0'); *base_lim = '\0'; return had_slash; } diff --git a/gl/strncasecmp.c b/gl/strncasecmp.c index 7d7c5b7f..c6bec00d 100644 --- a/gl/strncasecmp.c +++ b/gl/strncasecmp.c @@ -1,5 +1,5 @@ /* Case-insensitive string comparison function for unibyte locales. - Copyright (C) 1998-1999, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -32,29 +32,24 @@ strncasecmp (const char *s1, const char *s2, size_t n) { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; if (p1 == p2 || n == 0) return 0; - do + for (;; p1++, p2++) { - c1 = tolower (*p1); - c2 = tolower (*p2); - - if (--n == 0 || c1 == '\0') - break; - - ++p1; - ++p2; + unsigned char c1 = tolower (*p1); + unsigned char c2 = tolower (*p2); + + if (--n == 0 || c1 == '\0' || c1 != c2) + { + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, + the difference of two 'unsigned char' values - including the + sign bit - doesn't fit in an 'int'. */ + return _GL_CMP (c1, c2); + } } - while (c1 == c2); - - if (UCHAR_MAX <= INT_MAX) - return c1 - c2; - else - /* On machines where 'char' and 'int' are types of the same size, the - difference of two 'unsigned char' values - including the sign bit - - doesn't fit in an 'int'. */ - return _GL_CMP (c1, c2); } diff --git a/gl/strncpy.c b/gl/strncpy.c index 1b680046..25908377 100644 --- a/gl/strncpy.c +++ b/gl/strncpy.c @@ -1,9 +1,9 @@ /* Copy a size-bounded string. - Copyright (C) 1999, 2011-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/gl/strsep.c b/gl/strsep.c index 5a489d11..6338c62d 100644 --- a/gl/strsep.c +++ b/gl/strsep.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2007, 2009-2025 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2007, 2009-2026 Free Software Foundation, Inc. Written by Yoann Vandoorselaere . @@ -26,7 +26,6 @@ char * strsep (char **stringp, const char *delim) { char *start = *stringp; - char *ptr; if (start == NULL) return NULL; @@ -38,12 +37,14 @@ strsep (char **stringp, const char *delim) return start; } + char *ptr; /* Optimize the case of one delimiter. */ if (delim[1] == '\0') ptr = strchr (start, delim[0]); else /* The general case. */ ptr = strpbrk (start, delim); + if (ptr == NULL) { *stringp = NULL; diff --git a/gl/strstr.c b/gl/strstr.c index d6953f90..a5730a37 100644 --- a/gl/strstr.c +++ b/gl/strstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2025 Free Software +/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -36,31 +36,33 @@ char * strstr (const char *haystack_start, const char *needle_start) { - const char *haystack = haystack_start; const char *needle = needle_start; - size_t needle_len; /* Length of NEEDLE. */ - size_t haystack_len; /* Known minimum length of HAYSTACK. */ - bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */ /* Determine length of NEEDLE, and in the process, make sure HAYSTACK is at least as long (no point processing all of a long NEEDLE if HAYSTACK is too short). */ - while (*haystack && *needle) - ok &= *haystack++ == *needle++; - if (*needle) - return NULL; - if (ok) - return (char *) haystack_start; + { + const char *haystack = haystack_start; + bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */ + while (*haystack && *needle) + ok &= *haystack++ == *needle++; + if (*needle) + return NULL; + if (ok) + return (char *) haystack_start; + } /* Reduce the size of haystack using strchr, since it has a smaller linear coefficient than the Two-Way algorithm. */ - needle_len = needle - needle_start; - haystack = strchr (haystack_start + 1, *needle_start); + size_t needle_len = /* Length of NEEDLE. */ + needle - needle_start; + const char *haystack = strchr (haystack_start + 1, *needle_start); if (!haystack || __builtin_expect (needle_len == 1, 0)) return (char *) haystack; needle -= needle_len; - haystack_len = (haystack > haystack_start + needle_len ? 1 - : needle_len + haystack_start - haystack); + size_t haystack_len = /* Known minimum length of HAYSTACK. */ + (haystack > haystack_start + needle_len ? 1 + : needle_len + haystack_start - haystack); /* Perform the search. Abstract memory is considered to be an array of 'unsigned char' values, not an array of 'char' values. See diff --git a/gl/sys-limits.h b/gl/sys-limits.h index a556dfeb..d61ebdf7 100644 --- a/gl/sys-limits.h +++ b/gl/sys-limits.h @@ -1,6 +1,6 @@ /* System call limits - Copyright 2018-2025 Free Software Foundation, Inc. + Copyright 2018-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -30,10 +30,6 @@ Using this also works around a serious Linux bug before 2.6.16; see . - Using this also works around a Tru64 5.1 bug, where attempting - to read INT_MAX bytes fails with errno == EINVAL. See - . - Using this is likely to work around similar bugs in other operating systems. */ diff --git a/gl/sys_socket.c b/gl/sys_socket.c index efd36610..023a7c55 100644 --- a/gl/sys_socket.c +++ b/gl/sys_socket.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h index 8632c66d..c19b7461 100644 --- a/gl/sys_socket.in.h +++ b/gl/sys_socket.in.h @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. Written by Simon Josefsson. This file is free software: you can redistribute it and/or modify @@ -235,11 +235,10 @@ struct msghdr { _GL_SYS_SOCKET_INLINE int rpl_fd_isset (SOCKET fd, fd_set * set) { - u_int i; if (set == NULL) return 0; - for (i = 0; i < set->fd_count; i++) + for (u_int i = 0; i < set->fd_count; i++) if (set->fd_array[i] == fd) return 1; @@ -304,7 +303,6 @@ _GL_CXXALIASWARN (socket); # define socket socket_used_without_requesting_gnulib_module_socket # endif #elif defined GNULIB_POSIXCHECK -# undef socket # if HAVE_RAW_DECL_SOCKET _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - " "use gnulib module socket for portability"); @@ -336,7 +334,6 @@ _GL_CXXALIASWARN (connect); # define connect connect_used_without_requesting_gnulib_module_connect # endif #elif defined GNULIB_POSIXCHECK -# undef connect # if HAVE_RAW_DECL_CONNECT _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - " "use gnulib module connect for portability"); @@ -374,7 +371,6 @@ _GL_CXXALIASWARN (accept); # define accept accept_used_without_requesting_gnulib_module_accept # endif #elif defined GNULIB_POSIXCHECK -# undef accept # if HAVE_RAW_DECL_ACCEPT _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - " "use gnulib module accept for portability"); @@ -406,7 +402,6 @@ _GL_CXXALIASWARN (bind); # define bind bind_used_without_requesting_gnulib_module_bind # endif #elif defined GNULIB_POSIXCHECK -# undef bind # if HAVE_RAW_DECL_BIND _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - " "use gnulib module bind for portability"); @@ -442,7 +437,6 @@ _GL_CXXALIASWARN (getpeername); # define getpeername getpeername_used_without_requesting_gnulib_module_getpeername # endif #elif defined GNULIB_POSIXCHECK -# undef getpeername # if HAVE_RAW_DECL_GETPEERNAME _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - " "use gnulib module getpeername for portability"); @@ -478,7 +472,6 @@ _GL_CXXALIASWARN (getsockname); # define getsockname getsockname_used_without_requesting_gnulib_module_getsockname # endif #elif defined GNULIB_POSIXCHECK -# undef getsockname # if HAVE_RAW_DECL_GETSOCKNAME _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " "use gnulib module getsockname for portability"); @@ -512,7 +505,6 @@ _GL_CXXALIASWARN (getsockopt); # define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt # endif #elif defined GNULIB_POSIXCHECK -# undef getsockopt # if HAVE_RAW_DECL_GETSOCKOPT _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - " "use gnulib module getsockopt for portability"); @@ -537,7 +529,6 @@ _GL_CXXALIASWARN (listen); # define listen listen_used_without_requesting_gnulib_module_listen # endif #elif defined GNULIB_POSIXCHECK -# undef listen # if HAVE_RAW_DECL_LISTEN _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - " "use gnulib module listen for portability"); @@ -566,7 +557,6 @@ _GL_CXXALIASWARN (recv); # define recv recv_used_without_requesting_gnulib_module_recv # endif #elif defined GNULIB_POSIXCHECK -# undef recv # if HAVE_RAW_DECL_RECV _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - " "use gnulib module recv for portability"); @@ -598,7 +588,6 @@ _GL_CXXALIASWARN (send); # define send send_used_without_requesting_gnulib_module_send # endif #elif defined GNULIB_POSIXCHECK -# undef send # if HAVE_RAW_DECL_SEND _GL_WARN_ON_USE (send, "send is not always POSIX compliant - " "use gnulib module send for portability"); @@ -637,7 +626,6 @@ _GL_CXXALIASWARN (recvfrom); # define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom # endif #elif defined GNULIB_POSIXCHECK -# undef recvfrom # if HAVE_RAW_DECL_RECVFROM _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - " "use gnulib module recvfrom for portability"); @@ -671,7 +659,6 @@ _GL_CXXALIASWARN (sendto); # define sendto sendto_used_without_requesting_gnulib_module_sendto # endif #elif defined GNULIB_POSIXCHECK -# undef sendto # if HAVE_RAW_DECL_SENDTO _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - " "use gnulib module sendto for portability"); @@ -703,7 +690,6 @@ _GL_CXXALIASWARN (setsockopt); # define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt # endif #elif defined GNULIB_POSIXCHECK -# undef setsockopt # if HAVE_RAW_DECL_SETSOCKOPT _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - " "use gnulib module setsockopt for portability"); @@ -728,7 +714,6 @@ _GL_CXXALIASWARN (shutdown); # define shutdown shutdown_used_without_requesting_gnulib_module_shutdown # endif #elif defined GNULIB_POSIXCHECK -# undef shutdown # if HAVE_RAW_DECL_SHUTDOWN _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - " "use gnulib module shutdown for portability"); @@ -761,7 +746,6 @@ _GL_CXXALIAS_SYS (accept4, int, # endif _GL_CXXALIASWARN (accept4); #elif defined GNULIB_POSIXCHECK -# undef accept4 # if HAVE_RAW_DECL_ACCEPT4 _GL_WARN_ON_USE (accept4, "accept4 is unportable - " "use gnulib module accept4 for portability"); diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h index c3c38fd6..deed21cd 100644 --- a/gl/sys_stat.in.h +++ b/gl/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat.h header file. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -451,7 +451,6 @@ _GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode)); # endif _GL_CXXALIASWARN (chmod); #elif defined GNULIB_POSIXCHECK -# undef chmod # if HAVE_RAW_DECL_CHMOD _GL_WARN_ON_USE (chmod, "chmod has portability problems - " "use gnulib module chmod for portability"); @@ -496,7 +495,6 @@ _GL_CXXALIAS_SYS (fchmodat, int, # endif _GL_CXXALIASWARN (fchmodat); #elif defined GNULIB_POSIXCHECK -# undef fchmodat # if HAVE_RAW_DECL_FCHMODAT _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " "use gnulib module openat for portability"); @@ -528,7 +526,6 @@ _GL_CXXALIASWARN (fstat); /* Above, we define stat to _stati64. */ # define fstat _fstati64 #elif defined GNULIB_POSIXCHECK -# undef fstat # if HAVE_RAW_DECL_FSTAT _GL_WARN_ON_USE (fstat, "fstat has portability problems - " "use gnulib module fstat for portability"); @@ -567,7 +564,6 @@ _GL_CXXALIASWARN (fstatat); # define fstatat fstatat_used_without_requesting_gnulib_module_fstatat # endif #elif defined GNULIB_POSIXCHECK -# undef fstatat # if HAVE_RAW_DECL_FSTATAT _GL_WARN_ON_USE (fstatat, "fstatat is not portable - " "use gnulib module openat for portability"); @@ -597,7 +593,6 @@ _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); _GL_CXXALIASWARN (futimens); # endif #elif defined GNULIB_POSIXCHECK -# undef futimens # if HAVE_RAW_DECL_FUTIMENS _GL_WARN_ON_USE (futimens, "futimens is not portable - " "use gnulib module futimens for portability"); @@ -618,7 +613,6 @@ _GL_CXXALIAS_SYS (getumask, mode_t, (void)); _GL_CXXALIASWARN (getumask); # endif #elif defined GNULIB_POSIXCHECK -# undef getumask # if HAVE_RAW_DECL_GETUMASK _GL_WARN_ON_USE (getumask, "getumask is not portable - " "use gnulib module getumask for portability"); @@ -636,7 +630,6 @@ _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode), _GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); _GL_CXXALIASWARN (lchmod); #elif defined GNULIB_POSIXCHECK -# undef lchmod # if HAVE_RAW_DECL_LCHMOD _GL_WARN_ON_USE (lchmod, "lchmod is unportable - " "use gnulib module lchmod for portability"); @@ -698,7 +691,6 @@ _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); # endif _GL_CXXALIASWARN (mkdir); #elif defined GNULIB_POSIXCHECK -# undef mkdir # if HAVE_RAW_DECL_MKDIR _GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - " "use gnulib module mkdir for portability"); @@ -714,7 +706,6 @@ _GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode), _GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)); _GL_CXXALIASWARN (mkdirat); #elif defined GNULIB_POSIXCHECK -# undef mkdirat # if HAVE_RAW_DECL_MKDIRAT _GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - " "use gnulib module openat for portability"); @@ -740,7 +731,6 @@ _GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode)); # endif _GL_CXXALIASWARN (mkfifo); #elif defined GNULIB_POSIXCHECK -# undef mkfifo # if HAVE_RAW_DECL_MKFIFO _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - " "use gnulib module mkfifo for portability"); @@ -768,7 +758,6 @@ _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); _GL_CXXALIASWARN (mkfifoat); # endif #elif defined GNULIB_POSIXCHECK -# undef mkfifoat # if HAVE_RAW_DECL_MKFIFOAT _GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - " "use gnulib module mkfifoat for portability"); @@ -790,12 +779,10 @@ _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); _GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev), _GL_ARG_NONNULL ((1))); # endif -/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ -_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); +_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)); # endif _GL_CXXALIASWARN (mknod); #elif defined GNULIB_POSIXCHECK -# undef mknod # if HAVE_RAW_DECL_MKNOD _GL_WARN_ON_USE (mknod, "mknod is not portable - " "use gnulib module mknod for portability"); @@ -827,7 +814,6 @@ _GL_CXXALIAS_SYS (mknodat, int, _GL_CXXALIASWARN (mknodat); # endif #elif defined GNULIB_POSIXCHECK -# undef mknodat # if HAVE_RAW_DECL_MKNODAT _GL_WARN_ON_USE (mknodat, "mknodat is not portable - " "use gnulib module mkfifoat for portability"); @@ -905,7 +891,6 @@ _GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf) #define stat stat_used_without_requesting_gnulib_module_stat */ #elif defined GNULIB_POSIXCHECK -# undef stat # if HAVE_RAW_DECL_STAT _GL_WARN_ON_USE (stat, "stat is unportable - " "use gnulib module stat for portability"); @@ -945,7 +930,6 @@ _GL_CXXALIASWARN (lstat); # define lstat lstat_used_without_requesting_gnulib_module_lstat # endif #elif defined GNULIB_POSIXCHECK -# undef lstat # if HAVE_RAW_DECL_LSTAT _GL_WARN_ON_USE (lstat, "lstat is unportable - " "use gnulib module lstat for portability"); @@ -999,7 +983,6 @@ _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, _GL_CXXALIASWARN (utimensat); # endif #elif defined GNULIB_POSIXCHECK -# undef utimensat # if HAVE_RAW_DECL_UTIMENSAT _GL_WARN_ON_USE (utimensat, "utimensat is not portable - " "use gnulib module utimensat for portability"); diff --git a/gl/sys_types.in.h b/gl/sys_types.in.h index acf9b2f7..733b4ba4 100644 --- a/gl/sys_types.in.h +++ b/gl/sys_types.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/sys_uio.in.h b/gl/sys_uio.in.h index fec3a70a..8f7f506f 100644 --- a/gl/sys_uio.in.h +++ b/gl/sys_uio.in.h @@ -1,5 +1,5 @@ /* Substitute for . - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/time.in.h b/gl/time.in.h index 3ff16e3b..5bbccf76 100644 --- a/gl/time.in.h +++ b/gl/time.in.h @@ -1,6 +1,6 @@ /* A more-standard . - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -161,7 +161,6 @@ _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); _GL_CXXALIASWARN (timespec_get); # endif # elif defined GNULIB_POSIXCHECK -# undef timespec_get # if HAVE_RAW_DECL_TIMESPEC_GET _GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - " "use gnulib module timespec_get for portability"); @@ -190,7 +189,6 @@ _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); _GL_CXXALIASWARN (timespec_getres); # endif # elif defined GNULIB_POSIXCHECK -# undef timespec_getres # if HAVE_RAW_DECL_TIMESPEC_GETRES _GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - " "use gnulib module timespec_getres for portability"); @@ -212,7 +210,6 @@ _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); _GL_CXXALIASWARN (time); # endif # elif defined GNULIB_POSIXCHECK -# undef time # if HAVE_RAW_DECL_TIME _GL_WARN_ON_USE (time, "time has consistency problems - " "use gnulib module time for portability"); @@ -243,7 +240,6 @@ _GL_CXXALIAS_SYS (nanosleep, int, # endif _GL_CXXALIASWARN (nanosleep); # elif defined GNULIB_POSIXCHECK -# undef nanosleep # if HAVE_RAW_DECL_NANOSLEEP _GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - " "use gnulib module nanosleep for portability"); @@ -284,7 +280,6 @@ _GL_CXXALIAS_SYS (tzset, void, (void)); # endif _GL_CXXALIASWARN (tzset); # elif defined GNULIB_POSIXCHECK -# undef tzset # if HAVE_RAW_DECL_TZSET _GL_WARN_ON_USE (tzset, "tzset has portability problems - " "use gnulib module tzset for portability"); @@ -306,7 +301,6 @@ _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); _GL_CXXALIASWARN (mktime); # endif # elif defined GNULIB_POSIXCHECK -# undef mktime # if HAVE_RAW_DECL_MKTIME _GL_WARN_ON_USE (mktime, "mktime has portability problems - " "use gnulib module mktime for portability"); @@ -362,12 +356,10 @@ _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, _GL_CXXALIASWARN (gmtime_r); # endif # elif defined GNULIB_POSIXCHECK -# undef localtime_r # if HAVE_RAW_DECL_LOCALTIME_R _GL_WARN_ON_USE (localtime_r, "localtime_r is unportable - " "use gnulib module time_r for portability"); # endif -# undef gmtime_r # if HAVE_RAW_DECL_GMTIME_R _GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - " "use gnulib module time_r for portability"); @@ -393,7 +385,6 @@ _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); _GL_CXXALIASWARN (localtime); # endif # elif defined GNULIB_POSIXCHECK -# undef localtime # if HAVE_RAW_DECL_LOCALTIME _GL_WARN_ON_USE (localtime, "localtime has portability problems - " "use gnulib module localtime for portability"); @@ -430,7 +421,6 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, struct tm *restrict __tm)); _GL_CXXALIASWARN (strptime); # elif defined GNULIB_POSIXCHECK -# undef strptime # if HAVE_RAW_DECL_STRPTIME _GL_WARN_ON_USE (strptime, "strptime is unportable - " "use gnulib module strptime for portability"); @@ -483,7 +473,6 @@ _GL_CXXALIAS_SYS (strftime, size_t, _GL_CXXALIASWARN (strftime); # endif # elif defined GNULIB_POSIXCHECK -# undef strftime # if HAVE_RAW_DECL_STRFTIME _GL_WARN_ON_USE (strftime, "strftime has portability problems - " "use gnulib module strftime-fixes for portability"); @@ -523,11 +512,18 @@ _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); # endif /* tzfree (tz) - Frees a time zone object. + Free a time zone object, preserving errno. The argument must have been returned by tzalloc(). */ # if !@HAVE_TZALLOC@ _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), ); _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); +# else +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzfree +# define tzfree rpl_tzfree +# endif +_GL_FUNCDECL_RPL (tzfree, void, (timezone_t __tz), ); +_GL_CXXALIAS_RPL (tzfree, void, (timezone_t __tz)); # endif /* localtime_rz (tz, &t, &result) @@ -611,7 +607,6 @@ _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); _GL_CXXALIASWARN (timegm); # endif # elif defined GNULIB_POSIXCHECK -# undef timegm # if HAVE_RAW_DECL_TIMEGM _GL_WARN_ON_USE (timegm, "timegm is unportable - " "use gnulib module timegm for portability"); @@ -622,28 +617,24 @@ _GL_WARN_ON_USE (timegm, "timegm is unportable - " buffers when given outlandish struct tm values. Portable applications should use strftime (or even sprintf) instead. */ # if defined GNULIB_POSIXCHECK -# undef asctime # if HAVE_RAW_DECL_ASCTIME _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # endif # if defined GNULIB_POSIXCHECK -# undef asctime_r # if HAVE_RAW_DECL_ASCTIME_R _GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # endif # if defined GNULIB_POSIXCHECK -# undef ctime # if HAVE_RAW_DECL_CTIME _GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # endif # if defined GNULIB_POSIXCHECK -# undef ctime_r # if HAVE_RAW_DECL_CTIME_R _GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); diff --git a/gl/time_r.c b/gl/time_r.c index 15d65d59..dfc427f6 100644 --- a/gl/time_r.c +++ b/gl/time_r.c @@ -1,6 +1,6 @@ /* Reentrant time functions like localtime_r. - Copyright (C) 2003, 2006-2007, 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/timegm.c b/gl/timegm.c index 4c2615b9..0862b6e9 100644 --- a/gl/timegm.c +++ b/gl/timegm.c @@ -1,6 +1,6 @@ /* Convert UTC calendar time to simple time. Like mktime but assumes UTC. - Copyright (C) 1994-2025 Free Software Foundation, Inc. + Copyright (C) 1994-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gl/uchar.h b/gl/uchar.h deleted file mode 100644 index abc636c5..00000000 --- a/gl/uchar.h +++ /dev/null @@ -1,1456 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* substitute - 16-bit and 32-bit wide character types. - Copyright (C) 2019-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* Written by Bruno Haible , 2019. */ - -/* - * ISO C 23 for platforms that lack it. - */ - -#ifndef _GL_UCHAR_H - -#if __GNUC__ >= 3 -#pragma GCC system_header -#endif - - -/* The include_next requires a split double-inclusion guard. */ -#if (defined __cplusplus ? 0 : 1) -# if defined __HAIKU__ -/* Work around . */ -# include -# endif -/* On AIX 7.2 with xlclang++, /usr/include/uchar.h produces compilation errors - because it contains typedef definitions of char16_t and char32_t, however - char16_t and char32_t are keywords in this situation. To work around it, - define char16_t and char32_t as macros. */ -# if defined __cplusplus && defined _AIX && defined __ibmxl__ && defined __clang__ -# define char16_t gl_char16_t -# define char32_t gl_char32_t -# endif -# include_next -#endif - -#ifndef _GL_UCHAR_H -#define _GL_UCHAR_H - -/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, _GL_BEGIN_C_LINKAGE, - _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ -#if !_GL_CONFIG_H_INCLUDED - #error "Please include config.h first." -#endif - -/* Get uint_least16_t, uint_least32_t. */ -#include - -/* Get mbstate_t, size_t. */ -#include - -/* For the inline functions. */ -#include -#include - -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The attribute __pure__ was added in gcc 2.96. */ -#ifndef _GL_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define _GL_ATTRIBUTE_PURE /* empty */ -# endif -#endif - -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -/* C++ compatible function declaration macros. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _GL_CXXDEFS_H -#define _GL_CXXDEFS_H - -/* Begin/end the GNULIB_NAMESPACE namespace. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { -# define _GL_END_NAMESPACE } -#else -# define _GL_BEGIN_NAMESPACE -# define _GL_END_NAMESPACE -#endif - -/* The three most frequent use cases of these macros are: - - * For providing a substitute for a function that is missing on some - platforms, but is declared and works fine on the platforms on which - it exists: - - #if @GNULIB_FOO@ - # if !@HAVE_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on all platforms, - but is broken/insufficient and needs to be replaced on some platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on some platforms - but is broken/insufficient and needs to be replaced on some of them and - is additionally either missing or undeclared on some other platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif -*/ - -/* _GL_EXTERN_C declaration; - performs the declaration with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C extern "C" -#else -# define _GL_EXTERN_C extern -#endif - -/* _GL_EXTERN_C_FUNC declaration; - performs the declaration of a function with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C_FUNC extern "C" -#else -/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax - are not allowed between 'extern' and the return type (see gnulib-common.m4). - */ -# define _GL_EXTERN_C_FUNC -#endif - -/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]); - declares a replacement function, named rpl_func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...), - _GL_ARG_NONNULL ((1))); - - Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front - of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's - because - [[...]] extern "C" ; - is invalid syntax in C++.) - */ -#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \ - _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__) -#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters - -/* _GL_FUNCDECL_SYS_NAME (func) expands to plain func if C++, and to - parenthesized func otherwise. Parenthesization is needed in C23 if - the function is like strchr and so is a qualifier-generic macro - that expands to something more complicated. */ -#ifdef __cplusplus -# define _GL_FUNCDECL_SYS_NAME(func) func -#else -# define _GL_FUNCDECL_SYS_NAME(func) (func) -#endif - -/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); - declares the system function, named func, with the given prototype, - consisting of return type, parameters, and attributes. - Although attributes are optional, the comma before them is required - for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, - if needed, must be placed after the _GL_FUNCDECL_RPL invocation, - at the end of the declaration. - Examples: - _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW; - _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); - */ -#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ - _GL_EXTERN_C_FUNC __VA_ARGS__ rettype _GL_FUNCDECL_SYS_NAME (func) parameters - -/* _GL_CXXALIAS_RPL (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to rpl_func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - - Wrapping rpl_func in an object with an inline conversion operator - avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::rpl_func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA (func, rettype, parameters); - is to be used when func is a Microsoft deprecated alias, on native Windows. - It declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to _func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); - */ -#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); - is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); - except that the C function rpl_func may have a slightly different - declaration. A cast is used to silence the "invalid conversion" error - that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::rpl_func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_MDA (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) - -/* _GL_CXXALIAS_SYS (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to the system provided function func, if GNULIB_NAMESPACE - is defined. - Example: - _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - - Wrapping func in an object with an inline conversion operator - avoids a reference to func unless GNULIB_NAMESPACE::func is - actually used in the program. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return ::func; \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast(::func); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function is picked among a set of overloaded functions, - namely the one with rettype2 and parameters2. Two consecutive casts - are used to silence the "cannot find a match" and "invalid conversion" - errors that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE - /* The outer cast must be a reinterpret_cast. - The inner cast: When the function is defined as a set of overloaded - functions, it works as a static_cast<>, choosing the designated variant. - When the function is defined as a single variant, it works as a - reinterpret_cast<>. The parenthesized cast syntax works both ways. */ -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - namespace GNULIB_NAMESPACE \ - { \ - static const struct _gl_ ## func ## _wrapper \ - { \ - typedef rettype (*type) parameters; \ - \ - inline operator type () const \ - { \ - return reinterpret_cast((rettype2 (*) parameters2)(::func)); \ - } \ - } func = {}; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN (func); - causes a warning to be emitted when ::func is used but not when - GNULIB_NAMESPACE::func is used. func must be defined without overloaded - variants. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN(func) \ - _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN_1(func,namespace) \ - _GL_CXXALIASWARN_2 (func, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_WARN_ON_USE (func, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN_2(func,namespace) \ - extern __typeof__ (func) func -# else -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN(func) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); - causes a warning to be emitted when the given overloaded variant of ::func - is used but not when GNULIB_NAMESPACE::func is used. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ - GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ - _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# else -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -#endif /* _GL_CXXDEFS_H */ - -/* The definition of _GL_ARG_NONNULL is copied here. */ -/* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools - that the values passed as arguments n, ..., m must be non-NULL pointers. - n = 1 stands for the first argument, n = 2 for the second argument etc. */ -#ifndef _GL_ARG_NONNULL -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ -# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) -# else -# define _GL_ARG_NONNULL(params) -# endif -#endif - -/* The definition of _GL_WARN_ON_USE is copied here. */ -/* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2025 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* _GL_WARN_ON_USE (function, "literal string") issues a declaration - for FUNCTION which will then trigger a compiler warning containing - the text of "literal string" anywhere that function is called, if - supported by the compiler. If the compiler does not support this - feature, the macro expands to an unused extern declaration. - - _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the - attribute used in _GL_WARN_ON_USE. If the compiler does not support - this feature, it expands to empty. - - These macros are useful for marking a function as a potential - portability trap, with the intent that "literal string" include - instructions on the replacement function that should be used - instead. - _GL_WARN_ON_USE is for functions with 'extern' linkage. - _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' - linkage. - - _GL_WARN_ON_USE should not be used more than once for a given function - in a given compilation unit (because this may generate a warning even - if the function is never called). - - However, one of the reasons that a function is a portability trap is - if it has the wrong signature. Declaring FUNCTION with a different - signature in C is a compilation error, so this macro must use the - same type as any existing declaration so that programs that avoid - the problematic FUNCTION do not fail to compile merely because they - included a header that poisoned the function. But this implies that - _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already - have a declaration. Use of this macro implies that there must not - be any other macro hiding the declaration of FUNCTION; but - undefining FUNCTION first is part of the poisoning process anyway - (although for symbols that are provided only via a macro, the result - is a compilation error rather than a warning containing - "literal string"). Also note that in C++, it is only safe to use if - FUNCTION has no overloads. - - For an example, it is possible to poison 'getline' by: - - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], - [getline]) in configure.ac, which potentially defines - HAVE_RAW_DECL_GETLINE - - adding this code to a header that wraps the system : - #undef getline - #if HAVE_RAW_DECL_GETLINE - _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" - "not universally present; use the gnulib module getline"); - #endif - - It is not possible to directly poison global variables. But it is - possible to write a wrapper accessor function, and poison that - (less common usage, like &environ, will cause a compilation error - rather than issue the nice warning, but the end result of informing - the developer about their portability problem is still achieved): - #if HAVE_RAW_DECL_ENVIRON - static char *** - rpl_environ (void) { return &environ; } - _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); - # undef environ - # define environ (*rpl_environ ()) - #endif - or better (avoiding contradictory use of 'static' and 'extern'): - #if HAVE_RAW_DECL_ENVIRON - static char *** - _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") - rpl_environ (void) { return &environ; } - # undef environ - # define environ (*rpl_environ ()) - #endif - */ -#ifndef _GL_WARN_ON_USE - -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__warning__ (message))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ - __attribute__ ((__diagnose_if__ (1, message, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C __typeof__ (function) function -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# else /* Unsupported. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# define _GL_WARN_ON_USE_ATTRIBUTE(message) -# endif -#endif - -/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") - is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the - function is declared with the given prototype, consisting of return type, - parameters, and attributes. - This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does - not work in this case. */ -#ifndef _GL_WARN_ON_USE_CXX -# if !defined __cplusplus -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ - _GL_WARN_ON_USE (function, msg) -# else -# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __clang_major__ >= 4 -/* Another compiler attribute is available in clang. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_clang function parameters_and_attributes \ - __attribute__ ((__diagnose_if__ (1, msg, "warning"))) -# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -extern rettype_gcc function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# endif -# endif -#endif - -/* _GL_WARN_EXTERN_C declaration; - performs the declaration with C linkage. */ -#ifndef _GL_WARN_EXTERN_C -# if defined __cplusplus -# define _GL_WARN_EXTERN_C extern "C" -# else -# define _GL_WARN_EXTERN_C extern -# endif -#endif - - -_GL_INLINE_HEADER_BEGIN - - -#if !(defined __cplusplus ? 0 || 0 : 1) - -/* An 8-bit variant of wchar_t. - Note: This type is only mandated by ISO C 23 or newer, and it does - denote UTF-8 units. */ -typedef unsigned char char8_t; - -#elif 0 - -typedef unsigned char gl_char8_t; -# define char8_t gl_char8_t - -#endif - -#if !(defined __cplusplus ? 0 || 0 : 1) - -/* A 16-bit variant of wchar_t. - Note: This type is only mandated by ISO C 11 or newer. In ISO C 23 - and newer, it denotes UTF-16 units; in older versions of ISO C it did - so only on platforms on which __STDC_UTF_16__ was defined. */ -typedef uint_least16_t char16_t; - -#elif 0 - -typedef uint_least16_t gl_char16_t; -# define char16_t gl_char16_t - -#endif - -#if !(defined __cplusplus ? 0 || 0 : 1) - -/* A 32-bit variant of wchar_t. - Note: This type is only mandated by ISO C 11 or newer. In ISO C 23 - and newer, it denotes UTF-32 code points; in older versions of ISO C - it did so only on platforms on which __STDC_UTF_32__ was defined. - In gnulib, we guarantee that it denotes UTF-32 code points if and - only if the module 'uchar-h-c23' is in use. */ -typedef uint_least32_t char32_t; - -#elif 0 - -typedef uint_least32_t gl_char32_t; -# define char32_t gl_char32_t - -#endif - -/* Define if a 'char32_t' can hold more characters than a 'wchar_t'. */ -#if 0 /* 32-bit AIX, Cygwin, native Windows */ -# define _GL_SMALL_WCHAR_T 1 -#endif - -/* Define if 'wchar_t', like 'char32_t', - - is a 32-bit type, and - - represents Unicode code points. - For this test, we can use __STDC_ISO_10646__ (defined by glibc, musl libc, - Cygwin) but need to consider _GL_SMALL_WCHAR_T, so as to exclude Cygwin. - We cannot use __STDC_UTF_16__ or __STDC_UTF_32__ - - because these macros provide info about char16_t and char32_t (not - wchar_t!), and - - because GCC >= 4.9 defines these macros on all platforms, even on - FreeBSD and Solaris. - We should better not use __STD_UTF_16__, __STD_UTF_32__ either, because - these macros are misspellings, only defined by Android's . */ -#if defined __STDC_ISO_10646__ && !_GL_SMALL_WCHAR_T -/* glibc, musl libc */ -# define _GL_WCHAR_T_IS_UCS4 1 -#endif -#if _GL_WCHAR_T_IS_UCS4 -static_assert (sizeof (char32_t) == sizeof (wchar_t)); -#endif - - -/* Convert a single-byte character to a 32-bit wide character. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_BTOC32 -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ATTRIBUTE_PURE wint_t -btoc32 (int c) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - btowc (c); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (btoc32, wint_t, (int c), _GL_ATTRIBUTE_PURE); -# endif -_GL_CXXALIAS_SYS (btoc32, wint_t, (int c)); -_GL_CXXALIASWARN (btoc32); -#endif - - -/* Test a specific property of a 32-bit wide character. */ -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISALNUM -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isalnum (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswalnum (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isalnum, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isalnum, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isalnum); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISALPHA -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isalpha (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswalpha (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isalpha, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isalpha, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isalpha); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISBLANK -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isblank (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswblank (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isblank, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isblank, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isblank); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISCNTRL -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32iscntrl (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswcntrl (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32iscntrl, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32iscntrl, int, (wint_t wc)); -_GL_CXXALIASWARN (c32iscntrl); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISDIGIT -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isdigit (wint_t wc) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswdigit (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isdigit, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isdigit, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isdigit); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISGRAPH -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isgraph (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswgraph (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isgraph, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isgraph, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isgraph); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISLOWER -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32islower (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswlower (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32islower, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32islower, int, (wint_t wc)); -_GL_CXXALIASWARN (c32islower); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISPRINT -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isprint (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswprint (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isprint, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isprint, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isprint); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISPUNCT -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32ispunct (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswpunct (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32ispunct, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32ispunct, int, (wint_t wc)); -_GL_CXXALIASWARN (c32ispunct); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISSPACE -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isspace (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswspace (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isspace, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isspace, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isspace); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISUPPER -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isupper (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswupper (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isupper, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isupper, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isupper); -#endif -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISXDIGIT -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32isxdigit (wint_t wc) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswxdigit (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32isxdigit, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32isxdigit, int, (wint_t wc)); -_GL_CXXALIASWARN (c32isxdigit); -#endif - - -/* Case mapping of a 32-bit wide character. */ -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32TOLOWER -_GL_BEGIN_C_LINKAGE -_GL_INLINE wint_t -c32tolower (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - towlower (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32tolower, wint_t, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32tolower, wint_t, (wint_t wc)); -_GL_CXXALIASWARN (c32tolower); -#endif -#if 0 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32TOUPPER -_GL_BEGIN_C_LINKAGE -_GL_INLINE wint_t -c32toupper (wint_t wc) -{ - return -# if defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - towupper (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32toupper, wint_t, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32toupper, wint_t, (wint_t wc)); -_GL_CXXALIASWARN (c32toupper); -#endif - - -/* Number of screen columns needed for a 32-bit wide character. */ -#if 1 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32WIDTH -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32width (char32_t wc) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wcwidth (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32width, int, (char32_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32width, int, (char32_t wc)); -_GL_CXXALIASWARN (c32width); -#endif - - -/* Converts a 32-bit wide character to a multibyte character. */ -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef c32rtomb -# define c32rtomb rpl_c32rtomb -# endif -_GL_FUNCDECL_RPL (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps), ); -_GL_CXXALIAS_RPL (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps)); -# else -# if !1 -_GL_FUNCDECL_SYS (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps), ); -# endif -_GL_CXXALIAS_SYS (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps)); -# endif -# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 -_GL_CXXALIASWARN (c32rtomb); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_C32RTOMB -_GL_WARN_ON_USE (c32rtomb, "c32rtomb is not portable - " - "use gnulib module c32rtomb for portability"); -# endif -#endif - - -/* Convert a 32-bit wide string to a string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32SNRTOMBS -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -c32snrtombs (char *dest, const char32_t **srcp, size_t srclen, size_t len, - mbstate_t *ps) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wcsnrtombs (dest, (const wchar_t **) srcp, srclen, len, ps); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32snrtombs, size_t, - (char *dest, const char32_t **srcp, size_t srclen, size_t len, - mbstate_t *ps), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (c32snrtombs, size_t, - (char *dest, const char32_t **srcp, size_t srclen, size_t len, - mbstate_t *ps)); -_GL_CXXALIASWARN (c32snrtombs); -#endif - - -/* Convert a 32-bit wide string to a string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32SRTOMBS -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -c32srtombs (char *dest, const char32_t **srcp, size_t len, mbstate_t *ps) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wcsrtombs (dest, (const wchar_t **) srcp, len, ps); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32srtombs, size_t, - (char *dest, const char32_t **srcp, size_t len, - mbstate_t *ps), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (c32srtombs, size_t, - (char *dest, const char32_t **srcp, size_t len, - mbstate_t *ps)); -_GL_CXXALIASWARN (c32srtombs); -#endif - - -/* Convert a 32-bit wide string to a string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32STOMBS -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -c32stombs (char *dest, const char32_t *src, size_t len) -{ - mbstate_t state; - - mbszero (&state); - return c32srtombs (dest, &src, len, &state); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32stombs, size_t, - (char *dest, const char32_t *src, size_t len), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (c32stombs, size_t, - (char *dest, const char32_t *src, size_t len)); -_GL_CXXALIASWARN (c32stombs); -#endif - - -/* Number of screen columns needed for a size-bounded 32-bit wide string. */ -#if 0 -# if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32SWIDTH -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((1)) int -c32swidth (const char32_t *s, size_t n) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wcswidth ((const wchar_t *) s, n); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32swidth, int, (const char32_t *s, size_t n), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (c32swidth, int, (const char32_t *s, size_t n)); -_GL_CXXALIASWARN (c32swidth); -#endif - - -/* Converts a 32-bit wide character to unibyte character. - Returns the single-byte representation of WC if it exists, - or EOF otherwise. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32TOB -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32tob (wint_t wc) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wctob (wc); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32tob, int, (wint_t wc), ); -# endif -_GL_CXXALIAS_SYS (c32tob, int, (wint_t wc)); -_GL_CXXALIASWARN (c32tob); -#endif - - -/* Converts a multibyte character to a 32-bit wide character. */ -#if 1 -# if 1 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef mbrtoc32 -# define mbrtoc32 rpl_mbrtoc32 -# endif -_GL_FUNCDECL_RPL (mbrtoc32, size_t, - (char32_t *pc, const char *s, size_t n, mbstate_t *ps), ); -_GL_CXXALIAS_RPL (mbrtoc32, size_t, - (char32_t *pc, const char *s, size_t n, mbstate_t *ps)); -# else -# if !1 -_GL_FUNCDECL_SYS (mbrtoc32, size_t, - (char32_t *pc, const char *s, size_t n, mbstate_t *ps), ); -# endif -_GL_CXXALIAS_SYS (mbrtoc32, size_t, - (char32_t *pc, const char *s, size_t n, mbstate_t *ps)); -# endif -# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 -_GL_CXXALIASWARN (mbrtoc32); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_MBRTOC32 -_GL_WARN_ON_USE (mbrtoc32, "mbrtoc32 is not portable - " - "use gnulib module mbrtoc32 for portability"); -# endif -#endif - - -/* Converts a multibyte character and returns the next 16-bit wide - character. */ -#if 0 -# if 0 -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef mbrtoc16 -# define mbrtoc16 rpl_mbrtoc16 -# endif -_GL_FUNCDECL_RPL (mbrtoc16, size_t, - (char16_t *pc, const char *s, size_t n, mbstate_t *ps), ); -_GL_CXXALIAS_RPL (mbrtoc16, size_t, - (char16_t *pc, const char *s, size_t n, mbstate_t *ps)); -# else -# if !1 -_GL_FUNCDECL_SYS (mbrtoc16, size_t, - (char16_t *pc, const char *s, size_t n, mbstate_t *ps), ); -# endif -_GL_CXXALIAS_SYS (mbrtoc16, size_t, - (char16_t *pc, const char *s, size_t n, mbstate_t *ps)); -# endif -# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 -_GL_CXXALIASWARN (mbrtoc16); -# endif -#elif defined GNULIB_POSIXCHECK -# if HAVE_RAW_DECL_MBRTOC16 -_GL_WARN_ON_USE (mbrtoc16, "mbrtoc16 is not portable - " - "use gnulib module mbrtoc16 for portability"); -# endif -#endif - - -/* Convert a string to a 32-bit wide string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSNRTOC32S -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -mbsnrtoc32s (char32_t *dest, const char **srcp, size_t srclen, size_t len, - mbstate_t *ps) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - mbsnrtowcs ((wchar_t *) dest, srcp, srclen, len, ps); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (mbsnrtoc32s, size_t, - (char32_t *dest, const char **srcp, size_t srclen, size_t len, - mbstate_t *ps), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (mbsnrtoc32s, size_t, - (char32_t *dest, const char **srcp, size_t srclen, size_t len, - mbstate_t *ps)); -_GL_CXXALIASWARN (mbsnrtoc32s); -#endif - - -/* Convert a string to a 32-bit wide string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSRTOC32S -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -mbsrtoc32s (char32_t *dest, const char **srcp, size_t len, mbstate_t *ps) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - mbsrtowcs ((wchar_t *) dest, srcp, len, ps); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (mbsrtoc32s, size_t, - (char32_t *dest, const char **srcp, size_t len, - mbstate_t *ps), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (mbsrtoc32s, size_t, - (char32_t *dest, const char **srcp, size_t len, - mbstate_t *ps)); -_GL_CXXALIASWARN (mbsrtoc32s); -#endif - - -/* Convert a string to a 32-bit wide string. */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSTOC32S -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) size_t -mbstoc32s (char32_t *dest, const char *src, size_t len) -{ - mbstate_t state; - - mbszero (&state); - return mbsrtoc32s (dest, &src, len, &state); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (mbstoc32s, size_t, - (char32_t *dest, const char *src, size_t len), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (mbstoc32s, size_t, - (char32_t *dest, const char *src, size_t len)); -_GL_CXXALIASWARN (mbstoc32s); -#endif - - -#if 0 || 0 -/* A scalar type. Instances of this type, other than (c32_type_test_t) 0, - represent a character property, sometimes also viewed as a "character class". - It can be applied to 32-bit wide characters. It is the counterpart of - type 'wctype_t' for wide characters. - To test whether a given character has a certain property, use the function - 'c32_apply_type_test'. */ -# if _GL_WCHAR_T_IS_UCS4 -typedef wctype_t c32_type_test_t; -# else -typedef /*bool*/int (*c32_type_test_t) (wint_t wc); -# endif -#endif - -/* Return a character property with the given name, or (c32_type_test_t) 0 - if the designated property does not exist. - This function is the counterpart of function 'wctype' for wide characters. - */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_GET_TYPE_TEST -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((1)) c32_type_test_t -c32_get_type_test (const char *name) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wctype (name); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32_get_type_test, c32_type_test_t, (const char *name), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (c32_get_type_test, c32_type_test_t, (const char *name)); -_GL_CXXALIASWARN (c32_get_type_test); -#endif - -/* Test whether a given 32-bit wide character has the specified character - property. - Return non-zero if true, zero if false or if the argument is WEOF. - This function is the counterpart of function 'iswctype' for wide characters. - */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 -# if !defined IN_C32_APPLY_TYPE_TEST -_GL_BEGIN_C_LINKAGE -_GL_INLINE int -c32_apply_type_test (wint_t wc, c32_type_test_t property) -{ - return -# if 1 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - iswctype (wc, property); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32_apply_type_test, int, - (wint_t wc, c32_type_test_t property), ); -# endif -# else -_GL_FUNCDECL_SYS (c32_apply_type_test, int, - (wint_t wc, c32_type_test_t property), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (c32_apply_type_test, int, - (wint_t wc, c32_type_test_t property)); -_GL_CXXALIASWARN (c32_apply_type_test); -#endif - - -#if 0 || 0 -/* A scalar type. Instances of this type, other than (c32_mapping_t) 0, - represent a character mapping. It can be applied to 32-bit wide characters. - It is the counterpart of type 'wctrans_t' for wide characters. - To apply a certain mapping to a given character, use the function - 'c32_apply_mapping'. */ -# if _GL_WCHAR_T_IS_UCS4 -typedef wctrans_t c32_mapping_t; -# else -typedef wint_t (*c32_mapping_t) (wint_t wc); -# endif -#endif - -/* Return a character mapping with the given name, or (c32_mapping_t) 0 - if the designated mapping does not exist. - This function is the counterpart of function 'wctrans' for wide characters. - */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_GET_MAPPING -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((1)) c32_mapping_t -c32_get_mapping (const char *name) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - wctrans (name); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32_get_mapping, c32_mapping_t, (const char *name), - _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (c32_get_mapping, c32_mapping_t, (const char *name)); -_GL_CXXALIASWARN (c32_get_mapping); -#endif - -/* Apply the specified character mapping to a given 32-bit wide character. - Return the result of this mapping. Return the WC argument unchanged if it is - WEOF. - This function is the counterpart of function 'towctrans' for wide characters. - */ -#if 0 -# if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_APPLY_MAPPING -_GL_BEGIN_C_LINKAGE -_GL_INLINE _GL_ARG_NONNULL ((2)) wint_t -c32_apply_mapping (wint_t wc, c32_mapping_t mapping) -{ - return -# if 0 && defined __cplusplus && defined GNULIB_NAMESPACE - GNULIB_NAMESPACE:: -# endif - towctrans (wc, mapping); -} -_GL_END_C_LINKAGE -# else -_GL_FUNCDECL_SYS (c32_apply_mapping, wint_t, - (wint_t wc, c32_mapping_t mapping), - _GL_ARG_NONNULL ((2))); -# endif -_GL_CXXALIAS_SYS (c32_apply_mapping, wint_t, - (wint_t wc, c32_mapping_t mapping)); -_GL_CXXALIASWARN (c32_apply_mapping); -#endif - - -_GL_INLINE_HEADER_END - -#endif /* _GL_UCHAR_H */ -#endif /* _GL_UCHAR_H */ diff --git a/gl/uchar.in.h b/gl/uchar.in.h index 9a65ac37..300f7b5f 100644 --- a/gl/uchar.in.h +++ b/gl/uchar.in.h @@ -1,5 +1,5 @@ /* substitute - 16-bit and 32-bit wide character types. - Copyright (C) 2019-2025 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -490,7 +490,6 @@ _GL_CXXALIAS_SYS (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps)); _GL_CXXALIASWARN (c32rtomb); # endif #elif defined GNULIB_POSIXCHECK -# undef c32rtomb # if HAVE_RAW_DECL_C32RTOMB _GL_WARN_ON_USE (c32rtomb, "c32rtomb is not portable - " "use gnulib module c32rtomb for portability"); @@ -647,7 +646,6 @@ _GL_CXXALIAS_SYS (mbrtoc32, size_t, _GL_CXXALIASWARN (mbrtoc32); # endif #elif defined GNULIB_POSIXCHECK -# undef mbrtoc32 # if HAVE_RAW_DECL_MBRTOC32 _GL_WARN_ON_USE (mbrtoc32, "mbrtoc32 is not portable - " "use gnulib module mbrtoc32 for portability"); @@ -679,7 +677,6 @@ _GL_CXXALIAS_SYS (mbrtoc16, size_t, _GL_CXXALIASWARN (mbrtoc16); # endif #elif defined GNULIB_POSIXCHECK -# undef mbrtoc16 # if HAVE_RAW_DECL_MBRTOC16 _GL_WARN_ON_USE (mbrtoc16, "mbrtoc16 is not portable - " "use gnulib module mbrtoc16 for portability"); diff --git a/gl/unicase.h b/gl/unicase.h deleted file mode 100644 index 507a83d0..00000000 --- a/gl/unicase.h +++ /dev/null @@ -1,472 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Unicode character case mappings. - Copyright (C) 2002, 2009-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _UNICASE_H -#define _UNICASE_H - -#include "unitypes.h" - -/* Get bool. */ -#include - -/* Get size_t. */ -#include - -/* Get uninorm_t. */ -#include "uninorm.h" - -#if 0 -# include -#else -# define LIBUNISTRING_DLL_VARIABLE -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* ========================================================================= */ - -/* Character case mappings. - These mappings are locale and context independent. - WARNING! These functions are not sufficient for languages such as German. - Better use the functions below that treat an entire string at once and are - language aware. */ - -/* Return the uppercase mapping of a Unicode character. */ -extern ucs4_t - uc_toupper (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Return the lowercase mapping of a Unicode character. */ -extern ucs4_t - uc_tolower (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Return the titlecase mapping of a Unicode character. */ -extern ucs4_t - uc_totitle (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* String case mappings. */ - -/* These functions are locale dependent. The iso639_language argument - identifies the language (e.g. "tr" for Turkish). NULL means to use - locale independent case mappings. */ - -/* Return the ISO 639 language code of the current locale. - Return "" if it is unknown, or in the "C" locale. */ -extern const char * - uc_locale_language (void) - _UC_ATTRIBUTE_PURE; - -/* Conventions: - - All functions prefixed with u8_ operate on UTF-8 encoded strings. - Their unit is an uint8_t (1 byte). - - All functions prefixed with u16_ operate on UTF-16 encoded strings. - Their unit is an uint16_t (a 2-byte word). - - All functions prefixed with u32_ operate on UCS-4 encoded strings. - Their unit is an uint32_t (a 4-byte word). - - All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly - n units. - - Functions returning a string result take a (resultbuf, lengthp) argument - pair. If resultbuf is not NULL and the result fits into *lengthp units, - it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly - allocated string is returned. In both cases, *lengthp is set to the - length (number of units) of the returned string. In case of error, - NULL is returned and errno is set. */ - -/* Return the uppercase mapping of a string. - The nf argument identifies the normalization form to apply after the - case-mapping. It can also be NULL, for no normalization. */ -extern uint8_t * - u8_toupper (const uint8_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_toupper (const uint16_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_toupper (const uint32_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Return the lowercase mapping of a string. - The nf argument identifies the normalization form to apply after the - case-mapping. It can also be NULL, for no normalization. */ -extern uint8_t * - u8_tolower (const uint8_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_tolower (const uint16_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_tolower (const uint32_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Return the titlecase mapping of a string. - The nf argument identifies the normalization form to apply after the - case-mapping. It can also be NULL, for no normalization. */ -extern uint8_t * - u8_totitle (const uint8_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_totitle (const uint16_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_totitle (const uint32_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* The case-mapping context given by a prefix string. */ -typedef struct casing_prefix_context - { - /* These fields are private, undocumented. */ - uint32_t last_char_except_ignorable; - uint32_t last_char_normal_or_above; - } - casing_prefix_context_t; -/* The case-mapping context of the empty prefix string. */ -extern LIBUNISTRING_DLL_VARIABLE const casing_prefix_context_t unicase_empty_prefix_context; -/* Return the case-mapping context of a given prefix string. */ -extern casing_prefix_context_t - u8_casing_prefix_context (const uint8_t *s, size_t n); -extern casing_prefix_context_t - u16_casing_prefix_context (const uint16_t *s, size_t n); -extern casing_prefix_context_t - u32_casing_prefix_context (const uint32_t *s, size_t n); -/* Return the case-mapping context of the prefix concat(A, S), given the - case-mapping context of the prefix A. */ -extern casing_prefix_context_t - u8_casing_prefixes_context (const uint8_t *s, size_t n, - casing_prefix_context_t a_context); -extern casing_prefix_context_t - u16_casing_prefixes_context (const uint16_t *s, size_t n, - casing_prefix_context_t a_context); -extern casing_prefix_context_t - u32_casing_prefixes_context (const uint32_t *s, size_t n, - casing_prefix_context_t a_context); - -/* The case-mapping context given by a suffix string. */ -typedef struct casing_suffix_context - { - /* These fields are private, undocumented. */ - uint32_t first_char_except_ignorable; - uint32_t bits; - } - casing_suffix_context_t; -/* The case-mapping context of the empty suffix string. */ -extern LIBUNISTRING_DLL_VARIABLE const casing_suffix_context_t unicase_empty_suffix_context; -/* Return the case-mapping context of a given suffix string. */ -extern casing_suffix_context_t - u8_casing_suffix_context (const uint8_t *s, size_t n); -extern casing_suffix_context_t - u16_casing_suffix_context (const uint16_t *s, size_t n); -extern casing_suffix_context_t - u32_casing_suffix_context (const uint32_t *s, size_t n); -/* Return the case-mapping context of the suffix concat(S, A), given the - case-mapping context of the suffix A. */ -extern casing_suffix_context_t - u8_casing_suffixes_context (const uint8_t *s, size_t n, - casing_suffix_context_t a_context); -extern casing_suffix_context_t - u16_casing_suffixes_context (const uint16_t *s, size_t n, - casing_suffix_context_t a_context); -extern casing_suffix_context_t - u32_casing_suffixes_context (const uint32_t *s, size_t n, - casing_suffix_context_t a_context); - -/* Return the uppercase mapping of a string that is surrounded by a prefix - and a suffix. */ -extern uint8_t * - u8_ct_toupper (const uint8_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_ct_toupper (const uint16_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_ct_toupper (const uint32_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Return the lowercase mapping of a string that is surrounded by a prefix - and a suffix. */ -extern uint8_t * - u8_ct_tolower (const uint8_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_ct_tolower (const uint16_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_ct_tolower (const uint32_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Return the titlecase mapping of a string that is surrounded by a prefix - and a suffix. */ -extern uint8_t * - u8_ct_totitle (const uint8_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_ct_totitle (const uint16_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_ct_totitle (const uint32_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Return the case folded string. - Comparing uN_casefold (S1) and uN_casefold (S2) with uN_cmp2() is equivalent - to comparing S1 and S2 with uN_casecmp(). - The nf argument identifies the normalization form to apply after the - case-mapping. It can also be NULL, for no normalization. */ -extern uint8_t * - u8_casefold (const uint8_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_casefold (const uint16_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_casefold (const uint32_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); -/* Likewise, for a string that is surrounded by a prefix and a suffix. */ -extern uint8_t * - u8_ct_casefold (const uint8_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_ct_casefold (const uint16_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_ct_casefold (const uint32_t *s, size_t n, - casing_prefix_context_t prefix_context, - casing_suffix_context_t suffix_context, - const char *iso639_language, - uninorm_t nf, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Compare S1 and S2, ignoring differences in case and normalization. - The nf argument identifies the normalization form to apply after the - case-mapping. It can also be NULL, for no normalization. - If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and - return 0. Upon failure, return -1 with errno set. */ -extern int - u8_casecmp (const uint8_t *s1, size_t n1, - const uint8_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - u16_casecmp (const uint16_t *s1, size_t n1, - const uint16_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - u32_casecmp (const uint32_t *s1, size_t n1, - const uint32_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - ulc_casecmp (const char *s1, size_t n1, - const char *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); - -/* Convert the string S of length N to a NUL-terminated byte sequence, in such - a way that comparing uN_casexfrm (S1) and uN_casexfrm (S2) with the gnulib - function memcmp2() is equivalent to comparing S1 and S2 with uN_casecoll(). - NF must be either UNINORM_NFC, UNINORM_NFKC, or NULL for no normalization. */ -extern char * - u8_casexfrm (const uint8_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - char *_UC_RESTRICT resultbuf, size_t *lengthp); -extern char * - u16_casexfrm (const uint16_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - char *_UC_RESTRICT resultbuf, size_t *lengthp); -extern char * - u32_casexfrm (const uint32_t *s, size_t n, const char *iso639_language, - uninorm_t nf, - char *_UC_RESTRICT resultbuf, size_t *lengthp); -extern char * - ulc_casexfrm (const char *s, size_t n, const char *iso639_language, - uninorm_t nf, - char *_UC_RESTRICT resultbuf, size_t *lengthp); - -/* Compare S1 and S2, ignoring differences in case and normalization, using the - collation rules of the current locale. - The nf argument identifies the normalization form to apply after the - case-mapping. It must be either UNINORM_NFC or UNINORM_NFKC. It can also - be NULL, for no normalization. - If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and - return 0. Upon failure, return -1 with errno set. */ -extern int - u8_casecoll (const uint8_t *s1, size_t n1, - const uint8_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - u16_casecoll (const uint16_t *s1, size_t n1, - const uint16_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - u32_casecoll (const uint32_t *s1, size_t n1, - const uint32_t *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); -extern int - ulc_casecoll (const char *s1, size_t n1, - const char *s2, size_t n2, - const char *iso639_language, uninorm_t nf, int *resultp); - - -/* Set *RESULTP to true if mapping NFD(S) to upper case is a no-op, or to false - otherwise, and return 0. Upon failure, return -1 with errno set. */ -extern int - u8_is_uppercase (const uint8_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u16_is_uppercase (const uint16_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u32_is_uppercase (const uint32_t *s, size_t n, - const char *iso639_language, - bool *resultp); - -/* Set *RESULTP to true if mapping NFD(S) to lower case is a no-op, or to false - otherwise, and return 0. Upon failure, return -1 with errno set. */ -extern int - u8_is_lowercase (const uint8_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u16_is_lowercase (const uint16_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u32_is_lowercase (const uint32_t *s, size_t n, - const char *iso639_language, - bool *resultp); - -/* Set *RESULTP to true if mapping NFD(S) to title case is a no-op, or to false - otherwise, and return 0. Upon failure, return -1 with errno set. */ -extern int - u8_is_titlecase (const uint8_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u16_is_titlecase (const uint16_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u32_is_titlecase (const uint32_t *s, size_t n, - const char *iso639_language, - bool *resultp); - -/* Set *RESULTP to true if applying case folding to NFD(S) is a no-op, or to - false otherwise, and return 0. Upon failure, return -1 with errno set. */ -extern int - u8_is_casefolded (const uint8_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u16_is_casefolded (const uint16_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u32_is_casefolded (const uint32_t *s, size_t n, - const char *iso639_language, - bool *resultp); - -/* Set *RESULTP to true if case matters for S, that is, if mapping NFD(S) to - either upper case or lower case or title case is not a no-op. - Set *RESULTP to false if NFD(S) maps to itself under the upper case mapping, - under the lower case mapping, and under the title case mapping; in other - words, when NFD(S) consists entirely of caseless characters. - Upon failure, return -1 with errno set. */ -extern int - u8_is_cased (const uint8_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u16_is_cased (const uint16_t *s, size_t n, - const char *iso639_language, - bool *resultp); -extern int - u32_is_cased (const uint32_t *s, size_t n, - const char *iso639_language, - bool *resultp); - - -/* ========================================================================= */ - -#ifdef __cplusplus -} -#endif - -#endif /* _UNICASE_H */ diff --git a/gl/unicase.in.h b/gl/unicase.in.h index c6df04b3..e1615aff 100644 --- a/gl/unicase.in.h +++ b/gl/unicase.in.h @@ -1,5 +1,5 @@ /* Unicode character case mappings. - Copyright (C) 2002, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unicase/simple-mapping.h b/gl/unicase/simple-mapping.h index 0c4c75b3..2b3d21d6 100644 --- a/gl/unicase/simple-mapping.h +++ b/gl/unicase/simple-mapping.h @@ -1,5 +1,5 @@ /* Simple case mapping for Unicode characters. - Copyright (C) 2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This file is free software: you can redistribute it and/or modify diff --git a/gl/unicase/tolower.c b/gl/unicase/tolower.c index a1c898ef..89676ad6 100644 --- a/gl/unicase/tolower.c +++ b/gl/unicase/tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This file is free software: you can redistribute it and/or modify diff --git a/gl/unicase/tolower.h b/gl/unicase/tolower.h index 794f4c0c..f06dacf5 100644 --- a/gl/unicase/tolower.h +++ b/gl/unicase/tolower.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Simple character mapping of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct { int level1[2]; short level2[2 << 9]; - int level3[36 << 7]; + int level3[37 << 7]; } u_mapping = { @@ -124,7 +124,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 4352, -1, -1, -1, + -1, -1, -1, -1, 4352, 4480, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -155,7 +155,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4480, -1, -1, -1, -1, -1, + -1, -1, 4608, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -572,8 +572,8 @@ u_mapping = -42258, -42282, -42261, 928, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -48, -42307, -35384, 1, - 0, 1, 0, -42343, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, + 0, 1, 0, -42343, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -42561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -723,6 +723,22 @@ u_mapping = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, diff --git a/gl/unictype.h b/gl/unictype.h deleted file mode 100644 index 78072c2a..00000000 --- a/gl/unictype.h +++ /dev/null @@ -1,1148 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Unicode character classification and properties. - Copyright (C) 2002, 2005-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _UNICTYPE_H -#define _UNICTYPE_H - -#include "unitypes.h" - -/* Get bool. */ -#include - -/* Get size_t. */ -#include - -#if 0 -# include -#else -# define LIBUNISTRING_DLL_VARIABLE -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* ========================================================================= */ - -/* Field 1 of Unicode Character Database: Character name. - See "uniname.h". */ - -/* ========================================================================= */ - -/* Field 2 of Unicode Character Database: General category. */ - -/* Data type denoting a General category value. This is not just a bitmask, - but rather a bitmask and a pointer to the lookup table, so that programs - that use only the predefined bitmasks (i.e. don't combine bitmasks with & - and |) don't have a link-time dependency towards the big general table. */ -typedef struct -{ - uint32_t bitmask : 31; - /*bool*/ unsigned int generic : 1; - union - { - const void *table; /* when generic is 0 */ - bool (*lookup_fn) (ucs4_t uc, uint32_t bitmask); /* when generic is 1 */ - } lookup; -} -uc_general_category_t; - -/* Bits and bit masks denoting General category values. UnicodeData-3.2.0.html - says a 32-bit integer will always suffice to represent them. - These bit masks can only be used with the uc_is_general_category_withtable - function. */ -enum -{ - UC_CATEGORY_MASK_L = 0x0000001f, - UC_CATEGORY_MASK_LC = 0x00000007, - UC_CATEGORY_MASK_Lu = 0x00000001, - UC_CATEGORY_MASK_Ll = 0x00000002, - UC_CATEGORY_MASK_Lt = 0x00000004, - UC_CATEGORY_MASK_Lm = 0x00000008, - UC_CATEGORY_MASK_Lo = 0x00000010, - UC_CATEGORY_MASK_M = 0x000000e0, - UC_CATEGORY_MASK_Mn = 0x00000020, - UC_CATEGORY_MASK_Mc = 0x00000040, - UC_CATEGORY_MASK_Me = 0x00000080, - UC_CATEGORY_MASK_N = 0x00000700, - UC_CATEGORY_MASK_Nd = 0x00000100, - UC_CATEGORY_MASK_Nl = 0x00000200, - UC_CATEGORY_MASK_No = 0x00000400, - UC_CATEGORY_MASK_P = 0x0003f800, - UC_CATEGORY_MASK_Pc = 0x00000800, - UC_CATEGORY_MASK_Pd = 0x00001000, - UC_CATEGORY_MASK_Ps = 0x00002000, - UC_CATEGORY_MASK_Pe = 0x00004000, - UC_CATEGORY_MASK_Pi = 0x00008000, - UC_CATEGORY_MASK_Pf = 0x00010000, - UC_CATEGORY_MASK_Po = 0x00020000, - UC_CATEGORY_MASK_S = 0x003c0000, - UC_CATEGORY_MASK_Sm = 0x00040000, - UC_CATEGORY_MASK_Sc = 0x00080000, - UC_CATEGORY_MASK_Sk = 0x00100000, - UC_CATEGORY_MASK_So = 0x00200000, - UC_CATEGORY_MASK_Z = 0x01c00000, - UC_CATEGORY_MASK_Zs = 0x00400000, - UC_CATEGORY_MASK_Zl = 0x00800000, - UC_CATEGORY_MASK_Zp = 0x01000000, - UC_CATEGORY_MASK_C = 0x3e000000, - UC_CATEGORY_MASK_Cc = 0x02000000, - UC_CATEGORY_MASK_Cf = 0x04000000, - UC_CATEGORY_MASK_Cs = 0x08000000, - UC_CATEGORY_MASK_Co = 0x10000000, - UC_CATEGORY_MASK_Cn = 0x20000000 -}; - -/* Predefined General category values. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_L; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_LC; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Lu; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Ll; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Lt; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Lm; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Lo; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_M; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Mn; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Mc; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Me; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_N; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Nd; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Nl; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_No; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_P; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Pc; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Pd; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Ps; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Pe; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Pi; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Pf; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Po; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_S; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Sm; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Sc; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Sk; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_So; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Z; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Zs; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Zl; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Zp; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_C; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Cc; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Cf; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Cs; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Co; -extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_CATEGORY_Cn; -/* Non-public. */ -extern const uc_general_category_t _UC_CATEGORY_NONE; - -/* Alias names for predefined General category values. */ -#define UC_LETTER UC_CATEGORY_L -#define UC_CASED_LETTER UC_CATEGORY_LC -#define UC_UPPERCASE_LETTER UC_CATEGORY_Lu -#define UC_LOWERCASE_LETTER UC_CATEGORY_Ll -#define UC_TITLECASE_LETTER UC_CATEGORY_Lt -#define UC_MODIFIER_LETTER UC_CATEGORY_Lm -#define UC_OTHER_LETTER UC_CATEGORY_Lo -#define UC_MARK UC_CATEGORY_M -#define UC_NON_SPACING_MARK UC_CATEGORY_Mn -#define UC_COMBINING_SPACING_MARK UC_CATEGORY_Mc -#define UC_ENCLOSING_MARK UC_CATEGORY_Me -#define UC_NUMBER UC_CATEGORY_N -#define UC_DECIMAL_DIGIT_NUMBER UC_CATEGORY_Nd -#define UC_LETTER_NUMBER UC_CATEGORY_Nl -#define UC_OTHER_NUMBER UC_CATEGORY_No -#define UC_PUNCTUATION UC_CATEGORY_P -#define UC_CONNECTOR_PUNCTUATION UC_CATEGORY_Pc -#define UC_DASH_PUNCTUATION UC_CATEGORY_Pd -#define UC_OPEN_PUNCTUATION UC_CATEGORY_Ps /* a.k.a. UC_START_PUNCTUATION */ -#define UC_CLOSE_PUNCTUATION UC_CATEGORY_Pe /* a.k.a. UC_END_PUNCTUATION */ -#define UC_INITIAL_QUOTE_PUNCTUATION UC_CATEGORY_Pi -#define UC_FINAL_QUOTE_PUNCTUATION UC_CATEGORY_Pf -#define UC_OTHER_PUNCTUATION UC_CATEGORY_Po -#define UC_SYMBOL UC_CATEGORY_S -#define UC_MATH_SYMBOL UC_CATEGORY_Sm -#define UC_CURRENCY_SYMBOL UC_CATEGORY_Sc -#define UC_MODIFIER_SYMBOL UC_CATEGORY_Sk -#define UC_OTHER_SYMBOL UC_CATEGORY_So -#define UC_SEPARATOR UC_CATEGORY_Z -#define UC_SPACE_SEPARATOR UC_CATEGORY_Zs -#define UC_LINE_SEPARATOR UC_CATEGORY_Zl -#define UC_PARAGRAPH_SEPARATOR UC_CATEGORY_Zp -#define UC_OTHER UC_CATEGORY_C -#define UC_CONTROL UC_CATEGORY_Cc -#define UC_FORMAT UC_CATEGORY_Cf -#define UC_SURROGATE UC_CATEGORY_Cs /* all of them are invalid characters */ -#define UC_PRIVATE_USE UC_CATEGORY_Co -#define UC_UNASSIGNED UC_CATEGORY_Cn /* some of them are invalid characters */ - -/* Return the union of two general categories. - This corresponds to the unions of the two sets of characters. */ -extern uc_general_category_t - uc_general_category_or (uc_general_category_t category1, - uc_general_category_t category2); - -/* Return the intersection of two general categories as bit masks. - This *does*not* correspond to the intersection of the two sets of - characters. */ -extern uc_general_category_t - uc_general_category_and (uc_general_category_t category1, - uc_general_category_t category2); - -/* Return the intersection of a general category with the complement of a - second general category, as bit masks. - This *does*not* correspond to the intersection with complement, when - viewing the categories as sets of characters. */ -extern uc_general_category_t - uc_general_category_and_not (uc_general_category_t category1, - uc_general_category_t category2); - -/* Return the name of a general category. */ -extern const char * - uc_general_category_name (uc_general_category_t category) - _UC_ATTRIBUTE_PURE; - -/* Return the long name of a general category. */ -extern const char * - uc_general_category_long_name (uc_general_category_t category) - _UC_ATTRIBUTE_PURE; - -/* Return the general category given by name, e.g. "Lu", or by long name, - e.g. "Uppercase Letter". */ -extern uc_general_category_t - uc_general_category_byname (const char *category_name) - _UC_ATTRIBUTE_PURE; - -/* Return the general category of a Unicode character. */ -extern uc_general_category_t - uc_general_category (ucs4_t uc) - _UC_ATTRIBUTE_PURE; - -/* Test whether a Unicode character belongs to a given category. - The CATEGORY argument can be the combination of several predefined - general categories. */ -extern bool - uc_is_general_category (ucs4_t uc, uc_general_category_t category) - _UC_ATTRIBUTE_PURE; -/* Likewise. This function uses a big table comprising all categories. */ -extern bool - uc_is_general_category_withtable (ucs4_t uc, uint32_t bitmask) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 3 of Unicode Character Database: Canonical combining class. */ - -/* The possible results of uc_combining_class (0..255) are described in - UCD.html. The list here is not definitive; more values can be added - in future versions. */ -enum -{ - UC_CCC_NR = 0, /* Not Reordered */ - UC_CCC_OV = 1, /* Overlay */ - UC_CCC_NK = 7, /* Nukta */ - UC_CCC_KV = 8, /* Kana Voicing */ - UC_CCC_VR = 9, /* Virama */ - UC_CCC_ATBL = 200, /* Attached Below Left */ - UC_CCC_ATB = 202, /* Attached Below */ - UC_CCC_ATA = 214, /* Attached Above */ - UC_CCC_ATAR = 216, /* Attached Above Right */ - UC_CCC_BL = 218, /* Below Left */ - UC_CCC_B = 220, /* Below */ - UC_CCC_BR = 222, /* Below Right */ - UC_CCC_L = 224, /* Left */ - UC_CCC_R = 226, /* Right */ - UC_CCC_AL = 228, /* Above Left */ - UC_CCC_A = 230, /* Above */ - UC_CCC_AR = 232, /* Above Right */ - UC_CCC_DB = 233, /* Double Below */ - UC_CCC_DA = 234, /* Double Above */ - UC_CCC_IS = 240 /* Iota Subscript */ -}; - -/* Return the canonical combining class of a Unicode character. */ -extern int - uc_combining_class (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Return the name of a canonical combining class. */ -extern const char * - uc_combining_class_name (int ccc) - _UC_ATTRIBUTE_CONST; - -/* Return the long name of a canonical combining class. */ -extern const char * - uc_combining_class_long_name (int ccc) - _UC_ATTRIBUTE_CONST; - -/* Return the canonical combining class given by name, e.g. "BL", or by long - name, e.g. "Below Left". */ -extern int - uc_combining_class_byname (const char *ccc_name) - _UC_ATTRIBUTE_PURE; - -/* ========================================================================= */ - -/* Field 4 of Unicode Character Database: Bidi class. - Before Unicode 4.0, this field was called "Bidirectional category". */ - -enum -{ - UC_BIDI_L, /* Left-to-Right */ - UC_BIDI_LRE, /* Left-to-Right Embedding */ - UC_BIDI_LRO, /* Left-to-Right Override */ - UC_BIDI_R, /* Right-to-Left */ - UC_BIDI_AL, /* Right-to-Left Arabic */ - UC_BIDI_RLE, /* Right-to-Left Embedding */ - UC_BIDI_RLO, /* Right-to-Left Override */ - UC_BIDI_PDF, /* Pop Directional Format */ - UC_BIDI_EN, /* European Number */ - UC_BIDI_ES, /* European Number Separator */ - UC_BIDI_ET, /* European Number Terminator */ - UC_BIDI_AN, /* Arabic Number */ - UC_BIDI_CS, /* Common Number Separator */ - UC_BIDI_NSM, /* Non-Spacing Mark */ - UC_BIDI_BN, /* Boundary Neutral */ - UC_BIDI_B, /* Paragraph Separator */ - UC_BIDI_S, /* Segment Separator */ - UC_BIDI_WS, /* Whitespace */ - UC_BIDI_ON, /* Other Neutral */ - UC_BIDI_LRI, /* Left-to-Right Isolate */ - UC_BIDI_RLI, /* Right-to-Left Isolate */ - UC_BIDI_FSI, /* First Strong Isolate */ - UC_BIDI_PDI /* Pop Directional Isolate */ -}; - -/* Return the name of a bidi class. */ -extern const char * - uc_bidi_class_name (int bidi_class) - _UC_ATTRIBUTE_CONST; -/* Same; obsolete function name. */ -extern const char * - uc_bidi_category_name (int category) - _UC_ATTRIBUTE_CONST; - -/* Return the long name of a bidi class. */ -extern const char * - uc_bidi_class_long_name (int bidi_class) - _UC_ATTRIBUTE_CONST; - -/* Return the bidi class given by name, e.g. "LRE", or by long name, e.g. - "Left-to-Right Embedding". */ -extern int - uc_bidi_class_byname (const char *bidi_class_name) - _UC_ATTRIBUTE_PURE; -/* Same; obsolete function name. */ -extern int - uc_bidi_category_byname (const char *category_name) - _UC_ATTRIBUTE_PURE; - -/* Return the bidi class of a Unicode character. */ -extern int - uc_bidi_class (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -/* Same; obsolete function name. */ -extern int - uc_bidi_category (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test whether a Unicode character belongs to a given bidi class. */ -extern bool - uc_is_bidi_class (ucs4_t uc, int bidi_class) - _UC_ATTRIBUTE_CONST; -/* Same; obsolete function name. */ -extern bool - uc_is_bidi_category (ucs4_t uc, int category) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 5 of Unicode Character Database: Character decomposition mapping. - See "uninorm.h". */ - -/* ========================================================================= */ - -/* Field 6 of Unicode Character Database: Decimal digit value. */ - -/* Return the decimal digit value of a Unicode character. */ -extern int - uc_decimal_value (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 7 of Unicode Character Database: Digit value. */ - -/* Return the digit value of a Unicode character. */ -extern int - uc_digit_value (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 8 of Unicode Character Database: Numeric value. */ - -/* Return the numeric value of a Unicode character. */ -typedef struct -{ - int numerator; - int denominator; -} -uc_fraction_t; -extern uc_fraction_t - uc_numeric_value (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 9 of Unicode Character Database: Mirrored. */ - -/* Return the mirrored character of a Unicode character UC in *PUC. */ -extern bool - uc_mirror_char (ucs4_t uc, ucs4_t *puc); - -/* ========================================================================= */ - -/* Field 10 of Unicode Character Database: Unicode 1.0 Name. - Not available in this library. */ - -/* ========================================================================= */ - -/* Field 11 of Unicode Character Database: ISO 10646 comment. - Not available in this library. */ - -/* ========================================================================= */ - -/* Field 12, 13, 14 of Unicode Character Database: Uppercase mapping, - lowercase mapping, titlecase mapping. See "unicase.h". */ - -/* ========================================================================= */ - -/* Field 2 of the file ArabicShaping.txt in the Unicode Character Database. */ - -/* Possible joining types. */ -enum -{ - UC_JOINING_TYPE_U, /* Non_Joining */ - UC_JOINING_TYPE_T, /* Transparent */ - UC_JOINING_TYPE_C, /* Join_Causing */ - UC_JOINING_TYPE_L, /* Left_Joining */ - UC_JOINING_TYPE_R, /* Right_Joining */ - UC_JOINING_TYPE_D /* Dual_Joining */ -}; - -/* Return the name of a joining type. */ -extern const char * - uc_joining_type_name (int joining_type) - _UC_ATTRIBUTE_CONST; - -/* Return the long name of a joining type. */ -extern const char * - uc_joining_type_long_name (int joining_type) - _UC_ATTRIBUTE_CONST; - -/* Return the joining type given by name, e.g. "D", or by long name, e.g. - "Dual Joining". */ -extern int - uc_joining_type_byname (const char *joining_type_name) - _UC_ATTRIBUTE_PURE; - -/* Return the joining type of a Unicode character. */ -extern int - uc_joining_type (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Field 3 of the file ArabicShaping.txt in the Unicode Character Database. */ - -/* Possible joining groups. - This enumeration may be extended in the future. */ -enum -{ - UC_JOINING_GROUP_NONE, /* No_Joining_Group */ - UC_JOINING_GROUP_AIN, /* Ain */ - UC_JOINING_GROUP_ALAPH, /* Alaph */ - UC_JOINING_GROUP_ALEF, /* Alef */ - UC_JOINING_GROUP_BEH, /* Beh */ - UC_JOINING_GROUP_BETH, /* Beth */ - UC_JOINING_GROUP_BURUSHASKI_YEH_BARREE, /* Burushaski_Yeh_Barree */ - UC_JOINING_GROUP_DAL, /* Dal */ - UC_JOINING_GROUP_DALATH_RISH, /* Dalath_Rish */ - UC_JOINING_GROUP_E, /* E */ - UC_JOINING_GROUP_FARSI_YEH, /* Farsi_Yeh */ - UC_JOINING_GROUP_FE, /* Fe */ - UC_JOINING_GROUP_FEH, /* Feh */ - UC_JOINING_GROUP_FINAL_SEMKATH, /* Final_Semkath */ - UC_JOINING_GROUP_GAF, /* Gaf */ - UC_JOINING_GROUP_GAMAL, /* Gamal */ - UC_JOINING_GROUP_HAH, /* Hah */ - UC_JOINING_GROUP_HE, /* He */ - UC_JOINING_GROUP_HEH, /* Heh */ - UC_JOINING_GROUP_HEH_GOAL, /* Heh_Goal */ - UC_JOINING_GROUP_HETH, /* Heth */ - UC_JOINING_GROUP_KAF, /* Kaf */ - UC_JOINING_GROUP_KAPH, /* Kaph */ - UC_JOINING_GROUP_KHAPH, /* Khaph */ - UC_JOINING_GROUP_KNOTTED_HEH, /* Knotted_Heh */ - UC_JOINING_GROUP_LAM, /* Lam */ - UC_JOINING_GROUP_LAMADH, /* Lamadh */ - UC_JOINING_GROUP_MEEM, /* Meem */ - UC_JOINING_GROUP_MIM, /* Mim */ - UC_JOINING_GROUP_NOON, /* Noon */ - UC_JOINING_GROUP_NUN, /* Nun */ - UC_JOINING_GROUP_NYA, /* Nya */ - UC_JOINING_GROUP_PE, /* Pe */ - UC_JOINING_GROUP_QAF, /* Qaf */ - UC_JOINING_GROUP_QAPH, /* Qaph */ - UC_JOINING_GROUP_REH, /* Reh */ - UC_JOINING_GROUP_REVERSED_PE, /* Reversed_Pe */ - UC_JOINING_GROUP_SAD, /* Sad */ - UC_JOINING_GROUP_SADHE, /* Sadhe */ - UC_JOINING_GROUP_SEEN, /* Seen */ - UC_JOINING_GROUP_SEMKATH, /* Semkath */ - UC_JOINING_GROUP_SHIN, /* Shin */ - UC_JOINING_GROUP_SWASH_KAF, /* Swash_Kaf */ - UC_JOINING_GROUP_SYRIAC_WAW, /* Syriac_Waw */ - UC_JOINING_GROUP_TAH, /* Tah */ - UC_JOINING_GROUP_TAW, /* Taw */ - UC_JOINING_GROUP_TEH_MARBUTA, /* Teh_Marbuta */ - UC_JOINING_GROUP_TEH_MARBUTA_GOAL, /* Teh_Marbuta_Goal */ - UC_JOINING_GROUP_TETH, /* Teth */ - UC_JOINING_GROUP_WAW, /* Waw */ - UC_JOINING_GROUP_YEH, /* Yeh */ - UC_JOINING_GROUP_YEH_BARREE, /* Yeh_Barree */ - UC_JOINING_GROUP_YEH_WITH_TAIL, /* Yeh_With_Tail */ - UC_JOINING_GROUP_YUDH, /* Yudh */ - UC_JOINING_GROUP_YUDH_HE, /* Yudh_He */ - UC_JOINING_GROUP_ZAIN, /* Zain */ - UC_JOINING_GROUP_ZHAIN, /* Zhain */ - UC_JOINING_GROUP_ROHINGYA_YEH, /* Rohingya_Yeh */ - UC_JOINING_GROUP_STRAIGHT_WAW, /* Straight_Waw */ - UC_JOINING_GROUP_MANICHAEAN_ALEPH, /* Manichaean_Aleph */ - UC_JOINING_GROUP_MANICHAEAN_BETH, /* Manichaean_Beth */ - UC_JOINING_GROUP_MANICHAEAN_GIMEL, /* Manichaean_Gimel */ - UC_JOINING_GROUP_MANICHAEAN_DALETH, /* Manichaean_Daleth */ - UC_JOINING_GROUP_MANICHAEAN_WAW, /* Manichaean_Waw */ - UC_JOINING_GROUP_MANICHAEAN_ZAYIN, /* Manichaean_Zayin */ - UC_JOINING_GROUP_MANICHAEAN_HETH, /* Manichaean_Heth */ - UC_JOINING_GROUP_MANICHAEAN_TETH, /* Manichaean_Teth */ - UC_JOINING_GROUP_MANICHAEAN_YODH, /* Manichaean_Yodh */ - UC_JOINING_GROUP_MANICHAEAN_KAPH, /* Manichaean_Kaph */ - UC_JOINING_GROUP_MANICHAEAN_LAMEDH, /* Manichaean_Lamedh */ - UC_JOINING_GROUP_MANICHAEAN_DHAMEDH, /* Manichaean_Dhamedh */ - UC_JOINING_GROUP_MANICHAEAN_THAMEDH, /* Manichaean_Thamedh */ - UC_JOINING_GROUP_MANICHAEAN_MEM, /* Manichaean_Mem */ - UC_JOINING_GROUP_MANICHAEAN_NUN, /* Manichaean_Nun */ - UC_JOINING_GROUP_MANICHAEAN_SAMEKH, /* Manichaean_Aleph */ - UC_JOINING_GROUP_MANICHAEAN_AYIN, /* Manichaean_Ayin */ - UC_JOINING_GROUP_MANICHAEAN_PE, /* Manichaean_Pe */ - UC_JOINING_GROUP_MANICHAEAN_SADHE, /* Manichaean_Sadhe */ - UC_JOINING_GROUP_MANICHAEAN_QOPH, /* Manichaean_Qoph */ - UC_JOINING_GROUP_MANICHAEAN_RESH, /* Manichaean_Resh */ - UC_JOINING_GROUP_MANICHAEAN_TAW, /* Manichaean_Taw */ - UC_JOINING_GROUP_MANICHAEAN_ONE, /* Manichaean_One */ - UC_JOINING_GROUP_MANICHAEAN_FIVE, /* Manichaean_Five */ - UC_JOINING_GROUP_MANICHAEAN_TEN, /* Manichaean_Ten */ - UC_JOINING_GROUP_MANICHAEAN_TWENTY, /* Manichaean_Twenty */ - UC_JOINING_GROUP_MANICHAEAN_HUNDRED, /* Manichaean_Hundred */ - UC_JOINING_GROUP_AFRICAN_FEH, /* African_Feh */ - UC_JOINING_GROUP_AFRICAN_QAF, /* African_Qaf */ - UC_JOINING_GROUP_AFRICAN_NOON, /* African_Noon */ - UC_JOINING_GROUP_MALAYALAM_NGA, /* Malayalam_Nga */ - UC_JOINING_GROUP_MALAYALAM_JA, /* Malayalam_Ja */ - UC_JOINING_GROUP_MALAYALAM_NYA, /* Malayalam_Nya */ - UC_JOINING_GROUP_MALAYALAM_TTA, /* Malayalam_Tta */ - UC_JOINING_GROUP_MALAYALAM_NNA, /* Malayalam_Nna */ - UC_JOINING_GROUP_MALAYALAM_NNNA, /* Malayalam_Nnna */ - UC_JOINING_GROUP_MALAYALAM_BHA, /* Malayalam_Bha */ - UC_JOINING_GROUP_MALAYALAM_RA, /* Malayalam_Ra */ - UC_JOINING_GROUP_MALAYALAM_LLA, /* Malayalam_Lla */ - UC_JOINING_GROUP_MALAYALAM_LLLA, /* Malayalam_Llla */ - UC_JOINING_GROUP_MALAYALAM_SSA, /* Malayalam_Ssa */ - UC_JOINING_GROUP_HANIFI_ROHINGYA_PA, /* Hanifi_Rohingya_Pa */ - UC_JOINING_GROUP_HANIFI_ROHINGYA_KINNA_YA, /* Hanifi_Rohingya_Kinna_Ya */ - UC_JOINING_GROUP_THIN_YEH, /* Thin_Yeh */ - UC_JOINING_GROUP_VERTICAL_TAIL, /* Vertical_Tail */ - UC_JOINING_GROUP_KASHMIRI_YEH, /* Kashmiri_Yeh */ - UC_JOINING_GROUP_THIN_NOON /* Thin_Noon */ -}; - -/* Return the name of a joining group. */ -extern const char * - uc_joining_group_name (int joining_group) - _UC_ATTRIBUTE_CONST; - -/* Return the joining group given by name, e.g. "Teh_Marbuta". */ -extern int - uc_joining_group_byname (const char *joining_group_name) - _UC_ATTRIBUTE_PURE; - -/* Return the joining group of a Unicode character. */ -extern int - uc_joining_group (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Common API for properties. */ - -/* Data type denoting a property. This is not just a number, but rather a - pointer to the test functions, so that programs that use only few of the - properties don't have a link-time dependency towards all the tables. */ -typedef struct -{ - bool (*test_fn) (ucs4_t uc); -} -uc_property_t; - -/* Predefined properties. */ -/* General. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_WHITE_SPACE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ALPHABETIC; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_ALPHABETIC; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_NOT_A_CHARACTER; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_DEPRECATED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_LOGICAL_ORDER_EXCEPTION; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_VARIATION_SELECTOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PRIVATE_USE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_UNASSIGNED_CODE_VALUE; -/* Case. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_UPPERCASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_UPPERCASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_LOWERCASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_LOWERCASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_TITLECASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CASED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CASE_IGNORABLE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CHANGES_WHEN_LOWERCASED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CHANGES_WHEN_UPPERCASED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CHANGES_WHEN_TITLECASED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CHANGES_WHEN_CASEFOLDED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CHANGES_WHEN_CASEMAPPED; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_SOFT_DOTTED; -/* Identifiers. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ID_START; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_ID_START; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ID_CONTINUE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_ID_CONTINUE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_XID_START; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_XID_CONTINUE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ID_COMPAT_MATH_START; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ID_COMPAT_MATH_CONTINUE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PATTERN_WHITE_SPACE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PATTERN_SYNTAX; -/* Shaping and rendering. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_JOIN_CONTROL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_GRAPHEME_BASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_GRAPHEME_EXTEND; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_GRAPHEME_EXTEND; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_GRAPHEME_LINK; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_MODIFIER_COMBINING_MARK; -/* Bidi. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_CONTROL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_LEFT_TO_RIGHT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_HEBREW_RIGHT_TO_LEFT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_ARABIC_RIGHT_TO_LEFT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_EUROPEAN_DIGIT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_EUR_NUM_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_EUR_NUM_TERMINATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_ARABIC_DIGIT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_COMMON_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_BLOCK_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_SEGMENT_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_WHITESPACE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_NON_SPACING_MARK; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_BOUNDARY_NEUTRAL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_PDF; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_EMBEDDING_OR_OVERRIDE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_BIDI_OTHER_NEUTRAL; -/* Numeric. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_HEX_DIGIT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ASCII_HEX_DIGIT; -/* CJK. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_IDEOGRAPHIC; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_UNIFIED_IDEOGRAPH; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_RADICAL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_IDS_UNARY_OPERATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_IDS_BINARY_OPERATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_IDS_TRINARY_OPERATOR; -/* Emoji. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EMOJI; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EMOJI_PRESENTATION; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EMOJI_MODIFIER; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EMOJI_MODIFIER_BASE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EMOJI_COMPONENT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EXTENDED_PICTOGRAPHIC; -/* Misc. */ -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ZERO_WIDTH; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_SPACE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_NON_BREAK; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_ISO_CONTROL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_FORMAT_CONTROL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PREPENDED_CONCATENATION_MARK; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_DASH; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_HYPHEN; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PUNCTUATION; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_LINE_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PARAGRAPH_SEPARATOR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_QUOTATION_MARK; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_SENTENCE_TERMINAL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_TERMINAL_PUNCTUATION; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_CURRENCY_SYMBOL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_MATH; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_OTHER_MATH; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_PAIRED_PUNCTUATION; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_LEFT_OF_PAIR; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_COMBINING; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_COMPOSITE; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_DECIMAL_DIGIT; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_NUMERIC; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_DIACRITIC; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_EXTENDER; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_IGNORABLE_CONTROL; -extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_PROPERTY_REGIONAL_INDICATOR; - -/* Return the property given by name, e.g. "White space". */ -extern uc_property_t - uc_property_byname (const char *property_name); - -/* Test whether a property is valid. */ -#define uc_property_is_valid(property) ((property).test_fn != NULL) - -/* Test whether a Unicode character has a given property. */ -extern bool - uc_is_property (ucs4_t uc, uc_property_t property); -extern bool uc_is_property_white_space (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_alphabetic (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_alphabetic (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_not_a_character (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_default_ignorable_code_point (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_default_ignorable_code_point (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_deprecated (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_logical_order_exception (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_variation_selector (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_private_use (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_unassigned_code_value (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_uppercase (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_uppercase (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_lowercase (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_lowercase (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_titlecase (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_cased (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_case_ignorable (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_changes_when_lowercased (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_changes_when_uppercased (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_changes_when_titlecased (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_changes_when_casefolded (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_changes_when_casemapped (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_soft_dotted (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_id_start (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_id_start (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_id_continue (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_id_continue (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_xid_start (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_xid_continue (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_id_compat_math_start (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_id_compat_math_continue (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_pattern_white_space (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_pattern_syntax (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_join_control (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_grapheme_base (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_grapheme_extend (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_grapheme_extend (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_grapheme_link (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_modifier_combining_mark (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_control (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_left_to_right (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_hebrew_right_to_left (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_arabic_right_to_left (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_european_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_eur_num_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_eur_num_terminator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_arabic_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_common_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_block_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_segment_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_whitespace (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_non_spacing_mark (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_boundary_neutral (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_pdf (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_embedding_or_override (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_bidi_other_neutral (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_hex_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ascii_hex_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ideographic (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_unified_ideograph (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_radical (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ids_unary_operator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ids_binary_operator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ids_trinary_operator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_emoji (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_emoji_presentation (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_emoji_modifier (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_emoji_modifier_base (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_emoji_component (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_extended_pictographic (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_zero_width (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_space (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_non_break (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_iso_control (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_format_control (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_prepended_concatenation_mark (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_dash (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_hyphen (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_punctuation (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_line_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_paragraph_separator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_quotation_mark (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_sentence_terminal (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_terminal_punctuation (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_currency_symbol (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_math (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_other_math (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_paired_punctuation (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_left_of_pair (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_combining (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_composite (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_decimal_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_numeric (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_diacritic (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_extender (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_ignorable_control (ucs4_t uc) - _UC_ATTRIBUTE_CONST; -extern bool uc_is_property_regional_indicator (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Other attributes. */ - -/* ------------------------------------------------------------------------- */ - -/* Indic_Conjunct_Break (InCB): from the file DerivedCoreProperties.txt - in the Unicode Character Database. */ - -/* Possible values of the Indic_Conjunct_Break attribute. - This enumeration may be extended in the future. */ -enum -{ - UC_INDIC_CONJUNCT_BREAK_NONE, /* None */ - UC_INDIC_CONJUNCT_BREAK_CONSONANT, /* Consonant */ - UC_INDIC_CONJUNCT_BREAK_LINKER, /* Linker */ - UC_INDIC_CONJUNCT_BREAK_EXTEND /* Extend */ -}; - -/* Return the name of an Indic_Conjunct_Break value. */ -extern const char * - uc_indic_conjunct_break_name (int indic_conjunct_break) - _UC_ATTRIBUTE_CONST; - -/* Return the Indic_Conjunct_Break value given by name, e.g. "Consonant". */ -extern int - uc_indic_conjunct_break_byname (const char *indic_conjunct_break_name) - _UC_ATTRIBUTE_PURE; - -/* Return the Indic_Conjunct_Break attribute of a Unicode character. */ -extern int - uc_indic_conjunct_break (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Subdivision of the Unicode characters into scripts. */ - -typedef struct -{ - unsigned int code : 21; - unsigned int start : 1; - unsigned int end : 1; -} -uc_interval_t; -typedef struct -{ - unsigned int nintervals; - const uc_interval_t *intervals; - const char *name; -} -uc_script_t; - -/* Return the script of a Unicode character. */ -extern const uc_script_t * - uc_script (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Return the script given by name, e.g. "HAN". */ -extern const uc_script_t * - uc_script_byname (const char *script_name) - _UC_ATTRIBUTE_PURE; - -/* Test whether a Unicode character belongs to a given script. */ -extern bool - uc_is_script (ucs4_t uc, const uc_script_t *script) - _UC_ATTRIBUTE_PURE; - -/* Get the list of all scripts. */ -extern void - uc_all_scripts (const uc_script_t **scripts, size_t *count); - -/* ========================================================================= */ - -/* Subdivision of the Unicode character range into blocks. */ - -typedef struct -{ - ucs4_t start; - ucs4_t end; - const char *name; -} -uc_block_t; - -/* Return the block a character belongs to. */ -extern const uc_block_t * - uc_block (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test whether a Unicode character belongs to a given block. */ -extern bool - uc_is_block (ucs4_t uc, const uc_block_t *block) - _UC_ATTRIBUTE_PURE; - -/* Get the list of all blocks. */ -extern void - uc_all_blocks (const uc_block_t **blocks, size_t *count); - -/* ========================================================================= */ - -/* Properties taken from language standards. */ - -/* Test whether a Unicode character is considered whitespace in ISO C 99. */ -extern bool - uc_is_c_whitespace (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test whether a Unicode character is considered whitespace in Java. */ -extern bool - uc_is_java_whitespace (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -enum -{ - UC_IDENTIFIER_START, /* valid as first or subsequent character */ - UC_IDENTIFIER_VALID, /* valid as subsequent character only */ - UC_IDENTIFIER_INVALID, /* not valid */ - UC_IDENTIFIER_IGNORABLE /* ignorable (Java only) */ -}; - -/* Return the categorization of a Unicode character w.r.t. the ISO C 99 - identifier syntax. */ -extern int - uc_c_ident_category (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Return the categorization of a Unicode character w.r.t. the Java - identifier syntax. */ -extern int - uc_java_ident_category (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -/* Like ISO C and . These functions are deprecated, - because this set of functions was designed with ASCII in mind and cannot - reflect the more diverse reality of the Unicode character set. But they - can be a quick-and-dirty porting aid when migrating from wchar_t APIs - to Unicode strings. */ - -/* Test for any character for which 'uc_is_alpha' or 'uc_is_digit' is true. */ -extern bool - uc_is_alnum (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character for which 'uc_is_upper' or 'uc_is_lower' is true, - or any character that is one of a locale-specific set of characters for - which none of 'uc_is_cntrl', 'uc_is_digit', 'uc_is_punct', or 'uc_is_space' - is true. */ -extern bool - uc_is_alpha (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any control character. */ -extern bool - uc_is_cntrl (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character that corresponds to a decimal-digit character. */ -extern bool - uc_is_digit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character for which 'uc_is_print' is true and 'uc_is_space' - is false. */ -extern bool - uc_is_graph (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character that corresponds to a lowercase letter or is one - of a locale-specific set of characters for which none of 'uc_is_cntrl', - 'uc_is_digit', 'uc_is_punct', or 'uc_is_space' is true. */ -extern bool - uc_is_lower (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any printing character. */ -extern bool - uc_is_print (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any printing character that is one of a locale-specific set of - characters for which neither 'uc_is_space' nor 'uc_is_alnum' is true. */ -extern bool - uc_is_punct (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character that corresponds to a locale-specific set of - characters for which none of 'uc_is_alnum', 'uc_is_graph', or 'uc_is_punct' - is true. */ -extern bool - uc_is_space (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character that corresponds to an uppercase letter or is one - of a locale-specific set of character for which none of 'uc_is_cntrl', - 'uc_is_digit', 'uc_is_punct', or 'uc_is_space' is true. */ -extern bool - uc_is_upper (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* Test for any character that corresponds to a hexadecimal-digit - character. */ -extern bool - uc_is_xdigit (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* GNU extension. */ -/* Test for any character that corresponds to a standard blank character or - a locale-specific set of characters for which 'uc_is_alnum' is false. */ -extern bool - uc_is_blank (ucs4_t uc) - _UC_ATTRIBUTE_CONST; - -/* ========================================================================= */ - -#ifdef __cplusplus -} -#endif - -#endif /* _UNICTYPE_H */ diff --git a/gl/unictype.in.h b/gl/unictype.in.h index 3818da91..c3b9ecaf 100644 --- a/gl/unictype.in.h +++ b/gl/unictype.in.h @@ -1,5 +1,5 @@ /* Unicode character classification and properties. - Copyright (C) 2002, 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -576,7 +576,8 @@ enum UC_JOINING_GROUP_HANIFI_ROHINGYA_KINNA_YA, /* Hanifi_Rohingya_Kinna_Ya */ UC_JOINING_GROUP_THIN_YEH, /* Thin_Yeh */ UC_JOINING_GROUP_VERTICAL_TAIL, /* Vertical_Tail */ - UC_JOINING_GROUP_KASHMIRI_YEH /* Kashmiri_Yeh */ + UC_JOINING_GROUP_KASHMIRI_YEH, /* Kashmiri_Yeh */ + UC_JOINING_GROUP_THIN_NOON /* Thin_Noon */ }; /* Return the name of a joining group. */ diff --git a/gl/unictype/bitmap.h b/gl/unictype/bitmap.h index 869ac066..621861da 100644 --- a/gl/unictype/bitmap.h +++ b/gl/unictype/bitmap.h @@ -1,5 +1,5 @@ /* Three-level bitmap lookup. - Copyright (C) 2000-2002, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2000-2002, 2005-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2000-2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_alnum.c b/gl/unictype/ctype_alnum.c index f58f4310..7cd9157a 100644 --- a/gl/unictype/ctype_alnum.c +++ b/gl/unictype/ctype_alnum.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_alnum.h b/gl/unictype/ctype_alnum.h index 3ee771ab..0530175e 100644 --- a/gl/unictype/ctype_alnum.h +++ b/gl/unictype/ctype_alnum.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct int header[1]; int level1[4]; short level2[4 << 7]; - unsigned int level3[85 << 4]; + unsigned int level3[83 << 4]; } u_is_alnum = { @@ -234,10 +234,10 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 928, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 944, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 928, -1, -1, -1, @@ -254,14 +254,14 @@ u_is_alnum = -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 944, 5 + 512 * sizeof (short) / sizeof (int) + 960, 5 + 512 * sizeof (short) / sizeof (int) + 976, - 5 + 512 * sizeof (short) / sizeof (int) + 992, -1, -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1008, + 5 + 512 * sizeof (short) / sizeof (int) + 992, -1, -1, -1, @@ -269,30 +269,30 @@ u_is_alnum = -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1024, + 5 + 512 * sizeof (short) / sizeof (int) + 1008, -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1024, 5 + 512 * sizeof (short) / sizeof (int) + 1040, - 5 + 512 * sizeof (short) / sizeof (int) + 1056, -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1056, 5 + 512 * sizeof (short) / sizeof (int) + 1072, 5 + 512 * sizeof (short) / sizeof (int) + 1088, 5 + 512 * sizeof (short) / sizeof (int) + 1104, 5 + 512 * sizeof (short) / sizeof (int) + 1120, 5 + 512 * sizeof (short) / sizeof (int) + 1136, - 5 + 512 * sizeof (short) / sizeof (int) + 1152, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1152, 5 + 512 * sizeof (short) / sizeof (int) + 1168, - 5 + 512 * sizeof (short) / sizeof (int) + 1184, -1, -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1200, + 5 + 512 * sizeof (short) / sizeof (int) + 1184, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -378,7 +378,7 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1216, + 5 + 512 * sizeof (short) / sizeof (int) + 1200, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -386,9 +386,8 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1232, - 5 + 512 * sizeof (short) / sizeof (int) + 1248, 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1216, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -398,8 +397,8 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1264, 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1232, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -412,15 +411,16 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1280, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1296, + 5 + 512 * sizeof (short) / sizeof (int) + 1248, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1264, -1, -1, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1312, + 5 + 512 * sizeof (short) / sizeof (int) + 1280, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -432,7 +432,7 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1328, + 5 + 512 * sizeof (short) / sizeof (int) + 1296, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -440,16 +440,16 @@ u_is_alnum = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1344, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1312, -1, -1, -1, @@ -570,15 +570,15 @@ u_is_alnum = 0xFFFD0000U, 0x0000FFFFU, 0xFFFFE000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0002003FU, 0xFFFFFFFFU, 0x043007FFU, 0x043FFFFFU, 0x00000110U, 0x01FFFFFFU, 0xFFFF07FFU, - 0x00007EFFU, 0xFFFFFFFFU, 0x000003FFU, 0x00000000U, + 0x0000FEFFU, 0xFFFFFFFFU, 0x000003FFU, 0x00000000U, 0xFFFFFFF0U, 0x23FFFFFFU, 0xFF010000U, 0xFFFEFFC3U, 0xFFF99FE1U, 0x23C5FDFFU, 0xB0004000U, 0x1003FFC3U, 0xFFF987E0U, 0x036DFDFFU, 0x5E000000U, 0x001CFFC0U, 0xFFFBBFE0U, 0x23EDFDFFU, 0x00010000U, 0x0200FFC3U, 0xFFF99FE0U, 0x23EDFDFFU, 0xB0000000U, 0x0002FFC3U, 0xD63DC7E8U, 0x03FFC718U, 0x00010000U, 0x0000FFC0U, - 0xFFFDDFE0U, 0x23FFFDFFU, 0x27000000U, 0x0000FFC3U, - 0xFFFDDFE1U, 0x23EFFDFFU, 0x60000000U, 0x0006FFC3U, + 0xFFFDDFE0U, 0x23FFFDFFU, 0x37000000U, 0x0000FFC3U, + 0xFFFDDFE1U, 0x23EFFDFFU, 0x70000000U, 0x0006FFC3U, 0xFFFDDFF0U, 0x27FFFFFFU, 0x80704000U, 0xFC00FFC3U, 0xFC7FFFE0U, 0x2FFBFFFFU, 0x0000007FU, 0x0000FFC0U, 0xFFFFFFFEU, 0x07FF7FFFU, 0x03FF7FBFU, 0x00000000U, @@ -652,7 +652,7 @@ u_is_alnum = 0xFFFF1FFFU, 0x00000FFFU, 0xFFFFFFFFU, 0x80007FFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000FFFFU, 0xFF800000U, 0xFFFFFFFCU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFF9FFU, 0xFFFFFFFFU, 0x1FEB3FFFU, 0xFFFC0000U, + 0xFFFFF9FFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFE0000U, 0xFFFFF7BBU, 0x00000007U, 0xFFFFFFFFU, 0x000FFFFFU, 0xFFFFFFFCU, 0x000FFFFFU, 0x03FF0000U, 0x68FC0000U, 0xFFFFFFFFU, 0xFFFF003FU, 0x0000007FU, 0x1FFFFFFFU, @@ -699,7 +699,7 @@ u_is_alnum = 0xFFFFFFBFU, 0x07FDFFFFU, 0x00000000U, 0x00000000U, 0xFFFFFD3FU, 0x91BFFFFFU, 0x003FFFFFU, 0x007FFFFFU, 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x0037FFFFU, - 0x003FFFFFU, 0x03FFFFFFU, 0x00000000U, 0x00000000U, + 0x003FFFFFU, 0x03FFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xC0FFFFFFU, 0x00000000U, 0x00000000U, 0xFEEF0001U, 0x003FFFFFU, 0x00000000U, 0x1FFFFFFFU, 0x1FFFFFFFU, 0x00000000U, 0xFFFFFEFFU, 0x0000001FU, @@ -710,7 +710,7 @@ u_is_alnum = 0xFFFFFFFFU, 0x03FF000FU, 0xFFFFFFFFU, 0xFFFF803FU, 0x0000003FU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0xFFFFFFFFU, 0x000303FFU, 0x0000001CU, 0x00000000U, + 0xFFFFFFFFU, 0x000303FFU, 0x000000FCU, 0x00000000U, 0x1FFFFFFFU, 0xFFFF0080U, 0x0000003FU, 0xFFFF0000U, 0x00000003U, 0xFFFF0000U, 0x0000001FU, 0x007FFFFFU, 0xFFFFFFF8U, 0x00FFFFFFU, 0x00000000U, 0x0026FFC0U, @@ -740,7 +740,7 @@ u_is_alnum = 0xFFFFFDFFU, 0x00007FFFU, 0x03FF0001U, 0xFFFC0000U, 0x0000FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFB7FU, 0x0001FFFFU, 0x03FF0040U, 0xFFFFFDBFU, - 0x010003FFU, 0x000003FFU, 0x00000000U, 0x00000000U, + 0x010003FFU, 0xFFFF03FFU, 0x0FFFFFFFU, 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x0007FFFFU, 0xFFFDFFF4U, 0x000FFFFFU, 0x03FF0000U, 0x00000000U, @@ -782,17 +782,13 @@ u_is_alnum = 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FF1FFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0xF9FFFFFFU, 0x000FFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000107FFU, 0x00000000U, - 0xFFF80000U, 0x00000000U, 0x00000000U, 0x0000000BU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, + 0xFFF80000U, 0x00000000U, 0x00000000U, 0x007C000BU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x80000000U, - 0x000001FFU, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0007FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -838,7 +834,7 @@ u_is_alnum = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFF0000U, 0x07FF3FFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x7FFFFFFFU, 0xC01F3FB7U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFF6F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -861,16 +857,12 @@ u_is_alnum = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFF0003U, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -889,9 +881,9 @@ u_is_alnum = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF07FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x0000FFFFU, 0x00000000U, 0x00000000U + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U } }; diff --git a/gl/unictype/ctype_alpha.c b/gl/unictype/ctype_alpha.c index c422fec6..9beeb03f 100644 --- a/gl/unictype/ctype_alpha.c +++ b/gl/unictype/ctype_alpha.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_alpha.h b/gl/unictype/ctype_alpha.h index cd129cb9..39f2f09a 100644 --- a/gl/unictype/ctype_alpha.h +++ b/gl/unictype/ctype_alpha.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct int header[1]; int level1[4]; short level2[4 << 7]; - unsigned int level3[85 << 4]; + unsigned int level3[83 << 4]; } u_is_alpha = { @@ -234,10 +234,10 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 928, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 944, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 928, -1, -1, -1, @@ -254,14 +254,14 @@ u_is_alpha = -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 944, 5 + 512 * sizeof (short) / sizeof (int) + 960, 5 + 512 * sizeof (short) / sizeof (int) + 976, - 5 + 512 * sizeof (short) / sizeof (int) + 992, -1, -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1008, + 5 + 512 * sizeof (short) / sizeof (int) + 992, -1, -1, -1, @@ -269,30 +269,30 @@ u_is_alpha = -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1024, + 5 + 512 * sizeof (short) / sizeof (int) + 1008, -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1024, 5 + 512 * sizeof (short) / sizeof (int) + 1040, - 5 + 512 * sizeof (short) / sizeof (int) + 1056, -1, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1056, 5 + 512 * sizeof (short) / sizeof (int) + 1072, 5 + 512 * sizeof (short) / sizeof (int) + 1088, 5 + 512 * sizeof (short) / sizeof (int) + 1104, 5 + 512 * sizeof (short) / sizeof (int) + 1120, 5 + 512 * sizeof (short) / sizeof (int) + 1136, - 5 + 512 * sizeof (short) / sizeof (int) + 1152, -1, -1, + 5 + 512 * sizeof (short) / sizeof (int) + 1152, 5 + 512 * sizeof (short) / sizeof (int) + 1168, - 5 + 512 * sizeof (short) / sizeof (int) + 1184, -1, -1, -1, -1, - 5 + 512 * sizeof (short) / sizeof (int) + 1200, + 5 + 512 * sizeof (short) / sizeof (int) + 1184, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -378,7 +378,7 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1216, + 5 + 512 * sizeof (short) / sizeof (int) + 1200, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -386,9 +386,8 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1232, - 5 + 512 * sizeof (short) / sizeof (int) + 1248, 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1216, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -398,8 +397,8 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1264, 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1232, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -412,15 +411,16 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1280, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1296, + 5 + 512 * sizeof (short) / sizeof (int) + 1248, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1264, -1, -1, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1312, + 5 + 512 * sizeof (short) / sizeof (int) + 1280, -1, -1, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -432,7 +432,7 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1328, + 5 + 512 * sizeof (short) / sizeof (int) + 1296, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, @@ -440,16 +440,16 @@ u_is_alpha = 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, 5 + 512 * sizeof (short) / sizeof (int) + 336, - 5 + 512 * sizeof (short) / sizeof (int) + 1344, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 336, + 5 + 512 * sizeof (short) / sizeof (int) + 1312, -1, -1, -1, @@ -570,15 +570,15 @@ u_is_alpha = 0xFFFD0000U, 0x0000FFFFU, 0xFFFFE000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0002003FU, 0xFFFFFFFFU, 0x043007FFU, 0x043FFFFFU, 0x00000110U, 0x01FFFFFFU, 0xFFFF07FFU, - 0x00007EFFU, 0xFFFFFFFFU, 0x000003FFU, 0x00000000U, + 0x0000FEFFU, 0xFFFFFFFFU, 0x000003FFU, 0x00000000U, 0xFFFFFFF0U, 0x23FFFFFFU, 0xFF010000U, 0xFFFEFFC3U, 0xFFF99FE1U, 0x23C5FDFFU, 0xB0004000U, 0x1003FFC3U, 0xFFF987E0U, 0x036DFDFFU, 0x5E000000U, 0x001CFFC0U, 0xFFFBBFE0U, 0x23EDFDFFU, 0x00010000U, 0x0200FFC3U, 0xFFF99FE0U, 0x23EDFDFFU, 0xB0000000U, 0x0002FFC3U, 0xD63DC7E8U, 0x03FFC718U, 0x00010000U, 0x0000FFC0U, - 0xFFFDDFE0U, 0x23FFFDFFU, 0x27000000U, 0x0000FFC3U, - 0xFFFDDFE1U, 0x23EFFDFFU, 0x60000000U, 0x0006FFC3U, + 0xFFFDDFE0U, 0x23FFFDFFU, 0x37000000U, 0x0000FFC3U, + 0xFFFDDFE1U, 0x23EFFDFFU, 0x70000000U, 0x0006FFC3U, 0xFFFDDFF0U, 0x27FFFFFFU, 0x80704000U, 0xFC00FFC3U, 0xFC7FFFE0U, 0x2FFBFFFFU, 0x0000007FU, 0x0000FFC0U, 0xFFFFFFFEU, 0x07FF7FFFU, 0x03FF7FBFU, 0x00000000U, @@ -652,7 +652,7 @@ u_is_alpha = 0xFFFF1FFFU, 0x00000FFFU, 0xFFFFFFFFU, 0x80007FFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000FFFFU, 0xFF800000U, 0xFFFFFFFCU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFF9FFU, 0xFFFFFFFFU, 0x1FEB3FFFU, 0xFFFC0000U, + 0xFFFFF9FFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFE0000U, 0xFFFFF7BBU, 0x00000007U, 0xFFFFFFFFU, 0x000FFFFFU, 0xFFFFFFFCU, 0x000FFFFFU, 0x03FF0000U, 0x68FC0000U, 0xFFFFFFFFU, 0xFFFF003FU, 0x0000007FU, 0x1FFFFFFFU, @@ -699,7 +699,7 @@ u_is_alpha = 0xFFFFFFBFU, 0x07FDFFFFU, 0x00000000U, 0x00000000U, 0xFFFFFD3FU, 0x91BFFFFFU, 0x003FFFFFU, 0x007FFFFFU, 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x0037FFFFU, - 0x003FFFFFU, 0x03FFFFFFU, 0x00000000U, 0x00000000U, + 0x003FFFFFU, 0x03FFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xC0FFFFFFU, 0x00000000U, 0x00000000U, 0xFEEF0001U, 0x003FFFFFU, 0x00000000U, 0x1FFFFFFFU, 0x1FFFFFFFU, 0x00000000U, 0xFFFFFEFFU, 0x0000001FU, @@ -710,7 +710,7 @@ u_is_alpha = 0xFFFFFFFFU, 0x03FF000FU, 0xFFFFFFFFU, 0xFFFF803FU, 0x0000003FU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0xFFFFFFFFU, 0x000303FFU, 0x0000001CU, 0x00000000U, + 0xFFFFFFFFU, 0x000303FFU, 0x000000FCU, 0x00000000U, 0x1FFFFFFFU, 0xFFFF0080U, 0x0000003FU, 0xFFFF0000U, 0x00000003U, 0xFFFF0000U, 0x0000001FU, 0x007FFFFFU, 0xFFFFFFF8U, 0x00FFFFFFU, 0x00000000U, 0x0026FFC0U, @@ -740,7 +740,7 @@ u_is_alpha = 0xFFFFFDFFU, 0x00007FFFU, 0x03FF0001U, 0xFFFC0000U, 0x0000FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFB7FU, 0x0001FFFFU, 0x03FF0040U, 0xFFFFFDBFU, - 0x010003FFU, 0x000003FFU, 0x00000000U, 0x00000000U, + 0x010003FFU, 0xFFFF03FFU, 0x0FFFFFFFU, 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x0007FFFFU, 0xFFFDFFF4U, 0x000FFFFFU, 0x03FF0000U, 0x00000000U, @@ -782,17 +782,13 @@ u_is_alpha = 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FF1FFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0xF9FFFFFFU, 0x000FFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000107FFU, 0x00000000U, - 0xFFF80000U, 0x00000000U, 0x00000000U, 0x0000000BU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, + 0xFFF80000U, 0x00000000U, 0x00000000U, 0x007C000BU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x80000000U, - 0x000001FFU, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0007FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -838,7 +834,7 @@ u_is_alpha = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFF0000U, 0x07FF3FFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x7FFFFFFFU, 0xC01F3FB7U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFF6F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -861,16 +857,12 @@ u_is_alpha = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFF0003U, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -889,9 +881,9 @@ u_is_alpha = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF07FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x0000FFFFU, 0x00000000U, 0x00000000U + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U } }; diff --git a/gl/unictype/ctype_blank.c b/gl/unictype/ctype_blank.c index 25a08013..e14cc44e 100644 --- a/gl/unictype/ctype_blank.c +++ b/gl/unictype/ctype_blank.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_blank.h b/gl/unictype/ctype_blank.h index 23fac0f3..d0605c69 100644 --- a/gl/unictype/ctype_blank.h +++ b/gl/unictype/ctype_blank.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unictype/ctype_cntrl.c b/gl/unictype/ctype_cntrl.c index eb7467dd..1c5cefa1 100644 --- a/gl/unictype/ctype_cntrl.c +++ b/gl/unictype/ctype_cntrl.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_cntrl.h b/gl/unictype/ctype_cntrl.h index 58df7e76..ba6bf7ca 100644 --- a/gl/unictype/ctype_cntrl.h +++ b/gl/unictype/ctype_cntrl.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unictype/ctype_digit.c b/gl/unictype/ctype_digit.c index a82b3bb0..71d68807 100644 --- a/gl/unictype/ctype_digit.c +++ b/gl/unictype/ctype_digit.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_digit.h b/gl/unictype/ctype_digit.h index 2f7d1822..7322861f 100644 --- a/gl/unictype/ctype_digit.h +++ b/gl/unictype/ctype_digit.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unictype/ctype_graph.c b/gl/unictype/ctype_graph.c index 2c41c794..92701700 100644 --- a/gl/unictype/ctype_graph.c +++ b/gl/unictype/ctype_graph.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_graph.h b/gl/unictype/ctype_graph.h index 5627ad0f..948d21d2 100644 --- a/gl/unictype/ctype_graph.h +++ b/gl/unictype/ctype_graph.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct int header[1]; int level1[17]; short level2[6 << 7]; - unsigned int level3[94 << 4]; + unsigned int level3[92 << 4]; } u_is_graph = { @@ -247,10 +247,10 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 912, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 928, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 912, -1, -1, -1, @@ -267,14 +267,14 @@ u_is_graph = -1, -1, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 928, 18 + 768 * sizeof (short) / sizeof (int) + 944, 18 + 768 * sizeof (short) / sizeof (int) + 960, - 18 + 768 * sizeof (short) / sizeof (int) + 976, -1, -1, -1, -1, - 18 + 768 * sizeof (short) / sizeof (int) + 992, + 18 + 768 * sizeof (short) / sizeof (int) + 976, -1, -1, -1, @@ -282,30 +282,30 @@ u_is_graph = -1, -1, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 992, 18 + 768 * sizeof (short) / sizeof (int) + 1008, 18 + 768 * sizeof (short) / sizeof (int) + 1024, 18 + 768 * sizeof (short) / sizeof (int) + 1040, 18 + 768 * sizeof (short) / sizeof (int) + 1056, 18 + 768 * sizeof (short) / sizeof (int) + 1072, - 18 + 768 * sizeof (short) / sizeof (int) + 1088, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1104, + 18 + 768 * sizeof (short) / sizeof (int) + 1088, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 1104, 18 + 768 * sizeof (short) / sizeof (int) + 1120, 18 + 768 * sizeof (short) / sizeof (int) + 1136, 18 + 768 * sizeof (short) / sizeof (int) + 1152, 18 + 768 * sizeof (short) / sizeof (int) + 1168, 18 + 768 * sizeof (short) / sizeof (int) + 1184, - 18 + 768 * sizeof (short) / sizeof (int) + 1200, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 1200, 18 + 768 * sizeof (short) / sizeof (int) + 1216, 18 + 768 * sizeof (short) / sizeof (int) + 1232, 18 + 768 * sizeof (short) / sizeof (int) + 1248, - 18 + 768 * sizeof (short) / sizeof (int) + 1264, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1264, 18 + 768 * sizeof (short) / sizeof (int) + 1280, 18 + 768 * sizeof (short) / sizeof (int) + 1296, - 18 + 768 * sizeof (short) / sizeof (int) + 1312, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -391,7 +391,7 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1328, + 18 + 768 * sizeof (short) / sizeof (int) + 1312, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -399,9 +399,8 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1344, - 18 + 768 * sizeof (short) / sizeof (int) + 1360, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1328, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -411,8 +410,8 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1376, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1344, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -425,15 +424,16 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1392, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1408, + 18 + 768 * sizeof (short) / sizeof (int) + 1360, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1376, -1, -1, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1424, + 18 + 768 * sizeof (short) / sizeof (int) + 1392, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -445,7 +445,7 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1440, + 18 + 768 * sizeof (short) / sizeof (int) + 1408, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -453,16 +453,16 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1456, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1424, -1, -1, -1, @@ -564,7 +564,7 @@ u_is_graph = -1, -1, -1, - 18 + 768 * sizeof (short) / sizeof (int) + 1472, + 18 + 768 * sizeof (short) / sizeof (int) + 1440, -1, -1, -1, @@ -819,7 +819,7 @@ u_is_graph = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1488 + 18 + 768 * sizeof (short) / sizeof (int) + 1456 }, { 0x00000000U, 0xFFFFFFFEU, 0xFFFFFFFFU, 0x7FFFFFFFU, @@ -839,15 +839,15 @@ u_is_graph = 0xFFFFBFFFU, 0xFFFFFFFFU, 0xFFFFE7FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0003FFFFU, 0xFFFFFFFFU, 0xE7FFFFFFU, 0xFFFFFFFFU, 0x7FFF3FFFU, 0x4FFFFFFFU, 0xFFFF07FFU, - 0xFF837FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFF83FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFF99FEFU, 0xF3C5FDFFU, 0xB080799FU, 0x7FFFFFCFU, 0xFFF987EEU, 0xD36DFDFFU, 0x5E023987U, 0x007FFFC0U, 0xFFFBBFEEU, 0xF3EDFDFFU, 0x00013BBFU, 0xFE03FFCFU, 0xFFF99FEEU, 0xF3EDFDFFU, 0xB0E0399FU, 0x00FFFFCFU, 0xD63DC7ECU, 0xC3FFC718U, 0x00813DC7U, 0x07FFFFC0U, - 0xFFFDDFFFU, 0xF3FFFDFFU, 0x27603DDFU, 0xFF80FFCFU, - 0xFFFDDFFFU, 0xF3EFFDFFU, 0x60603DDFU, 0x000EFFCFU, + 0xFFFDDFFFU, 0xF3FFFDFFU, 0x37603DDFU, 0xFF80FFCFU, + 0xFFFDDFFFU, 0xF3EFFDFFU, 0x70603DDFU, 0x000EFFCFU, 0xFFFDDFFFU, 0xFFFFFFFFU, 0xFFF0FDDFU, 0xFFFFFFCFU, 0xFC7FFFEEU, 0x2FFBFFFFU, 0xFF5F847FU, 0x001CFFC0U, 0xFFFFFFFEU, 0x87FFFFFFU, 0x0FFFFFFFU, 0x00000000U, @@ -875,7 +875,7 @@ u_is_graph = 0x7FFFFFFFU, 0x0FFF0FFFU, 0xFFFFFFF1U, 0x001F3FFFU, 0xFFFFFFFFU, 0xFFFF0FFFU, 0xC7FF03FFU, 0xFFFFFFFFU, 0xCFFFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU, 0x9FFFFFFFU, - 0x03FF03FFU, 0xFFFF3FFFU, 0x00007FFFU, 0x00000000U, + 0x03FF03FFU, 0xFFFF3FFFU, 0x3FFFFFFFU, 0x00000FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFDFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF00FFFFFU, 0xFFFFFFFFU, 0xF8FFFFFFU, 0xFFFFE3FFU, 0xFFFFFFFFU, @@ -887,7 +887,7 @@ u_is_graph = 0x3F3FFFFFU, 0xFFFFFFFFU, 0xAAFF3F3FU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFDFFFFFU, 0xEFCFFFDFU, 0x7FDCFFFFU, 0xFFFFF880U, 0xFFFFFCFFU, 0x7FFFFFFFU, 0xFFF3FFDFU, - 0x1FFF7FFFU, 0xFFFFFFFFU, 0xFFFF0001U, 0x0001FFFFU, + 0x1FFF7FFFU, 0xFFFFFFFFU, 0xFFFF0003U, 0x0001FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000003FFU, 0x000007FFU, 0xFFFFFFFFU, @@ -897,7 +897,7 @@ u_is_graph = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFCFFFFFU, - 0xFFBFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFE0FFFFFU, 0xFFFFFFFFU, 0xFFFF20BFU, 0xFFFFFFFFU, 0x800180FFU, @@ -921,7 +921,7 @@ u_is_graph = 0xFFFFFFFFU, 0x00000FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FEB3FFFU, 0xFFFC0000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFE0000U, 0xFFFFFFFFU, 0x03FF1FFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFC03FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x800FFFFFU, 0x1FFFFFFFU, @@ -937,11 +937,11 @@ u_is_graph = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xE0F8007FU, 0x5F7FFFFFU, 0xFFFFFFDBU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFF80007U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFCFFFFU, 0xFFFFFFFFU, 0x000080FFU, 0xFFFF0000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000FFFFU, 0xFFFF0000U, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFF7FFFFU, 0xFFDF0F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x9FFFFFFFU, 0xFFFFFFFEU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -964,7 +964,7 @@ u_is_graph = 0xFFFFFFBFU, 0x07FDFFFFU, 0x00000000U, 0x00000000U, 0xFFFFFD3FU, 0x91BFFFFFU, 0xFFBFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU, 0x0000FF80U, 0x00000000U, 0xF837FFFFU, - 0x8FFFFFFFU, 0x83FFFFFFU, 0x00000000U, 0x00000000U, + 0x8FFFFFFFU, 0x83FFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xF0FFFFFFU, 0xFFFCFFFFU, 0xFFFFFFFFU, 0xFEEFF06FU, 0x873FFFFFU, 0x01FF01FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0x007FF87FU, @@ -975,7 +975,7 @@ u_is_graph = 0xFFFFFFFFU, 0x03FF00FFU, 0xFFFFFFFFU, 0xFFFFFE3FU, 0x0000C03FU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFFFFFFU, - 0xFFFFFFFFU, 0x00033BFFU, 0x0000001CU, 0xF0000000U, + 0xFFFFFFFFU, 0x00033BFFU, 0x01FF00FCU, 0xFC000000U, 0xFFFFFFFFU, 0xFFFF00FFU, 0x03FFFFFFU, 0xFFFF0000U, 0x000003FFU, 0xFFFF0000U, 0x00000FFFU, 0x007FFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFC3FFFU, 0x803FFFFFU, @@ -1000,12 +1000,12 @@ u_is_graph = 0x00000000U, 0xFFFFFCFFU, 0xFCFFFFFFU, 0x0000001FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF00FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0007U, 0xFFFFFFFFU, 0x01FFFFFFU, - 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0x000003FFU, 0x00000000U, 0x00000000U, 0x000000FFU, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FF0003U, 0xFFFFFDFFU, 0xFF7FFFFFU, 0xFFFF003FU, 0xFFFF1FFFU, 0xFFFCFFFFU, 0x007FFEFFU, 0x00000000U, 0x00000000U, 0xFFFFFB7FU, 0xB47FFFFFU, 0x03FF00FFU, 0xFFFFFDBFU, - 0x01FB7FFFU, 0x000003FFU, 0x00000000U, 0x00000000U, + 0x01FB7FFFU, 0xFFFF03FFU, 0x0FFFFFFFU, 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x01FFFFFFU, 0xFFFDFFFFU, 0xC7FFFFFFU, 0x07FFFFFFU, 0x00000000U, @@ -1047,17 +1047,13 @@ u_is_graph = 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0x07FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0x07FFFFFFU, 0xF9FFFFFFU, 0x000FFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF87FFU, 0xFFFFFFFFU, - 0xFFFF80FFU, 0x00000000U, 0x00000000U, 0x0003001FU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, + 0xFFFF80FFU, 0x00000000U, 0x00000000U, 0x007F001FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x80000000U, - 0x000001FFU, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0007FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -1075,11 +1071,11 @@ u_is_graph = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x000FFFFFU, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFC0FFFFFU, 0x0001FFFFU, 0x0001FFFFU, 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFF007FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000000FU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1119,7 +1115,7 @@ u_is_graph = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFF0000U, 0x87FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x7FFFFFFFU, 0xC03FFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFF6F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1143,31 +1139,27 @@ u_is_graph = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF0FFFFFFU, 0x1FFF1FFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF87FFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF1FFFFFFU, 0x1FFF1FFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00010FFFU, 0xFFFF0FFFU, 0xFFFFFFFFU, 0x03FF00FFU, 0xFFFFFFFFU, - 0xFFFF00FFU, 0x0FFF3FFFU, 0x00000003U, 0x00000000U, + 0xFFFF00FFU, 0x0FFF3FFFU, 0x01FF0003U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU, 0x1FFF3FFFU, - 0xFFFF83FFU, 0xFFFFFFFFU, 0x9FFFC07FU, 0x01FF03FFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0x1FFF3FFFU, + 0xFFFFC7FFU, 0xFFFFFFFFU, 0x9FFFE17FU, 0x01FF87FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x07FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFF0003U, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1186,10 +1178,10 @@ u_is_graph = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF07FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x0000FFFFU, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000002U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, diff --git a/gl/unictype/ctype_lower.c b/gl/unictype/ctype_lower.c index 99a05e09..b113106f 100644 --- a/gl/unictype/ctype_lower.c +++ b/gl/unictype/ctype_lower.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_lower.h b/gl/unictype/ctype_lower.h index cbf7d26d..aae2e4cc 100644 --- a/gl/unictype/ctype_lower.h +++ b/gl/unictype/ctype_lower.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -338,7 +338,7 @@ u_is_lower = 0x00000000U, 0x00000000U, 0xAAAAAAAAU, 0x00002AAAU, 0x0AAAAAAAU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xAAA8AAA8U, 0xAAAAAAAAU, 0x9400AAAAU, - 0xAA9A10AAU, 0xAAA002AAU, 0x0A82250AU, 0x00400000U, + 0xAA9A10AAU, 0xAAA002AAU, 0x0AAAA50AU, 0x00400000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00080000U, 0xFFFF0000U, @@ -360,7 +360,7 @@ u_is_lower = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0xF8000000U, 0x000FFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, diff --git a/gl/unictype/ctype_print.c b/gl/unictype/ctype_print.c index 0197d496..f689b0ad 100644 --- a/gl/unictype/ctype_print.c +++ b/gl/unictype/ctype_print.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_print.h b/gl/unictype/ctype_print.h index b7007828..e2c34597 100644 --- a/gl/unictype/ctype_print.h +++ b/gl/unictype/ctype_print.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct int header[1]; int level1[17]; short level2[6 << 7]; - unsigned int level3[94 << 4]; + unsigned int level3[92 << 4]; } u_is_print = { @@ -247,10 +247,10 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 912, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 928, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 912, -1, -1, -1, @@ -267,14 +267,14 @@ u_is_print = -1, -1, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 928, 18 + 768 * sizeof (short) / sizeof (int) + 944, 18 + 768 * sizeof (short) / sizeof (int) + 960, - 18 + 768 * sizeof (short) / sizeof (int) + 976, -1, -1, -1, -1, - 18 + 768 * sizeof (short) / sizeof (int) + 992, + 18 + 768 * sizeof (short) / sizeof (int) + 976, -1, -1, -1, @@ -282,30 +282,30 @@ u_is_print = -1, -1, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 992, 18 + 768 * sizeof (short) / sizeof (int) + 1008, 18 + 768 * sizeof (short) / sizeof (int) + 1024, 18 + 768 * sizeof (short) / sizeof (int) + 1040, 18 + 768 * sizeof (short) / sizeof (int) + 1056, 18 + 768 * sizeof (short) / sizeof (int) + 1072, - 18 + 768 * sizeof (short) / sizeof (int) + 1088, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1104, + 18 + 768 * sizeof (short) / sizeof (int) + 1088, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 1104, 18 + 768 * sizeof (short) / sizeof (int) + 1120, 18 + 768 * sizeof (short) / sizeof (int) + 1136, 18 + 768 * sizeof (short) / sizeof (int) + 1152, 18 + 768 * sizeof (short) / sizeof (int) + 1168, 18 + 768 * sizeof (short) / sizeof (int) + 1184, - 18 + 768 * sizeof (short) / sizeof (int) + 1200, -1, + 18 + 768 * sizeof (short) / sizeof (int) + 1200, 18 + 768 * sizeof (short) / sizeof (int) + 1216, 18 + 768 * sizeof (short) / sizeof (int) + 1232, 18 + 768 * sizeof (short) / sizeof (int) + 1248, - 18 + 768 * sizeof (short) / sizeof (int) + 1264, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1264, 18 + 768 * sizeof (short) / sizeof (int) + 1280, 18 + 768 * sizeof (short) / sizeof (int) + 1296, - 18 + 768 * sizeof (short) / sizeof (int) + 1312, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -391,7 +391,7 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1328, + 18 + 768 * sizeof (short) / sizeof (int) + 1312, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -399,9 +399,8 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1344, - 18 + 768 * sizeof (short) / sizeof (int) + 1360, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1328, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -411,8 +410,8 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1376, 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1344, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -425,15 +424,16 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1392, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1408, + 18 + 768 * sizeof (short) / sizeof (int) + 1360, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1376, -1, -1, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1424, + 18 + 768 * sizeof (short) / sizeof (int) + 1392, -1, -1, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -445,7 +445,7 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1440, + 18 + 768 * sizeof (short) / sizeof (int) + 1408, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, @@ -453,16 +453,16 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1456, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 160, + 18 + 768 * sizeof (short) / sizeof (int) + 1424, -1, -1, -1, @@ -564,7 +564,7 @@ u_is_print = -1, -1, -1, - 18 + 768 * sizeof (short) / sizeof (int) + 1472, + 18 + 768 * sizeof (short) / sizeof (int) + 1440, -1, -1, -1, @@ -819,7 +819,7 @@ u_is_print = 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, 18 + 768 * sizeof (short) / sizeof (int) + 160, - 18 + 768 * sizeof (short) / sizeof (int) + 1488 + 18 + 768 * sizeof (short) / sizeof (int) + 1456 }, { 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU, @@ -839,15 +839,15 @@ u_is_print = 0xFFFFBFFFU, 0xFFFFFFFFU, 0xFFFFE7FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0003FFFFU, 0xFFFFFFFFU, 0xE7FFFFFFU, 0xFFFFFFFFU, 0x7FFF3FFFU, 0x4FFFFFFFU, 0xFFFF07FFU, - 0xFF837FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFF83FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFF99FEFU, 0xF3C5FDFFU, 0xB080799FU, 0x7FFFFFCFU, 0xFFF987EEU, 0xD36DFDFFU, 0x5E023987U, 0x007FFFC0U, 0xFFFBBFEEU, 0xF3EDFDFFU, 0x00013BBFU, 0xFE03FFCFU, 0xFFF99FEEU, 0xF3EDFDFFU, 0xB0E0399FU, 0x00FFFFCFU, 0xD63DC7ECU, 0xC3FFC718U, 0x00813DC7U, 0x07FFFFC0U, - 0xFFFDDFFFU, 0xF3FFFDFFU, 0x27603DDFU, 0xFF80FFCFU, - 0xFFFDDFFFU, 0xF3EFFDFFU, 0x60603DDFU, 0x000EFFCFU, + 0xFFFDDFFFU, 0xF3FFFDFFU, 0x37603DDFU, 0xFF80FFCFU, + 0xFFFDDFFFU, 0xF3EFFDFFU, 0x70603DDFU, 0x000EFFCFU, 0xFFFDDFFFU, 0xFFFFFFFFU, 0xFFF0FDDFU, 0xFFFFFFCFU, 0xFC7FFFEEU, 0x2FFBFFFFU, 0xFF5F847FU, 0x001CFFC0U, 0xFFFFFFFEU, 0x87FFFFFFU, 0x0FFFFFFFU, 0x00000000U, @@ -875,7 +875,7 @@ u_is_print = 0x7FFFFFFFU, 0x0FFF0FFFU, 0xFFFFFFF1U, 0x001F3FFFU, 0xFFFFFFFFU, 0xFFFF0FFFU, 0xC7FF03FFU, 0xFFFFFFFFU, 0xCFFFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU, 0x9FFFFFFFU, - 0x03FF03FFU, 0xFFFF3FFFU, 0x00007FFFU, 0x00000000U, + 0x03FF03FFU, 0xFFFF3FFFU, 0x3FFFFFFFU, 0x00000FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFDFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF00FFFFFU, 0xFFFFFFFFU, 0xF8FFFFFFU, 0xFFFFE3FFU, 0xFFFFFFFFU, @@ -887,7 +887,7 @@ u_is_print = 0x3F3FFFFFU, 0xFFFFFFFFU, 0xAAFF3F3FU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFDFFFFFU, 0xEFCFFFDFU, 0x7FDCFFFFU, 0xFFFFFFFFU, 0xFFFFFCFFU, 0xFFFFFFFFU, 0xFFF3FFDFU, - 0x1FFF7FFFU, 0xFFFFFFFFU, 0xFFFF0001U, 0x0001FFFFU, + 0x1FFF7FFFU, 0xFFFFFFFFU, 0xFFFF0003U, 0x0001FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000003FFU, 0x000007FFU, 0xFFFFFFFFU, @@ -897,7 +897,7 @@ u_is_print = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFCFFFFFU, - 0xFFBFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFE0FFFFFU, 0xFFFFFFFFU, 0xFFFF20BFU, 0xFFFFFFFFU, 0x800180FFU, @@ -921,7 +921,7 @@ u_is_print = 0xFFFFFFFFU, 0x00000FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FEB3FFFU, 0xFFFC0000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFE0000U, 0xFFFFFFFFU, 0x03FF1FFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFC03FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x800FFFFFU, 0x1FFFFFFFU, @@ -937,11 +937,11 @@ u_is_print = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xE0F8007FU, 0x5F7FFFFFU, 0xFFFFFFDBU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFF80007U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFCFFFFU, 0xFFFFFFFFU, 0x000080FFU, 0xFFFF0000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000FFFFU, 0xFFFF0000U, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFF7FFFFU, 0xFFDF0F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x9FFFFFFFU, 0xFFFFFFFEU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -964,7 +964,7 @@ u_is_print = 0xFFFFFFBFU, 0x07FDFFFFU, 0x00000000U, 0x00000000U, 0xFFFFFD3FU, 0x91BFFFFFU, 0xFFBFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU, 0x0000FF80U, 0x00000000U, 0xF837FFFFU, - 0x8FFFFFFFU, 0x83FFFFFFU, 0x00000000U, 0x00000000U, + 0x8FFFFFFFU, 0x83FFFFFFU, 0x03FFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xF0FFFFFFU, 0xFFFCFFFFU, 0xFFFFFFFFU, 0xFEEFF06FU, 0x873FFFFFU, 0x01FF01FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0x007FF87FU, @@ -975,7 +975,7 @@ u_is_print = 0xFFFFFFFFU, 0x03FF00FFU, 0xFFFFFFFFU, 0xFFFFFE3FU, 0x0000C03FU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFFFFFFU, - 0xFFFFFFFFU, 0x00033BFFU, 0x0000001CU, 0xF0000000U, + 0xFFFFFFFFU, 0x00033BFFU, 0x01FF00FCU, 0xFC000000U, 0xFFFFFFFFU, 0xFFFF00FFU, 0x03FFFFFFU, 0xFFFF0000U, 0x000003FFU, 0xFFFF0000U, 0x00000FFFU, 0x007FFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFC3FFFU, 0x803FFFFFU, @@ -1000,12 +1000,12 @@ u_is_print = 0x00000000U, 0xFFFFFCFFU, 0xFCFFFFFFU, 0x0000001FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF00FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF0007U, 0xFFFFFFFFU, 0x01FFFFFFU, - 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0x000003FFU, 0x00000000U, 0x00000000U, 0x000000FFU, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FF0003U, 0xFFFFFDFFU, 0xFF7FFFFFU, 0xFFFF003FU, 0xFFFF1FFFU, 0xFFFCFFFFU, 0x007FFEFFU, 0x00000000U, 0x00000000U, 0xFFFFFB7FU, 0xB47FFFFFU, 0x03FF00FFU, 0xFFFFFDBFU, - 0x01FB7FFFU, 0x000003FFU, 0x00000000U, 0x00000000U, + 0x01FB7FFFU, 0xFFFF03FFU, 0x0FFFFFFFU, 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x01FFFFFFU, 0xFFFDFFFFU, 0xC7FFFFFFU, 0x07FFFFFFU, 0x00000000U, @@ -1047,17 +1047,13 @@ u_is_print = 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0x07FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0x07FFFFFFU, 0xF9FFFFFFU, 0x000FFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF87FFU, 0xFFFFFFFFU, - 0xFFFF80FFU, 0x00000000U, 0x00000000U, 0x0003001FU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, + 0xFFFF80FFU, 0x00000000U, 0x00000000U, 0x007F001FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x80000000U, - 0x000001FFU, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x7FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0007FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -1075,11 +1071,11 @@ u_is_print = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x000FFFFFU, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFC0FFFFFU, 0x0001FFFFU, 0x0001FFFFU, 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFF007FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000000FU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1119,7 +1115,7 @@ u_is_print = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFF0000U, 0x87FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x7FFFFFFFU, 0xC03FFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFF6F7FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1143,31 +1139,27 @@ u_is_print = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF0FFFFFFU, 0x1FFF1FFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF87FFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF1FFFFFFU, 0x1FFF1FFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00010FFFU, 0xFFFF0FFFU, 0xFFFFFFFFU, 0x03FF00FFU, 0xFFFFFFFFU, - 0xFFFF00FFU, 0x0FFF3FFFU, 0x00000003U, 0x00000000U, + 0xFFFF00FFU, 0x0FFF3FFFU, 0x01FF0003U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU, 0x1FFF3FFFU, - 0xFFFF83FFU, 0xFFFFFFFFU, 0x9FFFC07FU, 0x01FF03FFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0x1FFF3FFFU, + 0xFFFFC7FFU, 0xFFFFFFFFU, 0x9FFFE17FU, 0x01FF87FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x07FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFF0003U, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -1186,10 +1178,10 @@ u_is_print = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFF07FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x0000FFFFU, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000002U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, diff --git a/gl/unictype/ctype_punct.c b/gl/unictype/ctype_punct.c index f2d647de..3c30ba70 100644 --- a/gl/unictype/ctype_punct.c +++ b/gl/unictype/ctype_punct.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_punct.h b/gl/unictype/ctype_punct.h index cb252114..28fc905e 100644 --- a/gl/unictype/ctype_punct.h +++ b/gl/unictype/ctype_punct.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,7 +27,7 @@ struct int header[1]; int level1[17]; short level2[4 << 7]; - unsigned int level3[75 << 4]; + unsigned int level3[76 << 4]; } u_is_punct = { @@ -295,20 +295,20 @@ u_is_punct = 18 + 512 * sizeof (short) / sizeof (int) + 992, 18 + 512 * sizeof (short) / sizeof (int) + 1008, 18 + 512 * sizeof (short) / sizeof (int) + 1024, - -1, 18 + 512 * sizeof (short) / sizeof (int) + 1040, - -1, 18 + 512 * sizeof (short) / sizeof (int) + 1056, + -1, 18 + 512 * sizeof (short) / sizeof (int) + 1072, 18 + 512 * sizeof (short) / sizeof (int) + 1088, 18 + 512 * sizeof (short) / sizeof (int) + 1104, - 18 + 512 * sizeof (short) / sizeof (int) + 272, 18 + 512 * sizeof (short) / sizeof (int) + 1120, + 18 + 512 * sizeof (short) / sizeof (int) + 272, 18 + 512 * sizeof (short) / sizeof (int) + 1136, 18 + 512 * sizeof (short) / sizeof (int) + 1152, + 18 + 512 * sizeof (short) / sizeof (int) + 1168, -1, -1, - 18 + 512 * sizeof (short) / sizeof (int) + 1168, + 18 + 512 * sizeof (short) / sizeof (int) + 1184, -1, -1, -1, @@ -563,7 +563,7 @@ u_is_punct = 18 + 512 * sizeof (short) / sizeof (int) + 272, 18 + 512 * sizeof (short) / sizeof (int) + 272, 18 + 512 * sizeof (short) / sizeof (int) + 272, - 18 + 512 * sizeof (short) / sizeof (int) + 1184 + 18 + 512 * sizeof (short) / sizeof (int) + 1200 }, { 0x00000000U, 0xFC00FFFEU, 0xF8000001U, 0x78000001U, @@ -619,7 +619,7 @@ u_is_punct = 0x00000000U, 0x0FFF0FFFU, 0x00000031U, 0x00000000U, 0x00000000U, 0x00000000U, 0xC4000000U, 0xFFFFFFFFU, 0xCF800000U, 0x00000000U, 0x7FE00000U, 0x9FFFFFFFU, - 0x00000000U, 0xFFFF3F7FU, 0x00007FFFU, 0x00000000U, + 0x00000000U, 0xFFFF3F7FU, 0x3FFFFFFFU, 0x00000FFFU, 0x0000001FU, 0xFFF00000U, 0xFC00C01FU, 0xFFFFFFFFU, 0x00000007U, 0x00003FFEU, 0x00000000U, 0xF00FFFC0U, 0x00000000U, 0xF8FFFFF0U, 0x00000000U, 0xC0000000U, @@ -631,7 +631,7 @@ u_is_punct = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xA0000000U, 0xE000E003U, 0x6000E000U, 0xFFFFF880U, 0xFFFFFCFFU, 0x7FFFFFFFU, 0x7FF1FFDFU, - 0x00007FFFU, 0xFFFFFFFFU, 0xFFFF0001U, 0x0001FFFFU, + 0x00007FFFU, 0xFFFFFFFFU, 0xFFFF0003U, 0x0001FFFFU, 0xC1D0037BU, 0x0C0040AFU, 0xFFFFBC1FU, 0x00000000U, 0xFFFF0E00U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -645,7 +645,7 @@ u_is_punct = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFCFFFFFU, - 0xFFBFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFE0387E0U, 0x00000000U, 0x00000000U, 0x00000000U, 0x80010000U, @@ -689,11 +689,11 @@ u_is_punct = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x40000000U, 0x00000200U, 0x00000000U, 0x00000000U, - 0x00000000U, 0xFFFC0000U, 0x00000007U, 0x00000000U, + 0x00000000U, 0xFFFC0000U, 0x0007FFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xC0000000U, 0x0000FFFFU, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00008000U, 0xF0000000U, + 0x00030000U, 0x00000000U, 0x0000FF00U, 0xF0000000U, 0x03FFFFFFU, 0xFFFFFFFFU, 0xFFF7FFFFU, 0x00000F7FU, 0x00000000U, 0x00000000U, 0x00000000U, 0x80000000U, 0xFC00FFFEU, 0xF8000001U, 0xF8000001U, 0x0000003FU, @@ -723,7 +723,7 @@ u_is_punct = 0x00000000U, 0x000000F0U, 0x00000000U, 0x00007E00U, 0x0000C000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x7FFFFFFFU, - 0x00000000U, 0x00003800U, 0x00000000U, 0xF0000000U, + 0x00000000U, 0x00003800U, 0x01FF0000U, 0xFC000000U, 0xE0000000U, 0x0000007FU, 0x03FFFFC0U, 0x00000000U, 0x000003FCU, 0x00000000U, 0x00000FE0U, 0x00000000U, 0x00000007U, 0xFF000000U, 0xFFFC3FFFU, 0x8019003FU, @@ -748,7 +748,7 @@ u_is_punct = 0x00000000U, 0x00000000U, 0xFCFE0000U, 0x00000015U, 0x000007FEU, 0xFBF80000U, 0x0FFE00FFU, 0x00000000U, 0xDFFFFC00U, 0x00000007U, 0x00000000U, 0x00000000U, - 0x000003FFU, 0x00000000U, 0x00000000U, 0x00000000U, + 0x000003FFU, 0x00000000U, 0x00000000U, 0x000000FFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000002U, 0x00000000U, 0xFF7F8000U, 0xFC00003EU, 0x00031FFFU, 0xFFFC0000U, 0x007FFEFFU, 0x00000000U, 0x00000000U, @@ -791,11 +791,11 @@ u_is_punct = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x00000000U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x003FFFFFU, 0x1C000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0x000FFFFFU, 0x00000000U, 0x00000000U, + 0xFFFFFFFFU, 0xFC0FFFFFU, 0x0001FFFFU, 0x0001FFFFU, 0xFFFFFFFFU, 0xFFFF3FFFU, 0xFFFF007FU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000000FU, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -827,6 +827,10 @@ u_is_punct = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x8000C000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x0020C048U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x007FFF80U, 0x00000000U, 0x00000000U, 0x00000000U, 0xC00007F0U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -847,17 +851,17 @@ u_is_punct = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF0FFFFFFU, 0x1FFF1FFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF87FFFFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF1FFFFFFU, 0x1FFF1FFFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x03FFFFFFU, 0x00010FFFU, 0xFFFF0FFFU, 0xFFFFFFFFU, 0x03FF00FFU, 0xFFFFFFFFU, - 0xFFFF00FFU, 0x0FFF3FFFU, 0x00000003U, 0x00000000U, + 0xFFFF00FFU, 0x0FFF3FFFU, 0x01FF0003U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFFFFFFU, 0xFFFFFFFFU, 0x000FFFFFU, 0x1FFF3FFFU, - 0xFFFF83FFU, 0xFFFFFFFFU, 0x9FFFC07FU, 0x01FF03FFU, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00FFFFFFU, 0x1FFF3FFFU, + 0xFFFFC7FFU, 0xFFFFFFFFU, 0x9FFFE17FU, 0x01FF87FFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0000FFFFU, + 0xFFF7FFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x0400FFFFU, 0x00000002U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, diff --git a/gl/unictype/ctype_space.c b/gl/unictype/ctype_space.c index 4c032398..ee9ce3fd 100644 --- a/gl/unictype/ctype_space.c +++ b/gl/unictype/ctype_space.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_space.h b/gl/unictype/ctype_space.h index 93ed2467..1a72bd6d 100644 --- a/gl/unictype/ctype_space.h +++ b/gl/unictype/ctype_space.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unictype/ctype_upper.c b/gl/unictype/ctype_upper.c index af2c3fe6..31210804 100644 --- a/gl/unictype/ctype_upper.c +++ b/gl/unictype/ctype_upper.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_upper.h b/gl/unictype/ctype_upper.h index ef527809..f0773306 100644 --- a/gl/unictype/ctype_upper.h +++ b/gl/unictype/ctype_upper.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -338,7 +338,7 @@ u_is_upper = 0x00000000U, 0x00000000U, 0x55555555U, 0x00001555U, 0x05555555U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x55545554U, 0x55555555U, 0x6A005555U, - 0x55452855U, 0x555F7D55U, 0x15411AF5U, 0x00200000U, + 0x55452855U, 0x555F7D55U, 0x15555AF5U, 0x00200000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x07FFFFFEU, 0x00000000U, 0x00000000U, @@ -356,7 +356,7 @@ u_is_upper = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x01FFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, diff --git a/gl/unictype/ctype_xdigit.c b/gl/unictype/ctype_xdigit.c index ee4b2ea4..bea31a1b 100644 --- a/gl/unictype/ctype_xdigit.c +++ b/gl/unictype/ctype_xdigit.c @@ -1,5 +1,5 @@ /* ISO C like properties of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/unictype/ctype_xdigit.h b/gl/unictype/ctype_xdigit.h index c0b2ac05..508c3ed7 100644 --- a/gl/unictype/ctype_xdigit.h +++ b/gl/unictype/ctype_xdigit.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* ISO C like properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/uninorm.h b/gl/uninorm.h deleted file mode 100644 index f6815c49..00000000 --- a/gl/uninorm.h +++ /dev/null @@ -1,256 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Normalization forms (composition and decomposition) of Unicode strings. - Copyright (C) 2001-2002, 2009-2025 Free Software Foundation, Inc. - Written by Bruno Haible , 2009. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _UNINORM_H -#define _UNINORM_H - -/* Get size_t. */ -#include - -#include "unitypes.h" - -#if 0 -# include -#else -# define LIBUNISTRING_DLL_VARIABLE -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Conventions: - - All functions prefixed with u8_ operate on UTF-8 encoded strings. - Their unit is an uint8_t (1 byte). - - All functions prefixed with u16_ operate on UTF-16 encoded strings. - Their unit is an uint16_t (a 2-byte word). - - All functions prefixed with u32_ operate on UCS-4 encoded strings. - Their unit is an uint32_t (a 4-byte word). - - All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly - n units. - - Functions returning a string result take a (resultbuf, lengthp) argument - pair. If resultbuf is not NULL and the result fits into *lengthp units, - it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly - allocated string is returned. In both cases, *lengthp is set to the - length (number of units) of the returned string. In case of error, - NULL is returned and errno is set. */ - - -enum -{ - UC_DECOMP_CANONICAL,/* Canonical decomposition. */ - UC_DECOMP_FONT, /* A font variant (e.g. a blackletter form). */ - UC_DECOMP_NOBREAK, /* A no-break version of a space or hyphen. */ - UC_DECOMP_INITIAL, /* An initial presentation form (Arabic). */ - UC_DECOMP_MEDIAL, /* A medial presentation form (Arabic). */ - UC_DECOMP_FINAL, /* A final presentation form (Arabic). */ - UC_DECOMP_ISOLATED,/* An isolated presentation form (Arabic). */ - UC_DECOMP_CIRCLE, /* An encircled form. */ - UC_DECOMP_SUPER, /* A superscript form. */ - UC_DECOMP_SUB, /* A subscript form. */ - UC_DECOMP_VERTICAL,/* A vertical layout presentation form. */ - UC_DECOMP_WIDE, /* A wide (or zenkaku) compatibility character. */ - UC_DECOMP_NARROW, /* A narrow (or hankaku) compatibility character. */ - UC_DECOMP_SMALL, /* A small variant form (CNS compatibility). */ - UC_DECOMP_SQUARE, /* A CJK squared font variant. */ - UC_DECOMP_FRACTION,/* A vulgar fraction form. */ - UC_DECOMP_COMPAT /* Otherwise unspecified compatibility character. */ -}; - -/* Maximum size of decomposition of a single Unicode character. */ -#define UC_DECOMPOSITION_MAX_LENGTH 32 - -/* Return the character decomposition mapping of a Unicode character. - DECOMPOSITION must point to an array of at least UC_DECOMPOSITION_MAX_LENGTH - ucs_t elements. - When a decomposition exists, DECOMPOSITION[0..N-1] and *DECOMP_TAG are - filled and N is returned. Otherwise -1 is returned. */ -extern int - uc_decomposition (ucs4_t uc, int *decomp_tag, ucs4_t *decomposition); - -/* Return the canonical character decomposition mapping of a Unicode character. - DECOMPOSITION must point to an array of at least UC_DECOMPOSITION_MAX_LENGTH - ucs_t elements. - When a decomposition exists, DECOMPOSITION[0..N-1] is filled and N is - returned. Otherwise -1 is returned. */ -extern int - uc_canonical_decomposition (ucs4_t uc, ucs4_t *decomposition); - - -/* Attempt to combine the Unicode characters uc1, uc2. - uc1 is known to have canonical combining class 0. - Return the combination of uc1 and uc2, if it exists. - Return 0 otherwise. - Not all decompositions can be recombined using this function. See the - Unicode file CompositionExclusions.txt for details. */ -extern ucs4_t - uc_composition (ucs4_t uc1, ucs4_t uc2) - _UC_ATTRIBUTE_CONST; - - -/* An object of type uninorm_t denotes a Unicode normalization form. */ -struct unicode_normalization_form; -typedef const struct unicode_normalization_form *uninorm_t; - -/* UNINORM_NFD: Normalization form D: canonical decomposition. */ -extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form uninorm_nfd; -#define UNINORM_NFD (&uninorm_nfd) - -/* UNINORM_NFC: Normalization form C: canonical decomposition, then - canonical composition. */ -extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form uninorm_nfc; -#define UNINORM_NFC (&uninorm_nfc) - -/* UNINORM_NFKD: Normalization form KD: compatibility decomposition. */ -extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form uninorm_nfkd; -#define UNINORM_NFKD (&uninorm_nfkd) - -/* UNINORM_NFKC: Normalization form KC: compatibility decomposition, then - canonical composition. */ -extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form uninorm_nfkc; -#define UNINORM_NFKC (&uninorm_nfkc) - -/* Test whether a normalization form does compatibility decomposition. */ -#define uninorm_is_compat_decomposing(nf) \ - ((* (const unsigned int *) (nf) >> 0) & 1) - -/* Test whether a normalization form includes canonical composition. */ -#define uninorm_is_composing(nf) \ - ((* (const unsigned int *) (nf) >> 1) & 1) - -/* Return the decomposing variant of a normalization form. - This maps NFC,NFD -> NFD and NFKC,NFKD -> NFKD. */ -extern uninorm_t - uninorm_decomposing_form (uninorm_t nf) - _UC_ATTRIBUTE_PURE; - - -/* Return the specified normalization form of a string. */ -extern uint8_t * - u8_normalize (uninorm_t nf, const uint8_t *s, size_t n, - uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint16_t * - u16_normalize (uninorm_t nf, const uint16_t *s, size_t n, - uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp); -extern uint32_t * - u32_normalize (uninorm_t nf, const uint32_t *s, size_t n, - uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp); - - -/* Compare S1 and S2, ignoring differences in normalization. - NF must be either UNINORM_NFD or UNINORM_NFKD. - If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and - return 0. Upon failure, return -1 with errno set. */ -extern int - u8_normcmp (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2, - uninorm_t nf, int *resultp); -extern int - u16_normcmp (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2, - uninorm_t nf, int *resultp); -extern int - u32_normcmp (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2, - uninorm_t nf, int *resultp); - - -/* Converts the string S of length N to a NUL-terminated byte sequence, in such - a way that comparing uN_normxfrm (S1) and uN_normxfrm (S2) with uN_cmp2() is - equivalent to comparing S1 and S2 with uN_normcoll(). - NF must be either UNINORM_NFC or UNINORM_NFKC. */ -extern char * - u8_normxfrm (const uint8_t *s, size_t n, uninorm_t nf, - char *resultbuf, size_t *lengthp); -extern char * - u16_normxfrm (const uint16_t *s, size_t n, uninorm_t nf, - char *resultbuf, size_t *lengthp); -extern char * - u32_normxfrm (const uint32_t *s, size_t n, uninorm_t nf, - char *resultbuf, size_t *lengthp); - - -/* Compare S1 and S2, ignoring differences in normalization, using the - collation rules of the current locale. - NF must be either UNINORM_NFC or UNINORM_NFKC. - If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and - return 0. Upon failure, return -1 with errno set. */ -extern int - u8_normcoll (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2, - uninorm_t nf, int *resultp); -extern int - u16_normcoll (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2, - uninorm_t nf, int *resultp); -extern int - u32_normcoll (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2, - uninorm_t nf, int *resultp); - - -/* Normalization of a stream of Unicode characters. - - A "stream of Unicode characters" is essentially a function that accepts an - ucs4_t argument repeatedly, optionally combined with a function that - "flushes" the stream. */ - -/* Data type of a stream of Unicode characters that normalizes its input - according to a given normalization form and passes the normalized character - sequence to the encapsulated stream of Unicode characters. */ -struct uninorm_filter; - -/* Bring data buffered in the filter to its destination, the encapsulated - stream, then close and free the filter. - Return 0 if successful, or -1 with errno set upon failure. */ -extern int - uninorm_filter_free (struct uninorm_filter *filter); - -/* Create and return a normalization filter for Unicode characters. - The pair (stream_func, stream_data) is the encapsulated stream. - stream_func (stream_data, uc) receives the Unicode character uc - and returns 0 if successful, or -1 with errno set upon failure. - Return the new filter, or NULL with errno set upon failure. */ -extern struct uninorm_filter * - uninorm_filter_create (uninorm_t nf, - int (*stream_func) (void *stream_data, ucs4_t uc), - void *stream_data) - _GL_ATTRIBUTE_DEALLOC (uninorm_filter_free, 1); - -/* Stuff a Unicode character into a normalizing filter. - Return 0 if successful, or -1 with errno set upon failure. */ -extern int - uninorm_filter_write (struct uninorm_filter *filter, ucs4_t uc); - -/* Bring data buffered in the filter to its destination, the encapsulated - stream. - Return 0 if successful, or -1 with errno set upon failure. - Note! If after calling this function, additional characters are written - into the filter, the resulting character sequence in the encapsulated stream - will not necessarily be normalized. */ -extern int - uninorm_filter_flush (struct uninorm_filter *filter); - - -#ifdef __cplusplus -} -#endif - - -#endif /* _UNINORM_H */ diff --git a/gl/uninorm.in.h b/gl/uninorm.in.h index 76ab32b6..8d84f78a 100644 --- a/gl/uninorm.in.h +++ b/gl/uninorm.in.h @@ -1,5 +1,5 @@ /* Normalization forms (composition and decomposition) of Unicode strings. - Copyright (C) 2001-2002, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This file is free software: you can redistribute it and/or modify diff --git a/gl/unistd.c b/gl/unistd.c index e6625589..414dce9a 100644 --- a/gl/unistd.c +++ b/gl/unistd.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unistd.in.h b/gl/unistd.in.h index 9f057d30..f7e4450c 100644 --- a/gl/unistd.in.h +++ b/gl/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2025 Free Software Foundation, Inc. + Copyright (C) 2003-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -104,15 +104,12 @@ # include #endif -/* FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, Solaris 11.4, and glibc 2.41 - do not define O_CLOEXEC in . */ /* Cygwin 1.7.1 and Android 4.3 declare unlinkat in , not in . */ /* But avoid namespace pollution on glibc systems. */ -#if ! defined O_CLOEXEC \ - || ((@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ - && (defined __CYGWIN__ || defined __ANDROID__) \ - && ! defined __GLIBC__) +#if ((@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ + && (defined __CYGWIN__ || defined __ANDROID__) \ + && ! defined __GLIBC__) # include #endif @@ -120,10 +117,8 @@ /* mingw, MSVC, BeOS, Haiku declare environ in , not in . */ /* Solaris declares getcwd not only in but also in . */ -/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system is - included here. */ /* But avoid namespace pollution on glibc systems. */ -#if !defined __GLIBC__ && !defined __osf__ +#if !defined __GLIBC__ # define __need_system_stdlib_h # include # undef __need_system_stdlib_h @@ -134,10 +129,10 @@ # include #endif -/* AIX and OSF/1 5.1 declare getdomainname in , not in . +/* AIX declares getdomainname in , not in . NonStop Kernel declares gethostname in , not in . */ /* But avoid namespace pollution on glibc systems. */ -#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \ +#if ((@GNULIB_GETDOMAINNAME@ && defined _AIX) \ || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \ && !defined __GLIBC__ # include @@ -307,7 +302,6 @@ _GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); # endif _GL_CXXALIASWARN (access); #elif defined GNULIB_POSIXCHECK -# undef access # if HAVE_RAW_DECL_ACCESS /* The access() function is a security risk. */ _GL_WARN_ON_USE (access, "access does not always support X_OK - " @@ -344,7 +338,6 @@ _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIASWARN (chdir); #elif defined GNULIB_POSIXCHECK -# undef chdir # if HAVE_RAW_DECL_CHDIR _GL_WARN_ON_USE (chdir, "chdir is not always in - " "use gnulib module chdir for portability"); @@ -389,7 +382,6 @@ _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); # endif _GL_CXXALIASWARN (chown); #elif defined GNULIB_POSIXCHECK -# undef chown # if HAVE_RAW_DECL_CHOWN _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " "doesn't treat a uid or gid of -1 on some systems - " @@ -423,7 +415,6 @@ _GL_CXXALIASWARN (close); # define close close_used_without_requesting_gnulib_module_close # endif #elif defined GNULIB_POSIXCHECK -# undef close /* Assume close is always declared. */ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " "use gnulib module close for portability"); @@ -470,7 +461,6 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, _GL_CXXALIASWARN (copy_file_range); # endif #elif defined GNULIB_POSIXCHECK -# undef copy_file_range # if HAVE_RAW_DECL_COPY_FILE_RANGE _GL_WARN_ON_USE (copy_file_range, "copy_file_range is unportable - " @@ -497,7 +487,6 @@ _GL_CXXALIAS_SYS (dup, int, (int oldfd)); # endif _GL_CXXALIASWARN (dup); #elif defined GNULIB_POSIXCHECK -# undef dup # if HAVE_RAW_DECL_DUP _GL_WARN_ON_USE (dup, "dup is unportable - " "use gnulib module dup for portability"); @@ -542,7 +531,6 @@ _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); # endif _GL_CXXALIASWARN (dup2); #elif defined GNULIB_POSIXCHECK -# undef dup2 # if HAVE_RAW_DECL_DUP2 _GL_WARN_ON_USE (dup2, "dup2 is unportable - " "use gnulib module dup2 for portability"); @@ -590,7 +578,6 @@ _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); _GL_CXXALIASWARN (dup3); # endif #elif defined GNULIB_POSIXCHECK -# undef dup3 # if HAVE_RAW_DECL_DUP3 _GL_WARN_ON_USE (dup3, "dup3 is unportable - " "use gnulib module dup3 for portability"); @@ -658,7 +645,6 @@ _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - " "use the gnulib module faccessat instead"); # endif #elif defined GNULIB_POSIXCHECK -# undef euidaccess # if HAVE_RAW_DECL_EUIDACCESS _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " "use gnulib module euidaccess for portability"); @@ -680,7 +666,6 @@ _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); # endif _GL_CXXALIASWARN (execl); #elif defined GNULIB_POSIXCHECK -# undef execl # if HAVE_RAW_DECL_EXECL _GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " "use gnulib module execl for portability"); @@ -715,7 +700,6 @@ _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); # endif _GL_CXXALIASWARN (execle); #elif defined GNULIB_POSIXCHECK -# undef execle # if HAVE_RAW_DECL_EXECLE _GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " "use gnulib module execle for portability"); @@ -751,7 +735,6 @@ _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); # endif _GL_CXXALIASWARN (execlp); #elif defined GNULIB_POSIXCHECK -# undef execlp # if HAVE_RAW_DECL_EXECLP _GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " "use gnulib module execlp for portability"); @@ -788,7 +771,6 @@ _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); # endif _GL_CXXALIASWARN (execv); #elif defined GNULIB_POSIXCHECK -# undef execv # if HAVE_RAW_DECL_EXECV _GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " "use gnulib module execv for portability"); @@ -827,7 +809,6 @@ _GL_CXXALIAS_SYS (execve, int, # endif _GL_CXXALIASWARN (execve); #elif defined GNULIB_POSIXCHECK -# undef execve # if HAVE_RAW_DECL_EXECVE _GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " "use gnulib module execve for portability"); @@ -865,7 +846,6 @@ _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); # endif _GL_CXXALIASWARN (execvp); #elif defined GNULIB_POSIXCHECK -# undef execvp # if HAVE_RAW_DECL_EXECVP _GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " "use gnulib module execvp for portability"); @@ -911,7 +891,6 @@ _GL_CXXALIAS_SYS (execvpe, int, _GL_CXXALIASWARN (execvpe); # endif #elif defined GNULIB_POSIXCHECK -# undef execvpe # if HAVE_RAW_DECL_EXECVPE _GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " "use gnulib module execvpe for portability"); @@ -968,7 +947,6 @@ _GL_CXXALIAS_SYS (faccessat, int, _GL_CXXALIASWARN (faccessat); # endif #elif defined GNULIB_POSIXCHECK -# undef faccessat # if HAVE_RAW_DECL_FACCESSAT _GL_WARN_ON_USE (faccessat, "faccessat is not portable - " "use gnulib module faccessat for portability"); @@ -1005,7 +983,6 @@ _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); _GL_EXTERN_C const char *_gl_directory_name (int fd); # endif #elif defined GNULIB_POSIXCHECK -# undef fchdir # if HAVE_RAW_DECL_FCHDIR _GL_WARN_ON_USE (fchdir, "fchdir is unportable - " "use gnulib module fchdir for portability"); @@ -1035,7 +1012,6 @@ _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, # endif _GL_CXXALIASWARN (fchownat); #elif defined GNULIB_POSIXCHECK -# undef fchownat # if HAVE_RAW_DECL_FCHOWNAT _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " "use gnulib module fchownat for portability"); @@ -1065,7 +1041,6 @@ _GL_CXXALIAS_SYS (fdatasync, int, (int fd)); _GL_CXXALIASWARN (fdatasync); # endif #elif defined GNULIB_POSIXCHECK -# undef fdatasync # if HAVE_RAW_DECL_FDATASYNC _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " "use gnulib module fdatasync for portability"); @@ -1084,7 +1059,6 @@ _GL_FUNCDECL_SYS (fsync, int, (int fd), ); _GL_CXXALIAS_SYS (fsync, int, (int fd)); _GL_CXXALIASWARN (fsync); #elif defined GNULIB_POSIXCHECK -# undef fsync # if HAVE_RAW_DECL_FSYNC _GL_WARN_ON_USE (fsync, "fsync is unportable - " "use gnulib module fsync for portability"); @@ -1118,7 +1092,6 @@ _GL_CXXALIAS_SYS (ftruncate, int, _GL_CXXALIASWARN (ftruncate); # endif #elif defined GNULIB_POSIXCHECK -# undef ftruncate # if HAVE_RAW_DECL_FTRUNCATE _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " "use gnulib module ftruncate for portability"); @@ -1157,7 +1130,6 @@ _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); # endif _GL_CXXALIASWARN (getcwd); #elif defined GNULIB_POSIXCHECK -# undef getcwd # if HAVE_RAW_DECL_GETCWD _GL_WARN_ON_USE (getcwd, "getcwd is unportable - " "use gnulib module getcwd for portability"); @@ -1215,7 +1187,6 @@ _GL_CXXALIAS_SYS (getdomainname, int, _GL_CXXALIASWARN (getdomainname); # endif #elif defined GNULIB_POSIXCHECK -# undef getdomainname # if HAVE_RAW_DECL_GETDOMAINNAME _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " "use gnulib module getdomainname for portability"); @@ -1243,7 +1214,6 @@ _GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void)); # endif _GL_CXXALIASWARN (getdtablesize); #elif defined GNULIB_POSIXCHECK -# undef getdtablesize # if HAVE_RAW_DECL_GETDTABLESIZE _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " "use gnulib module getdtablesize for portability"); @@ -1274,7 +1244,6 @@ _GL_CXXALIAS_SYS (getentropy, int, _GL_CXXALIASWARN (getentropy); # endif #elif defined GNULIB_POSIXCHECK -# undef getentropy # if HAVE_RAW_DECL_GETENTROPY _GL_WARN_ON_USE (getentropy, "getentropy is unportable - " "use gnulib module getentropy for portability"); @@ -1307,7 +1276,6 @@ _GL_CXXALIAS_SYS (getgroups, int, # endif _GL_CXXALIASWARN (getgroups); #elif defined GNULIB_POSIXCHECK -# undef getgroups # if HAVE_RAW_DECL_GETGROUPS _GL_WARN_ON_USE (getgroups, "getgroups is unportable - " "use gnulib module getgroups for portability"); @@ -1336,8 +1304,7 @@ _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len), _GL_ARG_NONNULL ((1))); # endif -/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second - parameter is +/* Need to cast, because on Solaris 10 systems, the second parameter is int len. */ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); # endif @@ -1348,7 +1315,6 @@ _GL_CXXALIASWARN (gethostname); # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname # endif #elif defined GNULIB_POSIXCHECK -# undef gethostname # if HAVE_RAW_DECL_GETHOSTNAME _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " "use gnulib module gethostname for portability"); @@ -1383,7 +1349,6 @@ _GL_CXXALIAS_SYS (getlogin, char *, (void)); _GL_CXXALIASWARN (getlogin); # endif #elif defined GNULIB_POSIXCHECK -# undef getlogin # if HAVE_RAW_DECL_GETLOGIN _GL_WARN_ON_USE (getlogin, "getlogin is unportable - " "use gnulib module getlogin for portability"); @@ -1426,7 +1391,6 @@ _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); _GL_CXXALIASWARN (getlogin_r); # endif #elif defined GNULIB_POSIXCHECK -# undef getlogin_r # if HAVE_RAW_DECL_GETLOGIN_R _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " "use gnulib module getlogin_r for portability"); @@ -1513,7 +1477,6 @@ _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void)); _GL_CXXALIASWARN (getpagesize); # endif #elif defined GNULIB_POSIXCHECK -# undef getpagesize # if HAVE_RAW_DECL_GETPAGESIZE _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " "use gnulib module getpagesize for portability"); @@ -1544,7 +1507,6 @@ _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); # endif _GL_CXXALIASWARN (getpass); #elif defined GNULIB_POSIXCHECK -# undef getpass # if HAVE_RAW_DECL_GETPASS _GL_WARN_ON_USE (getpass, "getpass is unportable - " "use gnulib module getpass or getpass-gnu for portability"); @@ -1587,7 +1549,6 @@ _GL_CXXALIAS_SYS (getusershell, char *, (void)); # endif _GL_CXXALIASWARN (getusershell); #elif defined GNULIB_POSIXCHECK -# undef getusershell # if HAVE_RAW_DECL_GETUSERSHELL _GL_WARN_ON_USE (getusershell, "getusershell is unportable - " "use gnulib module getusershell for portability"); @@ -1611,7 +1572,6 @@ _GL_CXXALIAS_SYS (setusershell, void, (void)); # endif _GL_CXXALIASWARN (setusershell); #elif defined GNULIB_POSIXCHECK -# undef setusershell # if HAVE_RAW_DECL_SETUSERSHELL _GL_WARN_ON_USE (setusershell, "setusershell is unportable - " "use gnulib module getusershell for portability"); @@ -1636,7 +1596,6 @@ _GL_CXXALIAS_SYS (endusershell, void, (void)); # endif _GL_CXXALIASWARN (endusershell); #elif defined GNULIB_POSIXCHECK -# undef endusershell # if HAVE_RAW_DECL_ENDUSERSHELL _GL_WARN_ON_USE (endusershell, "endusershell is unportable - " "use gnulib module getusershell for portability"); @@ -1652,7 +1611,6 @@ _GL_FUNCDECL_SYS (group_member, int, (gid_t gid), ); _GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); _GL_CXXALIASWARN (group_member); #elif defined GNULIB_POSIXCHECK -# undef group_member # if HAVE_RAW_DECL_GROUP_MEMBER _GL_WARN_ON_USE (group_member, "group_member is unportable - " "use gnulib module group-member for portability"); @@ -1680,7 +1638,6 @@ _GL_CXXALIAS_SYS (isatty, int, (int fd)); # endif _GL_CXXALIASWARN (isatty); #elif defined GNULIB_POSIXCHECK -# undef isatty # if HAVE_RAW_DECL_ISATTY _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " "use gnulib module isatty for portability"); @@ -1725,7 +1682,6 @@ _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); # endif _GL_CXXALIASWARN (lchown); #elif defined GNULIB_POSIXCHECK -# undef lchown # if HAVE_RAW_DECL_LCHOWN _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " "use gnulib module lchown for portability"); @@ -1754,7 +1710,6 @@ _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); # endif _GL_CXXALIASWARN (link); #elif defined GNULIB_POSIXCHECK -# undef link # if HAVE_RAW_DECL_LINK _GL_WARN_ON_USE (link, "link is unportable - " "use gnulib module link for portability"); @@ -1793,7 +1748,6 @@ _GL_CXXALIAS_SYS (linkat, int, _GL_CXXALIASWARN (linkat); # endif #elif defined GNULIB_POSIXCHECK -# undef linkat # if HAVE_RAW_DECL_LINKAT _GL_WARN_ON_USE (linkat, "linkat is unportable - " "use gnulib module linkat for portability"); @@ -1823,7 +1777,6 @@ _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); # endif _GL_CXXALIASWARN (lseek); #elif defined GNULIB_POSIXCHECK -# undef lseek # if HAVE_RAW_DECL_LSEEK _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " "systems - use gnulib module lseek for portability"); @@ -1856,7 +1809,6 @@ _GL_FUNCDECL_SYS (pipe, int, (int fd[2]), _GL_CXXALIAS_SYS (pipe, int, (int fd[2])); _GL_CXXALIASWARN (pipe); #elif defined GNULIB_POSIXCHECK -# undef pipe # if HAVE_RAW_DECL_PIPE _GL_WARN_ON_USE (pipe, "pipe is unportable - " "use gnulib module pipe-posix for portability"); @@ -1890,7 +1842,6 @@ _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); _GL_CXXALIASWARN (pipe2); # endif #elif defined GNULIB_POSIXCHECK -# undef pipe2 # if HAVE_RAW_DECL_PIPE2 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " "use gnulib module pipe2 for portability"); @@ -1927,7 +1878,6 @@ _GL_CXXALIAS_SYS (pread, ssize_t, _GL_CXXALIASWARN (pread); # endif #elif defined GNULIB_POSIXCHECK -# undef pread # if HAVE_RAW_DECL_PREAD _GL_WARN_ON_USE (pread, "pread is unportable - " "use gnulib module pread for portability"); @@ -1964,7 +1914,6 @@ _GL_CXXALIAS_SYS (pwrite, ssize_t, _GL_CXXALIASWARN (pwrite); # endif #elif defined GNULIB_POSIXCHECK -# undef pwrite # if HAVE_RAW_DECL_PWRITE _GL_WARN_ON_USE (pwrite, "pwrite is unportable - " "use gnulib module pwrite for portability"); @@ -2042,7 +1991,6 @@ _GL_CXXALIAS_SYS (readlink, ssize_t, # endif _GL_CXXALIASWARN (readlink); #elif defined GNULIB_POSIXCHECK -# undef readlink # if HAVE_RAW_DECL_READLINK _GL_WARN_ON_USE (readlink, "readlink is unportable - " "use gnulib module readlink for portability"); @@ -2077,7 +2025,6 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t, _GL_CXXALIASWARN (readlinkat); # endif #elif defined GNULIB_POSIXCHECK -# undef readlinkat # if HAVE_RAW_DECL_READLINKAT _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " "use gnulib module readlinkat for portability"); @@ -2104,7 +2051,6 @@ _GL_CXXALIAS_SYS (rmdir, int, (char const *name)); # endif _GL_CXXALIASWARN (rmdir); #elif defined GNULIB_POSIXCHECK -# undef rmdir # if HAVE_RAW_DECL_RMDIR _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " "use gnulib module rmdir for portability"); @@ -2151,9 +2097,9 @@ _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len), _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif -/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 - and FreeBSD 6.4 the second parameter is int. On Solaris 11 - 2011-10, the first parameter is not const. */ +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, and FreeBSD 6.4 + the second parameter is int. On Solaris 11 2011-10, the first parameter is + not const. */ _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); # endif @@ -2161,7 +2107,6 @@ _GL_CXXALIAS_SYS_CAST (sethostname, int, _GL_CXXALIASWARN (sethostname); # endif #elif defined GNULIB_POSIXCHECK -# undef sethostname # if HAVE_RAW_DECL_SETHOSTNAME _GL_WARN_ON_USE (sethostname, "sethostname is unportable - " "use gnulib module sethostname for portability"); @@ -2189,7 +2134,6 @@ _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); # endif _GL_CXXALIASWARN (sleep); #elif defined GNULIB_POSIXCHECK -# undef sleep # if HAVE_RAW_DECL_SLEEP _GL_WARN_ON_USE (sleep, "sleep is unportable - " "use gnulib module sleep for portability"); @@ -2244,7 +2188,6 @@ _GL_CXXALIAS_SYS (symlink, int, # endif _GL_CXXALIASWARN (symlink); #elif defined GNULIB_POSIXCHECK -# undef symlink # if HAVE_RAW_DECL_SYMLINK _GL_WARN_ON_USE (symlink, "symlink is not portable - " "use gnulib module symlink for portability"); @@ -2276,7 +2219,6 @@ _GL_CXXALIAS_SYS (symlinkat, int, _GL_CXXALIASWARN (symlinkat); # endif #elif defined GNULIB_POSIXCHECK -# undef symlinkat # if HAVE_RAW_DECL_SYMLINKAT _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " "use gnulib module symlinkat for portability"); @@ -2308,7 +2250,6 @@ _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); _GL_CXXALIASWARN (truncate); # endif #elif defined GNULIB_POSIXCHECK -# undef truncate # if HAVE_RAW_DECL_TRUNCATE _GL_WARN_ON_USE (truncate, "truncate is unportable - " "use gnulib module truncate for portability"); @@ -2342,7 +2283,6 @@ _GL_CXXALIAS_SYS (ttyname_r, int, _GL_CXXALIASWARN (ttyname_r); # endif #elif defined GNULIB_POSIXCHECK -# undef ttyname_r # if HAVE_RAW_DECL_TTYNAME_R _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " "use gnulib module ttyname_r for portability"); @@ -2369,7 +2309,6 @@ _GL_CXXALIAS_SYS (unlink, int, (char const *file)); # endif _GL_CXXALIASWARN (unlink); #elif defined GNULIB_POSIXCHECK -# undef unlink # if HAVE_RAW_DECL_UNLINK _GL_WARN_ON_USE (unlink, "unlink is not portable - " "use gnulib module unlink for portability"); @@ -2409,7 +2348,6 @@ _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); # endif _GL_CXXALIASWARN (unlinkat); #elif defined GNULIB_POSIXCHECK -# undef unlinkat # if HAVE_RAW_DECL_UNLINKAT _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " "use gnulib module unlinkat for portability"); @@ -2439,7 +2377,6 @@ _GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n)); # endif _GL_CXXALIASWARN (usleep); #elif defined GNULIB_POSIXCHECK -# undef usleep # if HAVE_RAW_DECL_USLEEP _GL_WARN_ON_USE (usleep, "usleep is unportable - " "use gnulib module usleep for portability"); @@ -2493,6 +2430,18 @@ _GL_CXXALIASWARN (write); _GL_INLINE_HEADER_END + +/* Includes that provide only macros that don't need to be overridden. + (Includes that are needed for type definitions and function declarations + have their place above, before the function overrides.) */ + +/* FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, Solaris 11.4, and glibc 2.41 + do not define O_CLOEXEC in . */ +#if ! defined O_CLOEXEC +# include +#endif + + #endif /* _@GUARD_PREFIX@_UNISTD_H */ #endif /* _GL_INCLUDING_UNISTD_H */ #endif /* _@GUARD_PREFIX@_UNISTD_H */ diff --git a/gl/unitypes.h b/gl/unitypes.h deleted file mode 100644 index 83a91750..00000000 --- a/gl/unitypes.h +++ /dev/null @@ -1,72 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Elementary types and macros for the GNU UniString library. - Copyright (C) 2002, 2005-2006, 2009-2025 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _UNITYPES_H -#define _UNITYPES_H - -/* Get uint8_t, uint16_t, uint32_t. */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Type representing a Unicode character. */ -typedef uint32_t ucs4_t; - -/* Attribute of a function whose result depends only on the arguments - (not pointers!) and which has no side effects. */ -#ifndef _UC_ATTRIBUTE_CONST -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined __clang__ -# define _UC_ATTRIBUTE_CONST __attribute__ ((__const__)) -# else -# define _UC_ATTRIBUTE_CONST -# endif -#endif - -/* Attribute of a function whose result depends only on the arguments - (possibly pointers) and global memory, and which has no side effects. */ -#ifndef _UC_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ -# define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define _UC_ATTRIBUTE_PURE -# endif -#endif - -/* Qualifier in a function declaration, that asserts that the caller must - pass a pointer to a different object in the specified pointer argument - than in the other pointer arguments. */ -#ifndef _UC_RESTRICT -# if defined __restrict \ - || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ - || __clang_major__ >= 3 -# define _UC_RESTRICT __restrict -# elif 199901L <= __STDC_VERSION__ || defined restrict -# define _UC_RESTRICT restrict -# else -# define _UC_RESTRICT -# endif -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _UNITYPES_H */ diff --git a/gl/unitypes.in.h b/gl/unitypes.in.h index 776d90e9..6d54baa8 100644 --- a/gl/unitypes.in.h +++ b/gl/unitypes.in.h @@ -1,5 +1,5 @@ /* Elementary types and macros for the GNU UniString library. - Copyright (C) 2002, 2005-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/uniwidth.h b/gl/uniwidth.h deleted file mode 100644 index b88df2bf..00000000 --- a/gl/uniwidth.h +++ /dev/null @@ -1,73 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Display width functions. - Copyright (C) 2001-2002, 2005, 2007, 2009-2025 Free Software Foundation, - Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#ifndef _UNIWIDTH_H -#define _UNIWIDTH_H - -#include "unitypes.h" - -/* Get size_t. */ -#include - -/* Get locale_charset() declaration. */ -#include "localcharset.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Display width. */ - -/* These functions are locale dependent. The encoding argument identifies - the encoding (e.g. "ISO-8859-2" for Polish). */ - -/* Determine number of column positions required for UC. */ -extern int - uc_width (ucs4_t uc, const char *encoding) - _UC_ATTRIBUTE_PURE; - -/* Determine number of column positions required for first N units - (or fewer if S ends before this) in S. */ -extern int - u8_width (const uint8_t *s, size_t n, const char *encoding) - _UC_ATTRIBUTE_PURE; -extern int - u16_width (const uint16_t *s, size_t n, const char *encoding) - _UC_ATTRIBUTE_PURE; -extern int - u32_width (const uint32_t *s, size_t n, const char *encoding) - _UC_ATTRIBUTE_PURE; - -/* Determine number of column positions required for S. */ -extern int - u8_strwidth (const uint8_t *s, const char *encoding) - _UC_ATTRIBUTE_PURE; -extern int - u16_strwidth (const uint16_t *s, const char *encoding) - _UC_ATTRIBUTE_PURE; -extern int - u32_strwidth (const uint32_t *s, const char *encoding) - _UC_ATTRIBUTE_PURE; - - -#ifdef __cplusplus -} -#endif - -#endif /* _UNIWIDTH_H */ diff --git a/gl/uniwidth.in.h b/gl/uniwidth.in.h index 49c7ce05..dad496fd 100644 --- a/gl/uniwidth.in.h +++ b/gl/uniwidth.in.h @@ -1,5 +1,5 @@ /* Display width functions. - Copyright (C) 2001-2002, 2005, 2007, 2009-2025 Free Software Foundation, + Copyright (C) 2001-2002, 2005, 2007, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify diff --git a/gl/uniwidth/cjk.h b/gl/uniwidth/cjk.h index af41f637..bcd49fbf 100644 --- a/gl/uniwidth/cjk.h +++ b/gl/uniwidth/cjk.h @@ -1,5 +1,5 @@ /* Test for CJK encoding. - Copyright (C) 2001-2002, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify diff --git a/gl/uniwidth/width.c b/gl/uniwidth/width.c index c99a74cb..683f5513 100644 --- a/gl/uniwidth/width.c +++ b/gl/uniwidth/width.c @@ -1,5 +1,5 @@ /* Determine display width of Unicode character. - Copyright (C) 2001-2002, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This file is free software: you can redistribute it and/or modify @@ -42,8 +42,8 @@ in the U+3130..U+318F block, and these characters are mapped to legacy character sets, and traditional Japanese layout matters for them. 2) glibc does the same thing, see - - + + */ #include "uniwidth/width0.h" diff --git a/gl/uniwidth/width0.h b/gl/uniwidth/width0.h index 2edbe240..d05286b7 100644 --- a/gl/uniwidth/width0.h +++ b/gl/uniwidth/width0.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Table of non-spacing or control characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -static const unsigned char nonspacing_table_data[49*64] = { +static const unsigned char nonspacing_table_data[50*64] = { /* 0x0000-0x01ff */ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */ @@ -130,7 +130,7 @@ static const unsigned char nonspacing_table_data[49*64] = { 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x00, 0x00, /* 0x1a00-0x1a3f */ 0x00, 0x00, 0x40, 0x7f, 0xe5, 0x1f, 0xf8, 0x9f, /* 0x1a40-0x1a7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x1a80-0x1abf */ - 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1ac0-0x1aff */ + 0xff, 0xff, 0xff, 0x3f, 0xff, 0x0f, 0x00, 0x00, /* 0x1ac0-0x1aff */ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x17, /* 0x1b00-0x1b3f */ 0x04, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x1b40-0x1b7f */ 0x03, 0x00, 0x00, 0x00, 0x3c, 0x3b, 0x00, 0x00, /* 0x1b80-0x1bbf */ @@ -265,7 +265,7 @@ static const unsigned char nonspacing_table_data[49*64] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10e00-0x10e3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10e40-0x10e7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, /* 0x10e80-0x10ebf */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, /* 0x10ec0-0x10eff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x10ec0-0x10eff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10f00-0x10f3f */ 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10f40-0x10f7f */ 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10f80-0x10fbf */ @@ -321,7 +321,7 @@ static const unsigned char nonspacing_table_data[49*64] = { 0x00, 0xfc, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, /* 0x11a80-0x11abf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11ac0-0x11aff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11b00-0x11b3f */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11b40-0x11b7f */ + 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, /* 0x11b40-0x11b7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11b80-0x11bbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11bc0-0x11bff */ /* 0x11c00-0x11dff */ @@ -450,6 +450,15 @@ static const unsigned char nonspacing_table_data[49*64] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e540-0x1e57f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e580-0x1e5bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, /* 0x1e5c0-0x1e5ff */ + /* 0x1e600-0x1e7ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e600-0x1e63f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e640-0x1e67f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e680-0x1e6bf */ + 0x00, 0x00, 0x00, 0x00, 0x48, 0xc0, 0x20, 0x00, /* 0x1e6c0-0x1e6ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e700-0x1e73f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e740-0x1e77f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e780-0x1e7bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e7c0-0x1e7ff */ /* 0x1e800-0x1e9ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e800-0x1e83f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e840-0x1e87f */ @@ -491,5 +500,5 @@ static const signed char nonspacing_table_ind[248] = { -1, -1, -1, -1, -1, -1, 40, -1, /* 0x1b000-0x1bfff */ -1, -1, -1, -1, -1, -1, -1, 41, /* 0x1c000-0x1cfff */ 42, 43, -1, -1, -1, 44, -1, -1, /* 0x1d000-0x1dfff */ - 45, 46, 47, -1, 48, -1, -1, -1 /* 0x1e000-0x1efff */ + 45, 46, 47, 48, 49, -1, -1, -1 /* 0x1e000-0x1efff */ }; diff --git a/gl/uniwidth/width2.h b/gl/uniwidth/width2.h index f919989b..70bb049c 100644 --- a/gl/uniwidth/width2.h +++ b/gl/uniwidth/width2.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Width 2 property of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/unlocked-io.h b/gl/unlocked-io.h index 69ea6641..2b0d13e3 100644 --- a/gl/unlocked-io.h +++ b/gl/unlocked-io.h @@ -1,6 +1,6 @@ /* Prefer faster, non-thread-safe stdio functions if available. - Copyright (C) 2001-2004, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,6 +73,13 @@ # define fgets_unlocked(x,y,z) fgets (x,y,z) # endif +# if HAVE_DECL_FILENO_UNLOCKED || defined fileno_unlocked +# undef fileno +# define fileno(x) fileno_unlocked (x) +# else +# define fileno_unlocked(x) fileno (x) +# endif + # if HAVE_DECL_FPUTC_UNLOCKED || defined fputc_unlocked # undef fputc # define fputc(x,y) fputc_unlocked (x,y) diff --git a/gl/unsetenv.c b/gl/unsetenv.c index d38ed37a..dab1b90c 100644 --- a/gl/unsetenv.c +++ b/gl/unsetenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2002, 2005-2025 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2002, 2005-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is free software: you can redistribute it and/or modify @@ -56,15 +56,13 @@ __libc_lock_define_initialized (static, envlock) int unsetenv (const char *name) { - size_t len; - if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) { __set_errno (EINVAL); return -1; } - len = strlen (name); + size_t len = strlen (name); #if HAVE_DECL__PUTENV /* native Windows */ /* The Microsoft documentation @@ -79,14 +77,13 @@ unsetenv (const char *name) of the form "NAME=". (NB: This is a different convention than with glibc putenv, which expects a string of the form "NAME"!) */ { - int putenv_result; char *name_ = malloc (len + 2); if (name_ == NULL) return -1; memcpy (name_, name, len); name_[len] = '='; name_[len + 1] = 0; - putenv_result = _putenv (name_); + int putenv_result = _putenv (name_); /* In this particular case it is OK to free() the argument passed to _putenv. */ free (name_); @@ -138,12 +135,12 @@ extern int unsetenv (const char *); int rpl_unsetenv (const char *name) { - int result = 0; if (!name || !*name || strchr (name, '=')) { errno = EINVAL; return -1; } + int result = 0; while (getenv (name)) # if !VOID_UNSETENV result = diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c index f46e8701..85e30b90 100644 --- a/gl/vasnprintf.c +++ b/gl/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -180,7 +180,7 @@ # define SNPRINTF swprintf # endif # else - /* Old platforms such as NetBSD 3.0, OpenBSD 3.8, HP-UX 11.00, IRIX 6.5. */ + /* Old platforms such as NetBSD 3.0, OpenBSD 3.8, HP-UX 11.00. */ # define TCHAR_T char # endif #endif @@ -439,7 +439,7 @@ thousands_separator_char (char stackbuf[10]) stackbuf[strlen (stackbuf) - 3] = '\0'; # if defined __sun /* Solaris specific hack: Replace wrong result (0xC2 means U+00A0). */ - if (strcmp (&stackbuf[1], "\302") == 0) + if (streq (&stackbuf[1], "\302")) strcpy (&stackbuf[1], MB_CUR_MAX > 1 ? "\302\240" : "\240"); # endif return &stackbuf[1]; @@ -524,7 +524,7 @@ thousands_separator_wchar (wchar_t stackbuf[10]) /* Now tmp = L"1000". */ tmp[strlen (tmp) - 3] = '\0'; /* Solaris specific hack: Replace wrong result (0xC2 means U+00A0). */ - if (strcmp (&tmp[1], "\302") == 0) + if (streq (&tmp[1], "\302")) strcpy (&tmp[1], MB_CUR_MAX > 1 ? "\302\240" : "\240"); if (tmp[1] != '\0') { @@ -739,19 +739,18 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest) /* Here 1 <= len1 <= len2. */ size_t dlen; mp_limb_t *dp; - size_t k, i, j; dlen = len1 + len2; dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t)); if (dp == NULL) return NOMEM_PTR; - for (k = len2; k > 0; ) + for (size_t k = len2; k > 0; ) dp[--k] = 0; - for (i = 0; i < len1; i++) + for (size_t i = 0; i < len1; i++) { mp_limb_t digit1 = p1[i]; mp_twolimb_t carry = 0; - for (j = 0; j < len2; j++) + for (size_t j = 0; j < len2; j++) { mp_limb_t digit2 = p2[j]; carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; @@ -835,7 +834,6 @@ divide (mpn_t a, mpn_t b, mpn_t *q) size_t a_len = a.nlimbs; const mp_limb_t *b_ptr = b.limbs; size_t b_len = b.nlimbs; - mp_limb_t *roomptr; mp_limb_t *tmp_roomptr = NULL; mp_limb_t *q_ptr; size_t q_len; @@ -845,7 +843,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) /* Allocate room for a_len+2 digits. (Need a_len+1 digits for the real division and 1 more digit for the final rounding of q.) */ - roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); + mp_limb_t *roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); if (roomptr == NULL) return NOMEM_PTR; @@ -887,8 +885,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) mp_limb_t remainder = 0; const mp_limb_t *sourceptr = a_ptr + a_len; mp_limb_t *destptr = q_ptr + a_len; - size_t count; - for (count = a_len; count > 0; count--) + for (size_t count = a_len; count > 0; count--) { mp_twolimb_t num = ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr; @@ -989,8 +986,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = tmp_roomptr; mp_twolimb_t accu = 0; - size_t count; - for (count = b_len; count > 0; count--) + for (size_t count = b_len; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s; *destptr++ = (mp_limb_t) accu; @@ -1017,8 +1013,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) const mp_limb_t *sourceptr = a_ptr; mp_limb_t *destptr = r_ptr; mp_twolimb_t accu = 0; - size_t count; - for (count = a_len; count > 0; count--) + for (size_t count = a_len; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s; *destptr++ = (mp_limb_t) accu; @@ -1094,8 +1089,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = r_ptr + j; mp_twolimb_t carry = 0; - size_t count; - for (count = b_len; count > 0; count--) + for (size_t count = b_len; count > 0; count--) { /* Here 0 <= carry <= q*. */ carry = @@ -1119,8 +1113,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = r_ptr + j; mp_limb_t carry = 0; - size_t count; - for (count = b_len; count > 0; count--) + for (size_t count = b_len; count > 0; count--) { mp_limb_t source1 = *sourceptr++; mp_limb_t source2 = *destptr; @@ -1152,8 +1145,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) { mp_limb_t ptr = r_ptr + r_len; mp_twolimb_t accu = 0; - size_t count; - for (count = r_len; count > 0; count--) + for (size_t count = r_len; count > 0; count--) { accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS; accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s); @@ -1168,29 +1160,25 @@ divide (mpn_t a, mpn_t b, mpn_t *q) /* Compare r << 1 with b. */ if (r_len > b_len) goto increment_q; - { - size_t i; - for (i = b_len;;) - { - mp_limb_t r_i = - (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) - | (i < r_len ? r_ptr[i] << 1 : 0); - mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); - if (r_i > b_i) - goto increment_q; - if (r_i < b_i) - goto keep_q; - if (i == 0) - break; - i--; - } - } + for (size_t i = b_len;;) + { + mp_limb_t r_i = + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) + | (i < r_len ? r_ptr[i] << 1 : 0); + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); + if (r_i > b_i) + goto increment_q; + if (r_i < b_i) + goto keep_q; + if (i == 0) + break; + i--; + } if (q_len > 0 && ((q_ptr[0] & 1) != 0)) /* q is odd. */ increment_q: { - size_t i; - for (i = 0; i < q_len; i++) + for (size_t i = 0; i < q_len; i++) if (++(q_ptr[i]) != 0) goto keep_q; q_ptr[q_len++] = 1; @@ -1236,8 +1224,7 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes) /* Divide a by 10^9, in-place. */ mp_limb_t remainder = 0; mp_limb_t *ptr = a_ptr + a_len; - size_t count; - for (count = a_len; count > 0; count--) + for (size_t count = a_len; count > 0; count--) { mp_twolimb_t num = ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr; @@ -1245,7 +1232,7 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes) remainder = num % 1000000000; } /* Store the remainder as 9 decimal digits. */ - for (count = 9; count > 0; count--) + for (size_t count = 9; count > 0; count--) { *d_ptr++ = '0' + (remainder % 10); remainder = remainder / 10; @@ -1279,18 +1266,15 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes) static void * decode_long_double (long double x, int *ep, mpn_t *mp) { - mpn_t m; - int exp; - long double y; - size_t i; - /* Allocate memory for result. */ + mpn_t m; m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); if (m.limbs == NULL) return NULL; /* Split into exponential part and mantissa. */ - y = safe_frexpl (x, &exp); + int exp; + long double y = safe_frexpl (x, &exp); if (!(y >= 0.0L && y < 1.0L)) abort (); /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the @@ -1328,7 +1312,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp) } # endif # endif - for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + for (size_t i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); @@ -1367,18 +1351,15 @@ decode_long_double (long double x, int *ep, mpn_t *mp) static void * decode_double (double x, int *ep, mpn_t *mp) { - mpn_t m; - int exp; - double y; - size_t i; - /* Allocate memory for result. */ + mpn_t m; m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); if (m.limbs == NULL) return NULL; /* Split into exponential part and mantissa. */ - y = frexp (x, &exp); + int exp; + double y = frexp (x, &exp); if (!(y >= 0.0 && y < 1.0)) abort (); /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the @@ -1416,7 +1397,7 @@ decode_double (double x, int *ep, mpn_t *mp) } # endif # endif - for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + for (size_t i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); @@ -1451,24 +1432,11 @@ decode_double (double x, int *ep, mpn_t *mp) static char * scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) { - int s; - size_t extra_zeroes; - unsigned int abs_n; - unsigned int abs_s; - mp_limb_t *pow5_ptr; - size_t pow5_len; - unsigned int s_limbs; - unsigned int s_bits; - mpn_t pow5; - mpn_t z; - void *z_memory; - char *digits; - /* x = 2^e * m, hence y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m) = round (2^s * 5^n * m). */ - s = e + n; - extra_zeroes = 0; + int s = e + n; + size_t extra_zeroes = 0; /* Factor out a common power of 10 if possible. */ if (s > 0 && n > 0) { @@ -1481,11 +1449,12 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) z = round (2^s * 5^n * m). */ /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same sign. 2.322 is slightly larger than log(5)/log(2). */ - abs_n = (n >= 0 ? n : -n); - abs_s = (s >= 0 ? s : -s); - pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 - + abs_s / GMP_LIMB_BITS + 1) - * sizeof (mp_limb_t)); + unsigned int abs_n = (n >= 0 ? n : -n); + unsigned int abs_s = (s >= 0 ? s : -s); + mp_limb_t *pow5_ptr = + (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 + + abs_s / GMP_LIMB_BITS + 1) + * sizeof (mp_limb_t)); if (pow5_ptr == NULL) { free (memory); @@ -1493,7 +1462,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) } /* Initialize with 1. */ pow5_ptr[0] = 1; - pow5_len = 1; + size_t pow5_len = 1; /* Multiply with 5^|n|. */ if (abs_n > 0) { @@ -1502,13 +1471,11 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125 }; - unsigned int n13; - for (n13 = 0; n13 <= abs_n; n13 += 13) + for (unsigned int n13 = 0; n13 <= abs_n; n13 += 13) { mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13]; - size_t j; mp_twolimb_t carry = 0; - for (j = 0; j < pow5_len; j++) + for (size_t j = 0; j < pow5_len; j++) { mp_limb_t digit2 = pow5_ptr[j]; carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; @@ -1519,8 +1486,11 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) pow5_ptr[pow5_len++] = (mp_limb_t) carry; } } - s_limbs = abs_s / GMP_LIMB_BITS; - s_bits = abs_s % GMP_LIMB_BITS; + unsigned int s_limbs = abs_s / GMP_LIMB_BITS; + unsigned int s_bits = abs_s % GMP_LIMB_BITS; + mpn_t pow5; + mpn_t z; + void *z_memory; if (n >= 0 ? s >= 0 : s <= 0) { /* Multiply with 2^|s|. */ @@ -1528,8 +1498,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) { mp_limb_t *ptr = pow5_ptr; mp_twolimb_t accu = 0; - size_t count; - for (count = pow5_len; count > 0; count--) + for (size_t count = pow5_len; count > 0; count--) { accu += (mp_twolimb_t) *ptr << s_bits; *ptr++ = (mp_limb_t) accu; @@ -1543,13 +1512,12 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) } if (s_limbs > 0) { - size_t count; - for (count = pow5_len; count > 0;) + for (size_t count = pow5_len; count > 0;) { count--; pow5_ptr[s_limbs + count] = pow5_ptr[count]; } - for (count = s_limbs; count > 0;) + for (size_t count = s_limbs; count > 0;) { count--; pow5_ptr[count] = 0; @@ -1590,8 +1558,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) /* Construct 2^|s|. */ { mp_limb_t *ptr = pow5_ptr + pow5_len; - size_t i; - for (i = 0; i < s_limbs; i++) + for (size_t i = 0; i < s_limbs; i++) ptr[i] = 0; ptr[s_limbs] = (mp_limb_t) 1 << s_bits; denominator.limbs = ptr; @@ -1616,17 +1583,13 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) } { mp_limb_t *destptr = num_ptr; - { - size_t i; - for (i = 0; i < s_limbs; i++) - *destptr++ = 0; - } + for (size_t i = 0; i < s_limbs; i++) + *destptr++ = 0; if (s_bits > 0) { const mp_limb_t *sourceptr = m.limbs; mp_twolimb_t accu = 0; - size_t count; - for (count = m.nlimbs; count > 0; count--) + for (size_t count = m.nlimbs; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s_bits; *destptr++ = (mp_limb_t) accu; @@ -1638,8 +1601,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) else { const mp_limb_t *sourceptr = m.limbs; - size_t count; - for (count = m.nlimbs; count > 0; count--) + for (size_t count = m.nlimbs; count > 0; count--) *destptr++ = *sourceptr++; } numerator.limbs = num_ptr; @@ -1656,7 +1618,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) if (z_memory == NOMEM_PTR) return NULL; - digits = convert_to_decimal (z, extra_zeroes); + char *digits = convert_to_decimal (z, extra_zeroes); free (z_memory); return digits; } @@ -1711,13 +1673,9 @@ scale10_round_decimal_double (double x, int n) static int floorlog10l (long double x) { - int exp; - long double y; - double z; - double l; - /* Split into exponential part and mantissa. */ - y = safe_frexpl (x, &exp); + int exp; + long double y = safe_frexpl (x, &exp); if (!(y >= 0.0L && y < 1.0L)) abort (); if (y == 0.0L) @@ -1758,8 +1716,8 @@ floorlog10l (long double x) if (!(y >= 0.5L && y < 1.0L)) abort (); /* Compute an approximation for l = log2(x) = exp + log2(y). */ - l = exp; - z = y; + double l = exp; + double z = y; if (z < 0.70710678118654752444) { z *= 1.4142135623730950488; @@ -1802,13 +1760,9 @@ floorlog10l (long double x) static int floorlog10 (double x) { - int exp; - double y; - double z; - double l; - /* Split into exponential part and mantissa. */ - y = frexp (x, &exp); + int exp; + double y = frexp (x, &exp); if (!(y >= 0.0 && y < 1.0)) abort (); if (y == 0.0) @@ -1849,8 +1803,8 @@ floorlog10 (double x) if (!(y >= 0.5 && y < 1.0)) abort (); /* Compute an approximation for l = log2(x) = exp + log2(y). */ - l = exp; - z = y; + double l = exp; + double z = y; if (z < 0.70710678118654752444) { z *= 1.4142135623730950488; @@ -2513,21 +2467,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto fail_1_with_EINVAL; { - size_t buf_neededlength; - TCHAR_T *buf; - TCHAR_T *buf_malloced; - const FCHAR_T *cp; - size_t di; - DIRECTIVE *dp; - /* Output string accumulator. */ - DCHAR_T *result; - size_t allocated; - size_t length; - /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ - buf_neededlength = + size_t buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); + TCHAR_T *buf; + TCHAR_T *buf_malloced; #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (TCHAR_T)) { @@ -2546,9 +2491,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, buf_malloced = buf; } - result = resultbuf; - allocated = (resultbuf != NULL ? *lengthp : 0); - length = 0; + /* Output string accumulator. */ + DCHAR_T *result = resultbuf; + size_t allocated = (resultbuf != NULL ? *lengthp : 0); + size_t length = 0; + /* Invariants: result is either == resultbuf or malloc-allocated. If result == NULL, resultbuf is == NULL as well. @@ -2559,15 +2506,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #define ENSURE_ALLOCATION_ELSE(needed, oom_statement) \ if ((needed) > allocated) \ { \ - size_t memory_size; \ - DCHAR_T *memory; \ - \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ - memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ + size_t memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ if (size_overflow_p (memory_size)) \ oom_statement \ + DCHAR_T *memory; \ if (result == resultbuf) \ memory = (DCHAR_T *) malloc (memory_size); \ else \ @@ -2581,6 +2526,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #define ENSURE_ALLOCATION(needed) \ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; ) + const FCHAR_T *cp; + size_t di; + DIRECTIVE *dp; for (cp = format, di = 0, dp = &d.dir[0]; ; cp = dp->dir_end, di++, dp++) { if (cp != dp->dir_start) @@ -2681,22 +2629,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; - int has_width; - size_t width; - int has_precision; - size_t precision; - has_width = 0; - width = 0; + int has_width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -2719,17 +2661,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, has_width = 1; } - has_precision = 0; - precision = 0; + int has_precision = 0; + size_t precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -3074,22 +3014,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, than INT_MAX characters, whence snprintf or sprintf would fail to process it. */ int flags = dp->flags; - int has_width; - size_t width; - int has_precision; - size_t precision; - has_width = 0; - width = 0; + int has_width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -3112,17 +3046,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, has_width = 1; } - has_precision = 0; - precision = 6; + int has_precision = 0; + size_t precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -3144,18 +3076,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { const char *arg = a.arg[dp->arg_index].a.a_string; - size_t bytes; -# if ENABLE_UNISTDIO && DCHAR_IS_TCHAR - size_t characters; -# endif -# if !DCHAR_IS_TCHAR - /* This code assumes that TCHAR_T is 'char'. */ - static_assert (sizeof (TCHAR_T) == 1); - DCHAR_T *tmpdst; - size_t tmpdst_len; -# endif - size_t w; + size_t bytes; if (has_precision) { /* Use only at most PRECISION bytes, from the left. */ @@ -3169,6 +3091,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } # if ENABLE_UNISTDIO && DCHAR_IS_TCHAR + size_t characters; if (has_width) characters = mbsnlen (arg, bytes); else @@ -3180,6 +3103,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif # if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + static_assert (sizeof (TCHAR_T) == 1); + DCHAR_T *tmpdst; + size_t tmpdst_len; /* Convert from TCHAR_T[] to DCHAR_T[]. */ tmpdst = DCHAR_CONV_FROM_ENCODING (locale_charset (), @@ -3191,6 +3118,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto fail_with_errno; # endif + size_t w; if (has_width) { # if ENABLE_UNISTDIO @@ -3260,18 +3188,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, convert back the result from a char[] to a wchar_t[]. Instead, just copy the argument wchar_t[] to the result. */ int flags = dp->flags; - size_t width; - width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -3300,20 +3225,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (dp->conversion == 's') { - int has_precision; - size_t precision; - - has_precision = 0; - precision = 6; + int has_precision = 0; + size_t precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -3339,9 +3259,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Use only at most PRECISION wide characters, from the left. */ - const wchar_t *ls_arg_end; - - ls_arg_end = ls_arg; + const wchar_t *ls_arg_end = ls_arg; characters = 0; for (; precision > 0; precision--) { @@ -3413,22 +3331,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, such bugs, we implement the entire processing of the 's' directive ourselves. */ int flags = dp->flags; - int has_width; - size_t width; - int has_precision; - size_t precision; - has_width = 0; - width = 0; + int has_width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -3451,17 +3363,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, has_width = 1; } - has_precision = 0; - precision = 6; + int has_precision = 0; + size_t precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -3563,13 +3473,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (has_precision || has_width) { /* We know the number of wide characters in advance. */ - size_t remaining; # if HAVE_MBRTOWC mbstate_t state; mbszero (&state); # endif ENSURE_ALLOCATION (xsum (length, characters)); - for (remaining = characters; remaining > 0; remaining--) + for (size_t remaining = characters; remaining > 0; remaining--) { wchar_t wc; int count; @@ -3655,13 +3564,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif while (precision > 0) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; - if (*arg_end == 0) /* Found the terminating null wide character. */ break; - count = local_wcrtomb (cbuf, *arg_end, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, *arg_end, &state); if (count < 0) /* Cannot convert. */ goto fail_with_EILSEQ; @@ -3694,13 +3601,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif for (;;) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; - if (*arg_end == 0) /* Found the terminating null wide character. */ break; - count = local_wcrtomb (cbuf, *arg_end, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, *arg_end, &state); if (count < 0) /* Cannot convert. */ goto fail_with_EILSEQ; @@ -3727,27 +3632,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if !DCHAR_IS_TCHAR { - TCHAR_T *tmpsrc; - /* Convert the string into a piece of temporary memory. */ - tmpsrc = (TCHAR_T *) malloc (bytes * sizeof (TCHAR_T)); + TCHAR_T *tmpsrc = (TCHAR_T *) malloc (bytes * sizeof (TCHAR_T)); if (tmpsrc == NULL) goto out_of_memory; { TCHAR_T *tmpptr = tmpsrc; - size_t remaining; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif - for (remaining = bytes; remaining > 0; ) + for (size_t remaining = bytes; remaining > 0; ) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; - if (*arg == 0) abort (); - count = local_wcrtomb (cbuf, *arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, *arg, &state); if (count <= 0) /* Inconsistency. */ abort (); @@ -3814,20 +3714,17 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (has_precision || has_width) { /* We know the number of bytes in advance. */ - size_t remaining; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif ENSURE_ALLOCATION (xsum (length, bytes)); - for (remaining = bytes; remaining > 0; ) + for (size_t remaining = bytes; remaining > 0; ) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; - if (*arg == 0) abort (); - count = local_wcrtomb (cbuf, *arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, *arg, &state); if (count <= 0) /* Inconsistency. */ abort (); @@ -3847,12 +3744,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif while (arg < arg_end) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; - if (*arg == 0) abort (); - count = local_wcrtomb (cbuf, *arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, *arg, &state); if (count <= 0) /* Cannot convert. */ goto fail_with_EILSEQ; @@ -3889,20 +3784,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, a correct behaviour for the null wint_t argument and/or the fallback that avoids EILSEQ. */ int flags = dp->flags; - int has_width; - size_t width; - has_width = 0; - width = 0; + int has_width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -3945,14 +3836,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif { /* Count the number of bytes. */ - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif - count = local_wcrtomb (cbuf, arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, arg, &state); if (count < 0) /* Cannot convert. */ goto fail_with_EILSEQ; @@ -3980,14 +3870,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Convert the string into a piece of temporary memory. */ if (bytes > 0) { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif - count = local_wcrtomb (cbuf, arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, arg, &state); if (count <= 0) /* Inconsistency. */ abort (); @@ -4047,13 +3936,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, ENSURE_ALLOCATION (xsum (length, bytes)); if (bytes > 0) { - int count; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif - count = local_wcrtomb (result + length, arg, &state); + int count = local_wcrtomb (result + length, arg, &state); if (count <= 0) /* Inconsistency. */ abort (); @@ -4062,14 +3950,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { - char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ - int count; # if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; mbszero (&state); # endif - count = local_wcrtomb (cbuf, arg, &state); + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count = local_wcrtomb (cbuf, arg, &state); if (count < 0) /* Cannot convert. */ goto fail_with_EILSEQ; @@ -4102,18 +3989,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Implement the 'c' directive ourselves, in order to avoid EILSEQ in the "C" locale. */ int flags = dp->flags; - size_t width; - width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -4139,9 +4023,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { char arg = (char) a.arg[dp->arg_index].a.a_char; mbstate_t state; - wchar_t wc; - mbszero (&state); + + wchar_t wc; int count = mbrtowc (&wc, &arg, 1, &state); if (count < 0) /* Invalid or incomplete multibyte character. */ @@ -4182,30 +4066,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; - int has_width; - size_t width; - int has_precision; - size_t precision; - size_t tmp_length; - size_t count; - DCHAR_T tmpbuf[700]; - DCHAR_T *tmp; - DCHAR_T *tmp_end; - DCHAR_T *tmp_start; - DCHAR_T *pad_ptr; - DCHAR_T *p; - has_width = 0; - width = 0; + int has_width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -4228,17 +4098,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, has_width = 1; } - has_precision = 0; - precision = 1; + int has_precision = 0; + size_t precision = 1; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -4259,6 +4127,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } /* Allocate a temporary buffer of sufficient size. */ + size_t tmp_length; switch (type) { default: @@ -4325,6 +4194,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (tmp_length < width) tmp_length = width; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) tmp = tmpbuf; else @@ -4340,7 +4211,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto out_of_memory; } - tmp_end = tmp + tmp_length; + DCHAR_T *tmp_end = tmp + tmp_length; unsigned long long arg; switch (type) @@ -4389,7 +4260,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } int need_prefix = ((flags & FLAG_ALT) && arg != 0); - p = tmp_end; + DCHAR_T *p = tmp_end; /* "The result of converting a zero value with a precision of zero is no characters." */ if (!(has_precision && precision == 0 && arg == 0)) @@ -4409,7 +4280,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *--p = '0'; } - pad_ptr = p; + DCHAR_T *pad_ptr = p; if (need_prefix) { @@ -4422,12 +4293,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif *--p = '0'; } - tmp_start = p; + DCHAR_T *tmp_start = p; /* The generated string now extends from tmp_start to tmp_end, with the zero padding insertion point being at pad_ptr, tmp_start <= pad_ptr <= tmp_end. */ - count = tmp_end - tmp_start; + size_t count = tmp_end - tmp_start; if (count < width) { @@ -4503,26 +4374,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; - size_t width; - int has_precision; - size_t precision; - size_t tmp_length; - size_t count; - DCHAR_T tmpbuf[700]; - DCHAR_T *tmp; - DCHAR_T *pad_ptr; - DCHAR_T *p; - width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -4544,17 +4404,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto overflow; } - has_precision = 0; - precision = 0; + int has_precision = 0; + size_t precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -4575,6 +4433,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } /* Allocate a temporary buffer of sufficient size. */ + size_t tmp_length; if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) ((LDBL_DIG + 1) @@ -4597,6 +4456,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) tmp = tmpbuf; else @@ -4612,8 +4473,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto out_of_memory; } - pad_ptr = NULL; - p = tmp; + DCHAR_T *pad_ptr = NULL; + DCHAR_T *p = tmp; if (type == TYPE_LONGDOUBLE) { # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || (NEED_WPRINTF_DIRECTIVE_LA && WIDE_CHAR_VERSION) @@ -4632,11 +4493,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { - int sign = 0; DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); + int sign = 0; if (signbit (arg)) /* arg < 0.0L or negative zero */ { sign = -1; @@ -4665,7 +4526,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { int exponent; long double mantissa; - if (arg > 0.0L) mantissa = printf_frexpl (arg, &exponent); else @@ -4679,9 +4539,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Round the mantissa. */ long double tail = mantissa; - size_t q; - for (q = precision; ; q--) + for (size_t q = precision; ; q--) { int digit = (int) tail; tail -= digit; @@ -4696,7 +4555,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tail *= 16.0L; } if (tail != 0.0L) - for (q = precision; q > 0; q--) + for (size_t q = precision; q > 0; q--) tail *= 0.0625L; mantissa += tail; } @@ -4705,9 +4564,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *p++ = dp->conversion - 'A' + 'X'; pad_ptr = p; { - int digit; - - digit = (int) mantissa; + int digit = (int) mantissa; mantissa -= digit; *p++ = '0' + digit; if ((flags & FLAG_ALT) @@ -4754,9 +4611,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, "%+d", exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif @@ -4787,7 +4643,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { int sign = 0; - if (signbit (arg)) /* arg < 0.0 or negative zero */ { sign = -1; @@ -4816,7 +4671,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { int exponent; double mantissa; - if (arg > 0.0) mantissa = printf_frexp (arg, &exponent); else @@ -4830,9 +4684,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Round the mantissa. */ double tail = mantissa; - size_t q; - for (q = precision; ; q--) + for (size_t q = precision; ; q--) { int digit = (int) tail; tail -= digit; @@ -4847,7 +4700,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tail *= 16.0; } if (tail != 0.0) - for (q = precision; q > 0; q--) + for (size_t q = precision; q > 0; q--) tail *= 0.0625; mantissa += tail; } @@ -4856,9 +4709,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *p++ = dp->conversion - 'A' + 'X'; pad_ptr = p; { - int digit; - - digit = (int) mantissa; + int digit = (int) mantissa; mantissa -= digit; *p++ = '0' + digit; if ((flags & FLAG_ALT) @@ -4905,9 +4756,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, "%+d", exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif @@ -4920,7 +4770,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ - count = p - tmp; + size_t count = p - tmp; if (count < width) { @@ -5001,8 +4851,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE /* Some systems produce wrong output for Inf, -Inf, and NaN. Some systems in this category - (IRIX 5.3) also do so for -0.0. Therefore we - treat this case here as well. */ + also do so for -0.0. Therefore we treat this + case here as well. */ && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble)) # endif )) @@ -5011,26 +4861,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, arg_type type = a.arg[dp->arg_index].type; # endif int flags = dp->flags; - size_t width; - size_t count; - int has_precision; - size_t precision; - size_t tmp_length; - DCHAR_T tmpbuf[700]; - DCHAR_T *tmp; - DCHAR_T *pad_ptr; - DCHAR_T *p; - width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -5052,17 +4891,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto overflow; } - has_precision = 0; - precision = 0; + int has_precision = 0; + size_t precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -5091,6 +4928,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, precision = 6; /* Allocate a temporary buffer of sufficient size. */ + size_t tmp_length; # if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); # elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE @@ -5155,6 +4993,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) tmp = tmpbuf; else @@ -5170,8 +5010,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, goto out_of_memory; } - pad_ptr = NULL; - p = tmp; + DCHAR_T *pad_ptr = NULL; + DCHAR_T *p = tmp; # if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE @@ -5193,11 +5033,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { - int sign = 0; DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); + int sign = 0; if (signbit (arg)) /* arg < 0.0L or negative zero */ { sign = -1; @@ -5229,17 +5069,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (dp->conversion == 'f' || dp->conversion == 'F') { - char *digits; - size_t ndigits; - - digits = + char *digits = scale10_round_decimal_long_double (arg, precision); if (digits == NULL) { END_LONG_DOUBLE_ROUNDING (); goto out_of_memory; } - ndigits = strlen (digits); + size_t ndigits = strlen (digits); if (ndigits > precision) { @@ -5355,12 +5192,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { /* arg > 0.0L. */ - int adjusted; + exponent = floorlog10l (arg); + int adjusted = 0; char *digits; size_t ndigits; - - exponent = floorlog10l (arg); - adjusted = 0; for (;;) { digits = @@ -5451,9 +5286,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, "%+.2d", exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif @@ -5489,14 +5323,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { /* arg > 0.0L. */ - int exponent; - int adjusted; + int exponent = floorlog10l (arg); + int adjusted = 0; char *digits; size_t ndigits; - size_t nzeroes; - - exponent = floorlog10l (arg); - adjusted = 0; for (;;) { digits = @@ -5556,7 +5386,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Determine the number of trailing zeroes that have to be dropped. */ - nzeroes = 0; + size_t nzeroes = 0; if ((flags & FLAG_ALT) == 0) while (nzeroes < ndigits && digits[nzeroes] == '0') @@ -5706,9 +5536,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, "%+.2d", exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif @@ -5808,7 +5637,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { int sign = 0; - if (signbit (arg)) /* arg < 0.0 or negative zero */ { sign = -1; @@ -5840,14 +5668,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (dp->conversion == 'f' || dp->conversion == 'F') { - char *digits; - size_t ndigits; - - digits = + char *digits = scale10_round_decimal_double (arg, precision); if (digits == NULL) goto out_of_memory; - ndigits = strlen (digits); + size_t ndigits = strlen (digits); if (ndigits > precision) { @@ -5963,12 +5788,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { /* arg > 0.0. */ - int adjusted; + exponent = floorlog10 (arg); + int adjusted = 0; char *digits; size_t ndigits; - - exponent = floorlog10 (arg); - adjusted = 0; for (;;) { digits = @@ -6070,9 +5893,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, decimal_format, exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } } @@ -6109,14 +5931,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { /* arg > 0.0. */ - int exponent; - int adjusted; + int exponent = floorlog10 (arg); + int adjusted = 0; char *digits; size_t ndigits; - size_t nzeroes; - - exponent = floorlog10 (arg); - adjusted = 0; for (;;) { digits = @@ -6172,7 +5990,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Determine the number of trailing zeroes that have to be dropped. */ - nzeroes = 0; + size_t nzeroes = 0; if ((flags & FLAG_ALT) == 0) while (nzeroes < ndigits && digits[nzeroes] == '0') @@ -6337,9 +6155,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, else { char expbuf[6 + 1]; - const char *ep; sprintf (expbuf, decimal_format, exponent); - for (ep = expbuf; (*p = *ep) != '\0'; ep++) + for (const char *ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } } @@ -6409,7 +6226,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ - count = p - tmp; + size_t count = p - tmp; if (count < width) { @@ -6473,16 +6290,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; -#if (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - int has_width; -#endif -#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - size_t width; -#endif -#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - int has_precision; - size_t precision; -#endif #if NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION int prec_ourselves; #else @@ -6511,19 +6318,17 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #endif #if (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - has_width = 0; + int has_width = 0; #endif #if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - width = 0; + size_t width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -6551,17 +6356,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #endif #if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT - has_precision = 0; - precision = 6; + int has_precision = 0; + size_t precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; + int arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) @@ -6648,19 +6451,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #if !((WIDE_CHAR_VERSION && MUSL_LIBC) || NEED_PRINTF_FLAG_LEFTADJUST) && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT) switch (dp->conversion) { -# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need to perform the padding after this conversion. Functions with unistdio extensions perform the padding based on character count rather than element count. */ case 'c': case 's': -# endif -# if NEED_PRINTF_FLAG_ZERO +# endif +# if NEED_PRINTF_FLAG_ZERO case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': -# endif +# endif pad_ourselves = 1; break; +# endif default: pad_ourselves = prec_ourselves | group_ourselves; break; @@ -6728,11 +6533,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, quick check anyway. */ if (dp->width_arg_index != ARG_NONE) { - int arg; - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); - arg = a.arg[dp->width_arg_index].a.a_int; + int arg = a.arg[dp->width_arg_index].a.a_int; width = arg; if (arg < 0) { @@ -6957,7 +6760,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* The following platforms forbid %n: - On glibc2 systems from 2004-10-18 or newer, the use of %n in format strings in writable memory may crash the - program (if compiled with _FORTIFY_SOURCE=2). + program (if compiled with _FORTIFY_SOURCE >= 2). - On macOS 10.13 or newer, the use of %n in format strings in writable memory by default crashes the program. @@ -6990,7 +6793,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, on musl libc because we would run into an swprintf() bug. See . */ fbp[1] = '\0'; -# else /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */ +# else /* AIX <= 5.1, HP-UX, Solaris <= 9, BeOS */ fbp[1] = '%'; fbp[2] = 'n'; fbp[3] = '\0'; @@ -7657,16 +7460,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, ) { /* The result string is not guaranteed to be ASCII. */ - const TCHAR_T *tmpsrc; - DCHAR_T *tmpdst; - size_t tmpdst_len; /* This code assumes that TCHAR_T is 'char'. */ static_assert (sizeof (TCHAR_T) == 1); + const TCHAR_T *tmpsrc; # if USE_SNPRINTF tmpsrc = (TCHAR_T *) (result + length); # else tmpsrc = tmp; # endif + DCHAR_T *tmpdst; + size_t tmpdst_len; # if WIDE_CHAR_VERSION /* Convert tmpsrc[0..count-1] to a freshly allocated wide character array. */ @@ -7744,9 +7547,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif { const TCHAR_T *tmpsrc; - DCHAR_T *tmpdst; - size_t n; - # if USE_SNPRINTF if (result == resultbuf) { @@ -7766,11 +7566,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tmpsrc = tmp; ENSURE_ALLOCATION (xsum (length, count)); # endif - tmpdst = result + length; + DCHAR_T *tmpdst = result + length; /* Copy backwards, because of overlapping. */ tmpsrc += count; tmpdst += count; - for (n = count; n > 0; n--) + for (size_t n = count; n > 0; n--) *--tmpdst = *--tmpsrc; } } @@ -7805,9 +7605,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* glibc prefers to compare the width against the number of characters as well, but only for numeric conversion specifiers. See - - - */ + + + */ switch (dp->conversion) { case 'd': case 'i': case 'u': @@ -7955,8 +7755,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Convert the %f result to upper case for %F. */ DCHAR_T *rp = result + length; - size_t rc; - for (rc = count; rc > 0; rc--, rp++) + for (size_t rc = count; rc > 0; rc--, rp++) if (*rp >= 'a' && *rp <= 'z') *rp = *rp - 'a' + 'A'; } @@ -7979,9 +7778,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ - DCHAR_T *memory; - - memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); + DCHAR_T *memory = + (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); if (memory != NULL) result = memory; } diff --git a/gl/vasnprintf.h b/gl/vasnprintf.h index ccd60e5e..27b9585b 100644 --- a/gl/vasnprintf.h +++ b/gl/vasnprintf.h @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2004, 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/vasprintf.c b/gl/vasprintf.c index 30aa4469..a22305b8 100644 --- a/gl/vasprintf.c +++ b/gl/vasprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/verify.h b/gl/verify.h index 3b01d7c2..ad45c39d 100644 --- a/gl/verify.h +++ b/gl/verify.h @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c index d3d7ef7a..444562e6 100644 --- a/gl/vsnprintf.c +++ b/gl/vsnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/vsnzprintf.c b/gl/vsnzprintf.c index f6e6b1d4..0d35195f 100644 --- a/gl/vsnzprintf.c +++ b/gl/vsnzprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2026 Free Software Foundation, Inc. Written by Simon Josefsson and Yoann Vandoorselaere . This file is free software: you can redistribute it and/or modify @@ -33,12 +33,9 @@ ptrdiff_t vsnzprintf (char *str, size_t size, const char *format, va_list args) { - char *output; - size_t len; size_t lenbuf = size; - - output = vasnprintf (str, &lenbuf, format, args); - len = lenbuf; + char *output = vasnprintf (str, &lenbuf, format, args); + size_t len = lenbuf; if (!output) return -1; diff --git a/gl/w32sock.h b/gl/w32sock.h index d7087a28..a3201ad9 100644 --- a/gl/w32sock.h +++ b/gl/w32sock.h @@ -1,6 +1,6 @@ /* w32sock.h --- internal auxiliary functions for Windows socket functions - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/warn-on-use.h b/gl/warn-on-use.h index c0072412..97f36ea2 100644 --- a/gl/warn-on-use.h +++ b/gl/warn-on-use.h @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published diff --git a/gl/wchar.in.h b/gl/wchar.in.h index a6c52eb9..a60a4dfc 100644 --- a/gl/wchar.in.h +++ b/gl/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007-2025 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -36,8 +36,7 @@ && ((defined _INTTYPES_INCLUDED \ && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \ || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \ - || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \ - || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H) + || (defined __MINGW32__ && defined __STRING_H_SOURCED__)) /* Special invocation convention: - Inside glibc and uClibc header files, but not MinGW. - On HP-UX 11.00 we have a sequence of nested includes @@ -47,10 +46,7 @@ therefore we cannot provide the function overrides; instead include only the system's . - With MinGW 3.22, when includes , only some part of - is actually processed, and that doesn't include 'mbstate_t'. - - On IRIX 6.5, similarly, we have an include -> , and - the latter includes . But here, we have no way to detect whether - is completely included or is still being included. */ + is actually processed, and that doesn't include 'mbstate_t'. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ /* The glibc 2.5 /usr/include/wchar.h defines __need_wint_t but never undefines @@ -62,8 +58,6 @@ #ifndef _@GUARD_PREFIX@_WCHAR_H -#define _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H - #if @HAVE_FEATURES_H@ # include /* for __GLIBC__ */ #endif @@ -82,8 +76,6 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif -#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H - #ifndef _@GUARD_PREFIX@_WCHAR_H #define _@GUARD_PREFIX@_WCHAR_H @@ -110,7 +102,7 @@ /* Applies to: functions. Cannot be used on inline functions. */ #ifndef _GL_ATTRIBUTE_DEALLOC_FREE # if defined __cplusplus && defined __GNUC__ && !defined __clang__ -/* Work around GCC bug */ +/* Work around GCC bug */ # define _GL_ATTRIBUTE_DEALLOC_FREE \ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1) # else @@ -211,18 +203,11 @@ typedef unsigned int rpl_wint_t; /* Override mbstate_t if it is too small. - On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for - implementing mbrtowc for encodings like UTF-8. On AIX, MSVC, and OpenBSD 6.0, mbrtowc needs to be overridden, but mbstate_t exists and is large enough and overriding it would cause problems in C++ mode. */ #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ # if !GNULIB_defined_mbstate_t -# if !(defined _AIX || defined _MSC_VER || defined __OpenBSD__) -typedef int rpl_mbstate_t; -# undef mbstate_t -# define mbstate_t rpl_mbstate_t -# endif # define GNULIB_defined_mbstate_t 1 # endif #endif @@ -316,7 +301,7 @@ _GL_EXTERN_C int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); # ifndef __cplusplus -_GL_EXTERN_C wchar_t *wmemchr (const wchar_t *__s, wchar_t __wc, size_t __n) +_GL_EXTERN_C wchar_t *(wmemchr) (const wchar_t *__s, wchar_t __wc, size_t __n) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3); # endif _GL_EXTERN_C wchar_t *wmemset (wchar_t *__s, wchar_t __wc, size_t __n) @@ -347,7 +332,6 @@ _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c)); _GL_CXXALIASWARN (btowc); # endif #elif defined GNULIB_POSIXCHECK -# undef btowc # if HAVE_RAW_DECL_BTOWC _GL_WARN_ON_USE (btowc, "btowc is unportable - " "use gnulib module btowc for portability"); @@ -365,8 +349,8 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - " _GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE); _GL_CXXALIAS_RPL (wctob, int, (wint_t wc)); # else -# if !defined wctob && !@HAVE_DECL_WCTOB@ -/* wctob is provided by gnulib, or wctob exists but is not declared. */ +# if !defined wctob && !@HAVE_WCTOB@ +/* wctob is provided by gnulib. */ _GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE); # endif _GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); @@ -375,7 +359,6 @@ _GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); _GL_CXXALIASWARN (wctob); # endif #elif defined GNULIB_POSIXCHECK -# undef wctob # if HAVE_RAW_DECL_WCTOB _GL_WARN_ON_USE (wctob, "wctob is unportable - " "use gnulib module wctob for portability"); @@ -402,7 +385,6 @@ _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps)); _GL_CXXALIASWARN (mbsinit); # endif #elif defined GNULIB_POSIXCHECK -# undef mbsinit # if HAVE_RAW_DECL_MBSINIT _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - " "use gnulib module mbsinit for portability"); @@ -443,7 +425,7 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - " without considering what mbsinit() does, we get test failures such as assertion "mbsinit (&iter->state)" failed */ -# if GNULIB_defined_mbstate_t /* AIX, IRIX */ +# if GNULIB_defined_mbstate_t /* AIX */ /* mbstate_t has at least 4 bytes. They are used as coded in gnulib/lib/mbrtowc.c. */ # define _GL_MBSTATE_INIT_SIZE 1 @@ -642,7 +624,6 @@ _GL_CXXALIAS_SYS (mbrtowc, size_t, _GL_CXXALIASWARN (mbrtowc); # endif #elif defined GNULIB_POSIXCHECK -# undef mbrtowc # if HAVE_RAW_DECL_MBRTOWC _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - " "use gnulib module mbrtowc for portability"); @@ -673,7 +654,6 @@ _GL_CXXALIAS_SYS (mbrlen, size_t, _GL_CXXALIASWARN (mbrlen); # endif #elif defined GNULIB_POSIXCHECK -# undef mbrlen # if HAVE_RAW_DECL_MBRLEN _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - " "use gnulib module mbrlen for portability"); @@ -714,7 +694,6 @@ _GL_CXXALIAS_SYS (mbsrtowcs, size_t, _GL_CXXALIASWARN (mbsrtowcs); # endif #elif defined GNULIB_POSIXCHECK -# undef mbsrtowcs # if HAVE_RAW_DECL_MBSRTOWCS _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - " "use gnulib module mbsrtowcs for portability"); @@ -755,7 +734,6 @@ _GL_CXXALIAS_SYS (mbsnrtowcs, size_t, _GL_CXXALIASWARN (mbsnrtowcs); # endif #elif defined GNULIB_POSIXCHECK -# undef mbsnrtowcs # if HAVE_RAW_DECL_MBSNRTOWCS _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - " "use gnulib module mbsnrtowcs for portability"); @@ -786,7 +764,6 @@ _GL_CXXALIAS_SYS (wcrtomb, size_t, _GL_CXXALIASWARN (wcrtomb); # endif #elif defined GNULIB_POSIXCHECK -# undef wcrtomb # if HAVE_RAW_DECL_WCRTOMB _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - " "use gnulib module wcrtomb for portability"); @@ -827,7 +804,6 @@ _GL_CXXALIAS_SYS (wcsrtombs, size_t, _GL_CXXALIASWARN (wcsrtombs); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsrtombs # if HAVE_RAW_DECL_WCSRTOMBS _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - " "use gnulib module wcsrtombs for portability"); @@ -872,7 +848,6 @@ _GL_CXXALIAS_SYS (wcsnrtombs, size_t, _GL_CXXALIASWARN (wcsnrtombs); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsnrtombs # if HAVE_RAW_DECL_WCSNRTOMBS _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - " "use gnulib module wcsnrtombs for portability"); @@ -900,7 +875,6 @@ _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); _GL_CXXALIASWARN (wcwidth); # endif #elif defined GNULIB_POSIXCHECK -# undef wcwidth # if HAVE_RAW_DECL_WCWIDTH _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - " "use gnulib module wcwidth for portability"); @@ -933,7 +907,6 @@ _GL_CXXALIASWARN1 (wmemchr, const wchar_t *, _GL_CXXALIASWARN (wmemchr); # endif #elif defined GNULIB_POSIXCHECK -# undef wmemchr # if HAVE_RAW_DECL_WMEMCHR _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - " "use gnulib module wmemchr for portability"); @@ -970,7 +943,6 @@ _GL_CXXALIAS_SYS (wmemcmp, int, _GL_CXXALIASWARN (wmemcmp); # endif #elif defined GNULIB_POSIXCHECK -# undef wmemcmp # if HAVE_RAW_DECL_WMEMCMP _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - " "use gnulib module wmemcmp for portability"); @@ -994,7 +966,6 @@ _GL_CXXALIAS_SYS (wmemcpy, wchar_t *, _GL_CXXALIASWARN (wmemcpy); # endif #elif defined GNULIB_POSIXCHECK -# undef wmemcpy # if HAVE_RAW_DECL_WMEMCPY _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - " "use gnulib module wmemcpy for portability"); @@ -1017,7 +988,6 @@ _GL_CXXALIAS_SYS (wmemmove, wchar_t *, _GL_CXXALIASWARN (wmemmove); # endif #elif defined GNULIB_POSIXCHECK -# undef wmemmove # if HAVE_RAW_DECL_WMEMMOVE _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - " "use gnulib module wmemmove for portability"); @@ -1053,7 +1023,6 @@ _GL_CXXALIAS_SYS (wmempcpy, wchar_t *, _GL_CXXALIASWARN (wmempcpy); # endif #elif defined GNULIB_POSIXCHECK -# undef wmempcpy # if HAVE_RAW_DECL_WMEMPCPY _GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - " "use gnulib module wmempcpy for portability"); @@ -1072,7 +1041,6 @@ _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); _GL_CXXALIASWARN (wmemset); # endif #elif defined GNULIB_POSIXCHECK -# undef wmemset # if HAVE_RAW_DECL_WMEMSET _GL_WARN_ON_USE (wmemset, "wmemset is unportable - " "use gnulib module wmemset for portability"); @@ -1090,7 +1058,6 @@ _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); _GL_CXXALIASWARN (wcslen); # endif #elif defined GNULIB_POSIXCHECK -# undef wcslen # if HAVE_RAW_DECL_WCSLEN _GL_WARN_ON_USE (wcslen, "wcslen is unportable - " "use gnulib module wcslen for portability"); @@ -1110,7 +1077,6 @@ _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen), _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)); _GL_CXXALIASWARN (wcsnlen); #elif defined GNULIB_POSIXCHECK -# undef wcsnlen # if HAVE_RAW_DECL_WCSNLEN _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - " "use gnulib module wcsnlen for portability"); @@ -1130,7 +1096,6 @@ _GL_CXXALIAS_SYS (wcscpy, wchar_t *, _GL_CXXALIASWARN (wcscpy); # endif #elif defined GNULIB_POSIXCHECK -# undef wcscpy # if HAVE_RAW_DECL_WCSCPY _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - " "use gnulib module wcscpy for portability"); @@ -1151,7 +1116,6 @@ _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *restrict dest, const wchar_t *restrict src)); _GL_CXXALIASWARN (wcpcpy); #elif defined GNULIB_POSIXCHECK -# undef wcpcpy # if HAVE_RAW_DECL_WCPCPY _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - " "use gnulib module wcpcpy for portability"); @@ -1175,7 +1139,6 @@ _GL_CXXALIAS_SYS (wcsncpy, wchar_t *, _GL_CXXALIASWARN (wcsncpy); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsncpy # if HAVE_RAW_DECL_WCSNCPY _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - " "use gnulib module wcsncpy for portability"); @@ -1199,7 +1162,6 @@ _GL_CXXALIAS_SYS (wcpncpy, wchar_t *, const wchar_t *restrict src, size_t n)); _GL_CXXALIASWARN (wcpncpy); #elif defined GNULIB_POSIXCHECK -# undef wcpncpy # if HAVE_RAW_DECL_WCPNCPY _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - " "use gnulib module wcpncpy for portability"); @@ -1219,7 +1181,6 @@ _GL_CXXALIAS_SYS (wcscat, wchar_t *, _GL_CXXALIASWARN (wcscat); # endif #elif defined GNULIB_POSIXCHECK -# undef wcscat # if HAVE_RAW_DECL_WCSCAT _GL_WARN_ON_USE (wcscat, "wcscat is unportable - " "use gnulib module wcscat for portability"); @@ -1258,7 +1219,6 @@ _GL_CXXALIAS_SYS (wcsncat, wchar_t *, _GL_CXXALIASWARN (wcsncat); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsncat # if HAVE_RAW_DECL_WCSNCAT _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - " "use gnulib module wcsncat for portability"); @@ -1287,7 +1247,6 @@ _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); _GL_CXXALIASWARN (wcscmp); # endif #elif defined GNULIB_POSIXCHECK -# undef wcscmp # if HAVE_RAW_DECL_WCSCMP _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - " "use gnulib module wcscmp for portability"); @@ -1324,7 +1283,6 @@ _GL_CXXALIAS_SYS (wcsncmp, int, _GL_CXXALIASWARN (wcsncmp); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsncmp # if HAVE_RAW_DECL_WCSNCMP _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - " "use gnulib module wcsncmp for portability"); @@ -1344,7 +1302,6 @@ _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2), _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)); _GL_CXXALIASWARN (wcscasecmp); #elif defined GNULIB_POSIXCHECK -# undef wcscasecmp # if HAVE_RAW_DECL_WCSCASECMP _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - " "use gnulib module wcscasecmp for portability"); @@ -1366,7 +1323,6 @@ _GL_CXXALIAS_SYS (wcsncasecmp, int, (const wchar_t *s1, const wchar_t *s2, size_t n)); _GL_CXXALIASWARN (wcsncasecmp); #elif defined GNULIB_POSIXCHECK -# undef wcsncasecmp # if HAVE_RAW_DECL_WCSNCASECMP _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - " "use gnulib module wcsncasecmp for portability"); @@ -1385,7 +1341,6 @@ _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); _GL_CXXALIASWARN (wcscoll); # endif #elif defined GNULIB_POSIXCHECK -# undef wcscoll # if HAVE_RAW_DECL_WCSCOLL _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - " "use gnulib module wcscoll for portability"); @@ -1407,7 +1362,6 @@ _GL_CXXALIAS_SYS (wcsxfrm, size_t, _GL_CXXALIASWARN (wcsxfrm); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsxfrm # if HAVE_RAW_DECL_WCSXFRM _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - " "use gnulib module wcsxfrm for portability"); @@ -1458,7 +1412,6 @@ _GL_FUNCDECL_SYS (wcsdup, wchar_t *, # endif # endif # if defined GNULIB_POSIXCHECK -# undef wcsdup # if HAVE_RAW_DECL_WCSDUP _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " "use gnulib module wcsdup for portability"); @@ -1518,7 +1471,6 @@ _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); _GL_CXXALIASWARN (wcschr); # endif #elif defined GNULIB_POSIXCHECK -# undef wcschr # if HAVE_RAW_DECL_WCSCHR _GL_WARN_ON_USE (wcschr, "wcschr is unportable - " "use gnulib module wcschr for portability"); @@ -1549,7 +1501,6 @@ _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); _GL_CXXALIASWARN (wcsrchr); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsrchr # if HAVE_RAW_DECL_WCSRCHR _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - " "use gnulib module wcsrchr for portability"); @@ -1569,7 +1520,6 @@ _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); _GL_CXXALIASWARN (wcscspn); # endif #elif defined GNULIB_POSIXCHECK -# undef wcscspn # if HAVE_RAW_DECL_WCSCSPN _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - " "use gnulib module wcscspn for portability"); @@ -1589,7 +1539,6 @@ _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); _GL_CXXALIASWARN (wcsspn); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsspn # if HAVE_RAW_DECL_WCSSPN _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - " "use gnulib module wcsspn for portability"); @@ -1623,7 +1572,6 @@ _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, _GL_CXXALIASWARN (wcspbrk); # endif #elif defined GNULIB_POSIXCHECK -# undef wcspbrk # if HAVE_RAW_DECL_WCSPBRK _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - " "use gnulib module wcspbrk for portability"); @@ -1676,7 +1624,6 @@ _GL_CXXALIASWARN1 (wcsstr, const wchar_t *, _GL_CXXALIASWARN (wcsstr); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsstr # if HAVE_RAW_DECL_WCSSTR _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - " "use gnulib module wcsstr for portability"); @@ -1711,7 +1658,6 @@ _GL_CXXALIAS_SYS (wcstok, wchar_t *, _GL_CXXALIASWARN (wcstok); # endif #elif defined GNULIB_POSIXCHECK -# undef wcstok # if HAVE_RAW_DECL_WCSTOK _GL_WARN_ON_USE (wcstok, "wcstok is unportable - " "use gnulib module wcstok for portability"); @@ -1741,7 +1687,6 @@ _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); _GL_CXXALIASWARN (wcswidth); # endif #elif defined GNULIB_POSIXCHECK -# undef wcswidth # if HAVE_RAW_DECL_WCSWIDTH _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - " "use gnulib module wcswidth for portability"); @@ -1783,7 +1728,6 @@ _GL_CXXALIAS_SYS (wcsftime, size_t, _GL_CXXALIASWARN (wcsftime); # endif #elif defined GNULIB_POSIXCHECK -# undef wcsftime # if HAVE_RAW_DECL_WCSFTIME _GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - " "use gnulib module wcsftime for portability"); diff --git a/gl/wcrtomb.c b/gl/wcrtomb.c index c9ebcf0c..a9b8de78 100644 --- a/gl/wcrtomb.c +++ b/gl/wcrtomb.c @@ -1,5 +1,5 @@ /* Convert wide character to multibyte character. - Copyright (C) 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2008-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This file is free software: you can redistribute it and/or modify @@ -36,7 +36,7 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps) return (size_t)(-1); } -#if !HAVE_WCRTOMB /* IRIX 6.5 */ \ +#if !HAVE_WCRTOMB /* HP-UX 11.00, mingw */ \ || WCRTOMB_RETVAL_BUG /* Solaris 11.3, MSVC */ \ || WCRTOMB_C_LOCALE_BUG /* Android */ if (s == NULL) @@ -62,7 +62,7 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps) # else return wcrtomb (s, wc, ps); # endif -#else /* IRIX 6.5 */ +#else /* HP-UX 11.00, mingw */ /* Fallback for platforms that don't have wcrtomb(). Implement on top of wctomb(). This code is not multithread-safe. */ diff --git a/gl/wctype-h.c b/gl/wctype-h.c index 098014a9..f773d0cb 100644 --- a/gl/wctype-h.c +++ b/gl/wctype-h.c @@ -1,6 +1,6 @@ /* Inline functions for . - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/wctype-impl.h b/gl/wctype-impl.h index 8bb83be7..675ea31c 100644 --- a/gl/wctype-impl.h +++ b/gl/wctype-impl.h @@ -1,5 +1,5 @@ /* Get descriptor for a wide character property. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify @@ -27,11 +27,11 @@ wctype (const char* name) switch (name[2]) { case 'n': - if (strcmp (name + 3, "um") == 0) + if (streq (name + 3, "um")) return (wctype_t) iswalnum; break; case 'p': - if (strcmp (name + 3, "ha") == 0) + if (streq (name + 3, "ha")) return (wctype_t) iswalpha; break; default: @@ -43,34 +43,34 @@ wctype (const char* name) } break; case 'b': - if (strcmp (name + 1, "lank") == 0) + if (streq (name + 1, "lank")) return (wctype_t) iswblank; break; case 'c': - if (strcmp (name + 1, "ntrl") == 0) + if (streq (name + 1, "ntrl")) return (wctype_t) iswcntrl; break; case 'd': - if (strcmp (name + 1, "igit") == 0) + if (streq (name + 1, "igit")) return (wctype_t) iswdigit; break; case 'g': - if (strcmp (name + 1, "raph") == 0) + if (streq (name + 1, "raph")) return (wctype_t) iswgraph; break; case 'l': - if (strcmp (name + 1, "ower") == 0) + if (streq (name + 1, "ower")) return (wctype_t) iswlower; break; case 'p': switch (name[1]) { case 'r': - if (strcmp (name + 2, "int") == 0) + if (streq (name + 2, "int")) return (wctype_t) iswprint; break; case 'u': - if (strcmp (name + 2, "nct") == 0) + if (streq (name + 2, "nct")) return (wctype_t) iswpunct; break; default: @@ -78,15 +78,15 @@ wctype (const char* name) } break; case 's': - if (strcmp (name + 1, "pace") == 0) + if (streq (name + 1, "pace")) return (wctype_t) iswspace; break; case 'u': - if (strcmp (name + 1, "pper") == 0) + if (streq (name + 1, "pper")) return (wctype_t) iswupper; break; case 'x': - if (strcmp (name + 1, "digit") == 0) + if (streq (name + 1, "digit")) return (wctype_t) iswxdigit; break; default: diff --git a/gl/wctype.c b/gl/wctype.c index b421ad38..205b244c 100644 --- a/gl/wctype.c +++ b/gl/wctype.c @@ -1,5 +1,5 @@ /* Get descriptor for a wide character property. - Copyright (C) 2011-2025 Free Software Foundation, Inc. + Copyright (C) 2011-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This file is free software: you can redistribute it and/or modify diff --git a/gl/wctype.in.h b/gl/wctype.in.h index aa4a8e7d..15f310ce 100644 --- a/gl/wctype.in.h +++ b/gl/wctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -264,27 +264,7 @@ rpl_towupper (wint_t wc) # else -/* IRIX 5.3 has macros but no functions, its isw* macros refer to an - undefined variable _ctmp_ and to macros like _P, and they - refer to system functions like _iswctype that are not in the - standard C library. Rather than try to get ancient buggy - implementations like this to work, just disable them. */ -# undef iswalnum -# undef iswalpha -# undef iswblank -# undef iswcntrl -# undef iswdigit -# undef iswgraph -# undef iswlower -# undef iswprint -# undef iswpunct -# undef iswspace -# undef iswupper -# undef iswxdigit -# undef towlower -# undef towupper - -/* Linux libc5 has and the functions but they are broken. */ +/* On some old platforms the functions are broken. */ # if @REPLACE_ISWCNTRL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define iswalnum rpl_iswalnum @@ -673,7 +653,6 @@ _GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name)); _GL_CXXALIASWARN (wctype); # endif #elif defined GNULIB_POSIXCHECK -# undef wctype # if HAVE_RAW_DECL_WCTYPE _GL_WARN_ON_USE (wctype, "wctype is unportable - " "use gnulib module wctype for portability"); @@ -701,7 +680,6 @@ _GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc)); _GL_CXXALIASWARN (iswctype); # endif #elif defined GNULIB_POSIXCHECK -# undef iswctype # if HAVE_RAW_DECL_ISWCTYPE _GL_WARN_ON_USE (iswctype, "iswctype is unportable - " "use gnulib module iswctype for portability"); @@ -755,7 +733,6 @@ _GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name)); _GL_CXXALIASWARN (wctrans); # endif #elif defined GNULIB_POSIXCHECK -# undef wctrans # if HAVE_RAW_DECL_WCTRANS _GL_WARN_ON_USE (wctrans, "wctrans is unportable - " "use gnulib module wctrans for portability"); @@ -783,7 +760,6 @@ _GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc)); _GL_CXXALIASWARN (towctrans); # endif #elif defined GNULIB_POSIXCHECK -# undef towctrans # if HAVE_RAW_DECL_TOWCTRANS _GL_WARN_ON_USE (towctrans, "towctrans is unportable - " "use gnulib module towctrans for portability"); diff --git a/gl/wcwidth.c b/gl/wcwidth.c index 6e7141d0..ffcc9778 100644 --- a/gl/wcwidth.c +++ b/gl/wcwidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a character. - Copyright (C) 2006-2007, 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-initguard.h b/gl/windows-initguard.h index 4f45e5bb..e7da4735 100644 --- a/gl/windows-initguard.h +++ b/gl/windows-initguard.h @@ -1,5 +1,5 @@ /* Init guards, somewhat like spinlocks (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-mutex.c b/gl/windows-mutex.c index 87b75735..a8460fab 100644 --- a/gl/windows-mutex.c +++ b/gl/windows-mutex.c @@ -1,5 +1,5 @@ /* Plain mutexes (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-mutex.h b/gl/windows-mutex.h index dc6b41e0..38eab652 100644 --- a/gl/windows-mutex.h +++ b/gl/windows-mutex.h @@ -1,5 +1,5 @@ /* Plain mutexes (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-once.c b/gl/windows-once.c index bd9e672a..b3c8a982 100644 --- a/gl/windows-once.c +++ b/gl/windows-once.c @@ -1,5 +1,5 @@ /* Once-only control (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-once.h b/gl/windows-once.h index b27ae538..886ddb45 100644 --- a/gl/windows-once.h +++ b/gl/windows-once.h @@ -1,5 +1,5 @@ /* Once-only control (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-recmutex.c b/gl/windows-recmutex.c index 09341d56..fd6f04db 100644 --- a/gl/windows-recmutex.c +++ b/gl/windows-recmutex.c @@ -1,5 +1,5 @@ /* Plain recursive mutexes (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-recmutex.h b/gl/windows-recmutex.h index 25a883d4..1b5773c1 100644 --- a/gl/windows-recmutex.h +++ b/gl/windows-recmutex.h @@ -1,5 +1,5 @@ /* Plain recursive mutexes (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/windows-rwlock.c b/gl/windows-rwlock.c index 313f14ca..4a5fbfc2 100644 --- a/gl/windows-rwlock.c +++ b/gl/windows-rwlock.c @@ -1,5 +1,5 @@ /* Read-write locks (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -46,9 +46,6 @@ glwthread_waitqueue_init (glwthread_waitqueue_t *wq) static HANDLE glwthread_waitqueue_add (glwthread_waitqueue_t *wq) { - HANDLE event; - unsigned int index; - if (wq->count == wq->alloc) { unsigned int new_alloc = 2 * wq->alloc + 1; @@ -64,14 +61,13 @@ glwthread_waitqueue_add (glwthread_waitqueue_t *wq) unsigned int old_count = wq->count; unsigned int old_alloc = wq->alloc; unsigned int old_offset = wq->offset; - unsigned int i; if (old_offset + old_count > old_alloc) { unsigned int limit = old_offset + old_count - old_alloc; - for (i = 0; i < limit; i++) + for (unsigned int i = 0; i < limit; i++) new_array[old_alloc + i] = new_array[i]; } - for (i = 0; i < old_count; i++) + for (unsigned int i = 0; i < old_count; i++) new_array[i] = new_array[old_offset + i]; wq->offset = 0; } @@ -80,11 +76,11 @@ glwthread_waitqueue_add (glwthread_waitqueue_t *wq) } /* Whether the created event is a manual-reset one or an auto-reset one, does not matter, since we will wait on it only once. */ - event = CreateEvent (NULL, TRUE, FALSE, NULL); + HANDLE event = CreateEvent (NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) /* No way to allocate an event. */ return INVALID_HANDLE_VALUE; - index = wq->offset + wq->count; + unsigned int index = wq->offset + wq->count; if (index >= wq->alloc) index -= wq->alloc; wq->array[index] = event; @@ -107,9 +103,7 @@ glwthread_waitqueue_notify_first (glwthread_waitqueue_t *wq) static void glwthread_waitqueue_notify_all (glwthread_waitqueue_t *wq) { - unsigned int i; - - for (i = 0; i < wq->count; i++) + for (unsigned int i = 0; i < wq->count; i++) { unsigned int index = wq->offset + i; if (index >= wq->alloc) @@ -160,10 +154,9 @@ glwthread_rwlock_rdlock (glwthread_rwlock_t *lock) HANDLE event = glwthread_waitqueue_add (&lock->waiting_readers); if (event != INVALID_HANDLE_VALUE) { - DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ - result = WaitForSingleObject (event, INFINITE); + DWORD result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); @@ -217,10 +210,9 @@ glwthread_rwlock_wrlock (glwthread_rwlock_t *lock) HANDLE event = glwthread_waitqueue_add (&lock->waiting_writers); if (event != INVALID_HANDLE_VALUE) { - DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ - result = WaitForSingleObject (event, INFINITE); + DWORD result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); diff --git a/gl/windows-rwlock.h b/gl/windows-rwlock.h index b1b4063a..5b0a6613 100644 --- a/gl/windows-rwlock.h +++ b/gl/windows-rwlock.h @@ -1,5 +1,5 @@ /* Read-write locks (native Windows implementation). - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/xalloc-die.c b/gl/xalloc-die.c index db1ee8ff..1a51976e 100644 --- a/gl/xalloc-die.c +++ b/gl/xalloc-die.c @@ -1,6 +1,6 @@ /* Report a memory allocation failure and exit. - Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2025 Free Software + Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -26,7 +26,7 @@ #include "exitfail.h" #include "gettext.h" -#define _(msgid) dgettext ("gnulib", msgid) +#define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) void xalloc_die (void) diff --git a/gl/xalloc-oversized.h b/gl/xalloc-oversized.h index 0f66bd06..cecdaec5 100644 --- a/gl/xalloc-oversized.h +++ b/gl/xalloc-oversized.h @@ -1,6 +1,6 @@ /* xalloc-oversized.h -- memory allocation size checking - Copyright (C) 1990-2000, 2003-2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/gl/xalloc.h b/gl/xalloc.h index 438e5caa..d3948270 100644 --- a/gl/xalloc.h +++ b/gl/xalloc.h @@ -1,6 +1,6 @@ /* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-2000, 2003-2004, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/xmalloc.c b/gl/xmalloc.c index 8a715807..6adc43c0 100644 --- a/gl/xmalloc.c +++ b/gl/xmalloc.c @@ -1,6 +1,6 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-2000, 2002-2006, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2002-2006, 2008-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,10 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include - #define XALLOC_INLINE _GL_EXTERN_INLINE - +#include #include "xalloc.h" #include "ialloc.h" @@ -29,7 +27,13 @@ #include #include -static void * _GL_ATTRIBUTE_PURE +/* Pacify GCC up to at least 15.2, which otherwise would incorrectly + complain about check_nonnull. */ +#if _GL_GNUC_PREREQ (4, 6) +# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif + +static void * check_nonnull (void *p) { if (!p) @@ -224,13 +228,13 @@ x2nrealloc (void *p, size_t *pn, size_t s) void * xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s) { - idx_t n0 = *pn; - /* The approximate size to use for initial small allocation requests. This is the largest "small" request for the GNU C library malloc. */ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 }; + idx_t n0 = *pn; + /* If the array is tiny, grow it to about (but no greater than) DEFAULT_MXFAST bytes. Otherwise, grow it by about 50%. Adjust the growth according to three constraints: N_INCR_MIN, diff --git a/gl/xsize.c b/gl/xsize.c index cd75b606..22856eb6 100644 --- a/gl/xsize.c +++ b/gl/xsize.c @@ -1,6 +1,6 @@ /* Checked size_t computations. - Copyright (C) 2012-2025 Free Software Foundation, Inc. + Copyright (C) 2012-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -15,7 +15,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -#include - #define XSIZE_INLINE _GL_EXTERN_INLINE +#include #include "xsize.h" diff --git a/gl/xsize.h b/gl/xsize.h index ee9c5680..b76cf49f 100644 --- a/gl/xsize.h +++ b/gl/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003, 2008-2025 Free Software Foundation, Inc. + Copyright (C) 2003, 2008-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as -- cgit v1.2.3-74-g34f1