summaryrefslogtreecommitdiff
path: root/m4
Commit message (Collapse)AuthorAgeFilesLines
...
* quotearg: Use 'restrict'.Bruno Haible2020-02-231-1/+2
| | | | | * lib/quotearg.h (quotearg_buffer): Use 'restrict'. * m4/quotearg.m4 (gl_QUOTEARG): Require AC_C_RESTRICT.
* parse-datetime: Use 'restrict'.Bruno Haible2020-02-231-1/+2
| | | | | | * lib/parse-datetime.h (parse_datetime, parse_datetime2): Use 'restrict'. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Require AC_C_RESTRICT.
* nstrftime: Use 'restrict'.Bruno Haible2020-02-231-1/+3
| | | | | * lib/strftime.h (nstrftime): Use 'restrict'. * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Require AC_C_RESTRICT.
* memcoll: Use 'restrict'.Bruno Haible2020-02-231-2/+6
| | | | | * lib/memcoll.h (memcoll): Use 'restrict'. * m4/memcoll.m4 (gl_MEMCOLL): Require AC_C_RESTRICT.
* fchmodat, lchmod: simplifyPaul Eggert2020-02-232-56/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that we may have overengineered lchmod and fchmodat, in that the code was prepared for some hypothetical platforms but was so complicated that it was hard to understand. I attempted to improve the situation by simplifying the code when this simplification should not hurt on real platforms; we can re-add complexity later to port to platforms I didn’t know about. * lib/fchmodat.c (fchmodat): * lib/lchmod.c (lchmod): Put the ‘defined __linux__ || defined __ANDROID__’ #ifdef only around the /proc code that needs it. * lib/fchmodat.c (fchmodat): Coalese calls to orig_fchmodat. * lib/lchmod.c (__need_system_sys_stat_h): Omit; no longer needed. Do not include <config.h> twice. (orig_lchmod) [HAVE_LCHMOD]: Remove, since we need not wrap lchmod on any known hosts. (lchmod): Do not defer to fchmodat, so that the lchmod module need not depend on the fchmodat module (which is a circular dependency). Do not use openat, since ‘open’ suffices. Coalesce calls to lchmod/chmod. * lib/lchmod.c, lib/sys_stat.in.h (lchmod): * m4/sys_stat_h.m4 (REPLACE_FSTAT): * modules/lchmod (Depends-on, configure.ac): * modules/sys_stat (Depends-on): Do not worry about replacing lchmod, since that shouldn’t happen. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not check for fchmodat. Do not worry about whether lchmod works on non-symlinks, since every known lchmod works on non-symlinks. * modules/lchmod (Depends-on): Remove circular dependency on fchmodat.
* Use 'restrict' in all POSIX function declarations.Bruno Haible2020-02-2213-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/iconv.in.h (iconv): Use 'restrict'. * lib/inttypes.in.h (strtoimax, strtoumax): Likewise. * lib/monetary.in.h (strfmon_l): Likewise. * lib/pthread.in.h (pthread_create, pthread_mutex_init, pthread_mutexattr_gettype, pthread_mutexattr_getrobust, pthread_mutex_timedlock, pthread_rwlock_init, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock, pthread_cond_init, pthread_cond_wait, pthread_cond_timedwait): Likewise. * lib/search.in.h (tdelete): Likewise. * lib/signal.in.h (pthread_sigmask, sigprocmask): Likewise. * lib/stdio.in.h (dprintf, fgets, fopen, fprintf, fputs, fread, freopen, fscanf, fwrite, getdelim, getline, printf, scanf, snprintf, sprintf, vdprintf, vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf): Likewise. * lib/stdlib.in.h (mbtowc, realpath, strtod, strtold, strtoll, strtoull): Likewise. * lib/string.in.h (strncat): Likewise. * lib/sys_socket.in.h (accept, getpeername, getsockname, getsockopt, recvfrom): Likewise. * lib/sys_stat.in.h (fstatat, lstat, stat): Likewise. * lib/time.in.h (strftime): Likewise. * lib/unistd.in.h (readlink, readlinkat): Likewise. * lib/wchar.in.h (mbrtowc, mbrlen, mbsrtowcs, mbsnrtowcs, wcrtomb, wcsrtombs, wcsnrtombs, wmemcpy, wcscpy, wcpcpy, wcsncpy, wcpncpy, wcscat, wcsncat, wcsxfrm, wcsstr, wcstok, wcsftime): Likewise. * m4/iconv_h.m4 (gl_ICONV_H): Require AC_C_RESTRICT. * m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Likewise. * m4/monetary_h.m4 (gl_MONETARY_H): Likewise. * m4/search_h.m4 (gl_SEARCH_H): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Make consistent with the other *_h.m4 files. * m4/time_h.m4 (gl_HEADER_TIME_H): Likewise.
* largefile: remove _DARWIN_USE_64_BIT_INODEPaul Eggert2020-02-211-3/+0
| | | | | | | | | | It’s not needed in currently-supported macOS versions, and was problematic anyway in MacOS X 10.5 which was the only version that could use it. Problem reported by Peter Eisentraut in: https://lists.gnu.org/r/bug-autoconf/2020-02/msg00004.html * m4/largefile.m4 (AC_SYS_LARGEFILE): Don’t define _DARWIN_USE_64_BIT_INODE. This syncs with Autoconf master.
* fchmodat: Make more future-proof.Bruno Haible2020-02-161-2/+13
| | | | | | | | | | * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): Define NEED_FCHMODAT_NONSYMLINK_FIX. (gl_PREREQ_FCHMODAT): New macro. * lib/fchmodat.c (fchmodat): Test NEED_FCHMODAT_NONSYMLINK_FIX. Access /proc only on Linux. Return EOPNOTSUPP only on Linux and on platforms without lchmod function. * modules/fchmodat (configure.ac): Invoke gl_PREREQ_FCHMODAT.
* lchmod: Make more future-proof.Bruno Haible2020-02-161-2/+13
| | | | | | | | | | * m4/lchmod.m4 (gl_FUNC_LCHMOD): Define NEED_LCHMOD_NONSYMLINK_FIX. (gl_PREREQ_LCHMOD): New macro. * lib/lchmod.c (orig_lchmod): New function. (lchmod): Test NEED_LCHMOD_NONSYMLINK_FIX. Access /proc only on Linux. Return EOPNOTSUPP only on Linux and on platforms without lchmod function. * modules/lchmod (configure.ac): Invoke gl_PREREQ_LCHMOD.
* xnanosleep: prefer pause, and get remaining timePaul Eggert2020-02-161-2/+2
| | | | | | | | | | Problem reported by Vladimir Panteleev in: https://lists.gnu.org/r/bug-gnulib/2020-02/msg00052.html * lib/xnanosleep.c: Include intprops.h, unistd.h. (xnanosleep) [HAVE_PAUSE]: Prefer pause when sleeping infinitely. (xnanosleep): Obtain remaining time when nanosleep is interrupted. * m4/xnanosleep.m4 (gl_XNANOSLEEP): Check for 'pause'. * modules/xnanosleep (Depends-on): Add intprops, unistd.
* lchmod: Improve cross-compilation guess.Bruno Haible2020-02-161-2/+9
| | | | | * m4/lchmod.m4 (gl_FUNC_LCHMOD): Require AC_CANONICAL_HOST. When cross-compiling, guess depending on the platform.
* copysignf: Fix link error on HP-UX with cc.Bruno Haible2020-02-111-2/+8
| | | | | * m4/copysignf.m4 (gl_FUNC_COPYSIGNF): Require AC_CANONICAL_HOST. On HP-UX, set COPYSIGNF_LIBM to -lm.
* fchmodat: Improve cross-compilation guesses.Bruno Haible2020-02-081-3/+11
| | | | | | * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): Require AC_CANONICAL_HOST. When cross-compiling, guess depending on the platform. * doc/posix-functions/fchmodat.texi: Clarify.
* fchmodat: AT_SYMLINK_NOFOLLOW fix for non-symlinksPaul Eggert2020-02-073-6/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lchmod, and fchmodat with AT_SYMLINK_NOFOLLOW, so that they act like chmod on non-symlinks. * NEWS: * doc/glibc-functions/lchmod.texi (lchmod): * doc/posix-functions/fchmodat.texi (fchmodat): Mention this. * lib/fchmodat.c: Define __need_system_sys_stat_h before including config.h, and undef it after including sys/stat.h the first time. Include fcntl.h, stdio.h, unistd.h, intprops.h, and include sys/stat.h a second time after defining orig_fchmodat. (orig_fchmodat) [HAVE_FCHMODAT]: New function. (fchmodat) [HAVE_FCHMODAT]: Work around the AT_SYMLINK_NOFOLLOW bug. * lib/lchmod.c: New file. * lib/sys_stat.in.h (fchmodat, lchmod): Support replacing these functions. * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): If fchmodat exists, test that AT_SYMLINK_NOFOLLOW works on non-symlinks. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Check for lstat. Test that lchmod works on non-symlinks. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Default REPLACE_FCHMODAT and REPLACE_LCHMOD to 0. * modules/fchmodat (Depends-on): Add fstatat, intprops, lchmod, unistd. (Depends-on, configure.ac): Check REPLACE_FCHMODAT too. * modules/lchmod (Files): Add lib/lchmod.c. (Depends-on): Add errno, fcntl-h, fchmodat, intprops, lstat, unistd. (configure.ac): Compile lchmod.c if needed. (lib_SOURCES): Add lchmod.c. * modules/sys_stat (sys/stat.h): Substitute REPLACE_FCHMODAT and REPLACE_LCHMOD. * tests/test-fchmodat.c: Include fcntl.h, sys/stat.h. (main): Test fchmodat with AT_SYMLINK_NOFOLLOW on non-symlinks.
* Port _Noreturn to older ClangPaul Eggert2020-02-041-2/+5
| | | | | | | | | | | | | | | Problem reported by Jeffery Walton in: https://lists.gnu.org/r/bug-gnulib/2020-02/msg00013.html * lib/_Noreturn.h (_Noreturn): * m4/gnulib-common.m4 (gl_COMMON_BODY): Assume _Noreturn works in Clang 3.5 and later. It is documented to work in Clang 3.5: http://releases.llvm.org/3.5.0/tools/clang/docs/AttributeReference.html and is not documented in Clang 3.4: https://releases.llvm.org/3.4/tools/clang/docs/LanguageExtensions.html Apple sets __clang_version__ to a different value, so use __apple_build_version__ there. See: https://lists.gnu.org/r/bug-gnulib/2020-02/msg00017.html
* ansi-c++-opt: Set CXXFLAGS to "-g -O2" by default.Bruno Haible2020-02-011-1/+11
| | | | | * m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Determine CXXFLAGS like AC_PROG_CXX does.
* uchar: Preparations for modules c32isalnum, ..., c32isxdigit.Bruno Haible2020-01-251-1/+13
| | | | | | | | | | | | | | | | | | | * lib/uchar.in.h (c32isalnum, c32isalpha, c32isblank, c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint, c32ispunct, c32isspace, c32isupper, c32isxdigit): New declarations. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32ISALNUM, GNULIB_C32ISALPHA, GNULIB_C32ISBLANK, GNULIB_C32ISCNTRL, GNULIB_C32ISDIGIT, GNULIB_C32ISGRAPH, GNULIB_C32ISLOWER, GNULIB_C32ISPRINT, GNULIB_C32ISPUNCT, GNULIB_C32ISSPACE, GNULIB_C32ISUPPER, GNULIB_C32ISXDIGIT. * modules/uchar (Makefile.am): Substitute GNULIB_C32ISALNUM, GNULIB_C32ISALPHA, GNULIB_C32ISBLANK, GNULIB_C32ISCNTRL, GNULIB_C32ISDIGIT, GNULIB_C32ISGRAPH, GNULIB_C32ISLOWER, GNULIB_C32ISPRINT, GNULIB_C32ISPUNCT, GNULIB_C32ISSPACE, GNULIB_C32ISUPPER, GNULIB_C32ISXDIGIT. * tests/test-uchar-c++.cc: Test the signature of c32isalnum, c32isalpha, c32isblank, c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint, c32ispunct, c32isspace, c32isupper, c32isxdigit.
* iswxdigit: New module.Bruno Haible2020-01-252-1/+116
| | | | | | | | | | | | | | * m4/iswxdigit.m4: New file. * lib/wctype.in.h (iswxdigit): Potentially override. (iswxdigit, rpl_iswxdigit): Test REPLACE_ISWXDIGIT, not REPLACE_ISWCNTRL. Rely on ISO C compliant definition. * lib/iswxdigit.c: New file. * m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWXDIGIT, REPLACE_ISWXDIGIT. * modules/wctype-h (Makefile.am): Substitute GNULIB_ISWXDIGIT, REPLACE_ISWXDIGIT. * modules/iswxdigit: New file. * doc/posix-functions/iswxdigit.texi: Mention the portability problem.
* iswdigit: New module.Bruno Haible2020-01-252-1/+125
| | | | | | | | | | | | | * m4/iswdigit.m4: New file. * lib/wctype.in.h (iswdigit): Potentially override. (iswdigit, rpl_iswdigit): Test REPLACE_ISWDIGIT, not REPLACE_ISWCNTRL. * lib/iswdigit.c: New file. * m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWDIGIT, REPLACE_ISWDIGIT. * modules/wctype-h (Makefile.am): Substitute GNULIB_ISWDIGIT, REPLACE_ISWDIGIT. * modules/iswdigit: New file. * doc/posix-functions/iswdigit.texi: Mention the portability problem.
* hard-locale tests: Make it easy to reuse the musl test.Bruno Haible2020-01-251-0/+18
| | | | | | * m4/musl.m4: New file, extracted from modules/hard-locale-tests. * modules/hard-locale-tests (Files): Add it. (configure.ac): Invoke gl_MUSL_LIBC.
* mbrtoc32: Add note about FreeBSD 12.Bruno Haible2020-01-211-7/+11
| | | | | | * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Guess no also on FreeBSD. * doc/posix-functions/mbrtoc32.texi: Mention that FreeBSD 12 is also affected.
* threadlib: Disable use of weak symbols on FreeBSD 11.Bruno Haible2020-01-201-1/+26
| | | | | | | | Reported by Tim Rühsen <tim.ruehsen@gmx.de> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00061.html>. * m4/threadlib.m4 (gl_WEAK_SYMBOLS): Require AC_CANONICAL_HOST. Test against a bug in FreeBSD 11.
* Rename ~~gnulib.m4 to zzgnulib.m4.Bruno Haible2020-01-182-2/+2
| | | | | | | | Suggested by Paul Eggert. * m4/zzgnulib.m4: Renamed from m4/~~gnulib.m4. * gnulib-tool (func_get_filelist): Update. * pygnulib/GLModuleSystem.py (getFiles): Likewise.
* Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)".Bruno Haible2020-01-181-8/+13
| | | | | | | | Reported by Mats Erik Andersson <mats.andersson@gisladisker.se> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00109.html>. * m4/00gnulib.m4 (gl_COMPILER_CLANG): Use _AC_COMPILE_IFELSE, not AC_EGREP_CPP.
* Ensure Automake does not drop ~~gnulib.m4.Bruno Haible2020-01-182-1/+8
| | | | | * m4/~~gnulib.m4 (gl_ZZGNULIB): New macro. * m4/gnulib-common.m4 (gl_COMMON): Require it.
* Fix major regression from 2020-01-10.Bruno Haible2020-01-182-14/+35
| | | | | | | | | | | | | | | | Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00079.html>. * m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL): Don't AC_REQUIRE anything. (gl_COMPILER_PREPARE_CHECK_DECL): Define through AC_DEFUN, not AC_DEFUN_ONCE. Use _AC_COMPILE_IFELSE, not AC_COMPILE_IFELSE. (_AC_CHECK_DECL_BODY): If ac_compile_for_check_decl has not been set, use ac_compile instead. (AC_CHECK_DECL): Remove override. * m4/~~gnulib.m4: New file. * gnulib-tool (func_get_filelist): Add also ~~gnulib.m4. * pygnulib/GLModuleSystem.py (getFiles): Likewise.
* c32stombs: New module.Bruno Haible2020-01-131-1/+2
| | | | | | | | | | * lib/uchar.in.h (c32stombs): New declaration. * lib/c32stombs.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32STOMBS. * modules/uchar (Makefile.am): Substitute GNULIB_C32STOMBS. * modules/c32stombs: New file. * tests/test-uchar-c++.cc: Test the signature of c32stombs. * doc/posix-functions/wcstombs.texi: Mention the new module.
* perl: require the "warnings" moduleJim Meyering2020-01-111-2/+2
| | | | | | * m4/perl.m4: Also "use warnings", so we reject the perl found on at least one IRIX 6.5 system. Reported by Bruno Haible in https://lists.gnu.org/r/sed-devel/2020-01/msg00004.html
* Fix major regression from 2020-01-04.Bruno Haible2020-01-101-5/+6
| | | | | | | | | Reported by Mats Erik Andersson <mats.andersson@gisladisker.se> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00072.html>. * m4/00gnulib.m4 (gl_COMPILER_PREPARE_CHECK_DECL): Define through AC_DEFUN_ONCE. (AC_CHECK_DECL): Invoke, not require, it.
* c32snrtombs: New module.Bruno Haible2020-01-101-1/+2
| | | | | | | | | | | | | * lib/uchar.in.h (c32snrtombs): New declaration. * lib/wcsnrtombs-impl.h: Parameterize: Use macros FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB. * lib/wcsnrtombs.c (FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB): New macros. * lib/c32snrtombs.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32SNRTOMBS. * modules/uchar (Makefile.am): Substitute GNULIB_C32SNRTOMBS. * modules/c32snrtombs: New file. * tests/test-uchar-c++.cc: Test the signature of c32snrtombs. * doc/posix-functions/wcsnrtombs.texi: Mention the new module.
* c32srtombs: New module.Bruno Haible2020-01-091-1/+2
| | | | | | | | | | | | | | * lib/uchar.in.h (c32srtombs): New declaration. * lib/wcsrtombs-impl.h: Parameterize: Use macros FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB. * lib/wcsrtombs.c (FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB): New macros. * lib/c32srtombs.c: New file. * lib/c32srtombs-state.c: New file, based on lib/wcsrtombs-state.c. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32SRTOMBS. * modules/uchar (Makefile.am): Substitute GNULIB_C32SRTOMBS. * modules/c32srtombs: New file. * tests/test-uchar-c++.cc: Test the signature of c32srtombs. * doc/posix-functions/wcsrtombs.texi: Mention the new module.
* c32rtomb: New module.Bruno Haible2020-01-092-2/+60
| | | | | | | | | | | | | | | * lib/uchar.in.h (c32rtomb): New declaration. * lib/c32rtomb.c: New file, based on lib/unistr/u8-uctomb-aux.c. * m4/c32rtomb.m4: New file. * m4/uchar.m4 (gl_UCHAR_H): Test whether c32rtomb is declared. (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32RTOMB, HAVE_C32RTOMB, REPLACE_C32RTOMB. * modules/uchar (Makefile.am): Substitute GNULIB_C32RTOMB, HAVE_C32RTOMB, REPLACE_C32RTOMB. * modules/c32rtomb: New file. * tests/test-uchar-c++.cc: Test the signature of c32rtomb. * doc/posix-functions/c32rtomb.texi: Document the new module. * doc/posix-functions/wcrtomb.texi: Mention the new module.
* mbrtoc32: Use the system's mbrtoc32 if it exists and basically works.Bruno Haible2020-01-091-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): New macro. (gl_FUNC_MBRTOC32): Require it. Set REPLACE_MBRTOC32 if mbrtoc32 exists but is not working. * lib/mbrtoc32.c: Include hard-locale.h, <locale.h>. (mbrtoc32): If the char32_t encoding and the wchar_t encoding may differ, use the system's mbrtoc32, adding workarounds. * modules/mbrtoc32 (Depends-on): Add hard-locale. * doc/posix-functions/mbrtoc32.texi: Mention the Solaris and native Windows problem. * lib/btoc32.c: Include <stdio.h>, <string.h>. (btoc32): If the char32_t encoding and the wchar_t encoding may differ, use mbrtoc32, not btowc. * modules/btoc32 (Depends-on): Add mbrtoc32. * lib/mbsrtoc32s.c (mbsrtoc32s): If the char32_t encoding and the wchar_t encoding may differ, use mbrtoc32, not mbsrtowcs. * modules/mbsrtoc32s (Depends-on): Update conditions. (configure.ac): Compile mbsrtoc32s-state.c unconditionally. * lib/mbsnrtoc32s.c (mbsnrtoc32s): If the char32_t encoding and the wchar_t encoding may differ, use mbrtoc32, not mbsnrtowcs. * modules/mbsnrtoc32s (Depends-on): Update conditions. (configure.ac): Compile mbsrtoc32s-state.c unconditionally.
* wcrtomb: Make multithread-safe, except possibly on IRIX.Bruno Haible2020-01-081-6/+12
| | | | | | | | * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Don't set REPLACE_WCRTOMB to 1 when REPLACE_MBSTATE_T is set. Define WCRTOMB_C_LOCALE_BUG and WCRTOMB_RETVAL_BUG. * lib/wcrtomb.c (wcrtomb): Use original wcrtomb whenever available. Use wctomb only on IRIX.
* mbstoc32s: New module.Bruno Haible2020-01-051-1/+2
| | | | | | | | | | * lib/uchar.in.h (mbstoc32s): New declaration. * lib/mbstoc32s.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSTOC32S. * modules/uchar (Makefile.am): Substitute GNULIB_MBSTOC32S. * modules/mbstoc32s: New file. * tests/test-uchar-c++.cc: Test the signature of mbstoc32s. * doc/posix-functions/mbstowcs.texi: Mention the new module.
* mbsnrtoc32s: New module.Bruno Haible2020-01-051-1/+2
| | | | | | | | | | | | | * lib/uchar.in.h (mbsnrtoc32s): New declaration. * lib/mbsnrtowcs-impl.h: Parameterize: Use macros FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC. * lib/mbsnrtowcs.c (FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC): New macros. * lib/mbsnrtoc32s.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSNRTOC32S. * modules/uchar (Makefile.am): Substitute GNULIB_MBSNRTOC32S. * modules/mbsnrtoc32s: New file. * tests/test-uchar-c++.cc: Test the signature of mbsnrtoc32s. * doc/posix-functions/mbsnrtowcs.texi: Mention the new module.
* mbsrtoc32s: New module.Bruno Haible2020-01-041-1/+2
| | | | | | | | | | | | | | * lib/uchar.in.h (mbsrtoc32s): New declaration. * lib/mbsrtowcs-impl.h: Parameterize: Use macros FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC. * lib/mbsrtowcs.c (FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC): New macros. * lib/mbsrtoc32s.c: New file. * lib/mbsrtoc32s-state.c: New file, based on lib/mbsrtowcs-state.c. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSRTOC32S. * modules/uchar (Makefile.am): Substitute GNULIB_MBSRTOC32S. * modules/mbsrtoc32s: New file. * tests/test-uchar-c++.cc: Test the signature of mbsrtoc32s. * doc/posix-functions/mbsrtowcs.texi: Mention the new module.
* uchar: Decide about _GL_LARGE_CHAR32_T at configure time.Bruno Haible2020-01-041-1/+11
| | | | | | | * m4/uchar.m4 (gl_UCHAR_H): Set SMALL_WCHAR_T. * modules/uchar (Files): Add stdint.m4. (Makefile.am): Substitute SMALL_WCHAR_T. * lib/uchar.in.h (_GL_LARGE_CHAR32_T): Rely on SMALL_WCHAR_T.
* Fix AC_CHECK_DECL so that it deactivates clang's built-in declarations.Bruno Haible2020-01-041-4/+65
| | | | | | | | | Reported by Martin Storsjö <martin@martin.st> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00016.html>. * m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL): New macros. (_AC_CHECK_DECL_BODY, AC_CHECK_DECL): Augment.
* btoc32: New module.Bruno Haible2020-01-041-1/+2
| | | | | | | | | | * lib/uchar.in.h (btoc32): New declaration. * lib/btoc32.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_BTOC32. * modules/uchar (Makefile.am): Substitute GNULIB_BTOC32. * modules/btoc32: New file. * tests/test-uchar-c++.cc: Test the signature of btoc32. * doc/posix-functions/btowc.texi: Mention the new module.
* mbrtoc32: New module.Bruno Haible2020-01-042-1/+128
| | | | | | | | | | | | | | | | | * lib/uchar.in.h (mbrtoc32): New declaration. * lib/mbrtoc32.c: New file, based on lib/mbrtowc.c. * m4/mbrtoc32.m4: New file, based on m4/mbrtowc.m4. * m4/uchar.m4 (gl_UCHAR_H): Test whether mbrtoc32 is declared. (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBRTOC32, HAVE_MBRTOC32, REPLACE_MBRTOC32. * modules/uchar (Makefile.am): Substitute GNULIB_MBRTOC32, HAVE_MBRTOC32, REPLACE_MBRTOC32. * modules/mbrtoc32: New file, based on modules/mbrtowc. * tests/test-uchar-c++.cc (mbrtoc32): Verify the signature. * modules/uchar-c++-tests (Makefile.am): Link test-uchar-c++ with $(LIB_MBRTOWC). * doc/posix-functions/mbrtoc32.texi: Document the new module. * doc/posix-functions/mbrtowc.texi: Mention the new module.
* mbrtowc: Refactor locale charset dispatching.Bruno Haible2020-01-031-1/+1
| | | | | | | | | | | | | | | | * lib/lc-charset-dispatch.h: New file, extracted from lib/mbrtowc.c. * lib/lc-charset-dispatch.c: New file, extracted from lib/mbrtowc.c. * lib/mbrtowc.c: Include lc-charset-dispatch.h. Don't include localcharset.h, streq.h. (enc_t): Remove type. (locale_enc): Remove function. (cached_locale_enc): Remove variable. (locale_enc_cached): Remove function. (mbrtowc): Invoke locale_encoding_classification. * m4/mbrtowc.m4 (gl_PREREQ_MBRTOWC): Update comment. * modules/mbrtowc (Files): Add lc-charset-dispatch.h, lc-charset-dispatch.c. (configure.ac): Arrange to compile lc-charset-dispatch.c.
* mbrtowc: Ensure the mbtowc_lock is unique.Bruno Haible2020-01-031-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/mbtowc-lock.c: New file, based on lib/setlocale-lock.c. * lib/mbtowc-lock.h: New file, extracted from lib/mbrtowc.c and lib/setlocale_null.c. * lib/mbrtowc.c: Include headers needed for mbtowc-lock.h. Don't include glthread/lock.h. Include mbtowc-lock.h. (mbtowc_lock): Remove declaration. (mbrtowc): Use mbtowc_with_lock. * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Require gl_PTHREADLIB. Check for threads.h. Set LIB_MBRTOWC. (gl_PREREQ_MBTOWC_LOCK): New macro. * modules/mbrtowc (Files): Add lib/mbtowc-lock.h, lib/mbtowc-lock.c, lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4. (Depends-on): Remove lock. (configure.ac): Arrange to compile mbtowc-lock.c. (Link): Mention $(LIB_MBRTOWC) instead of $(LIBTHREAD). * modules/acl (Link): Likewise. * modules/argmatch (Link): Likewise. * modules/backup-rename (Link): Likewise. * modules/backupfile (Link): Likewise. * modules/closein (Link): Likewise. * modules/closeout (Link): Likewise. * modules/copy-file (Link): Likewise. * modules/csharpcomp (Link): Likewise. * modules/csharpexec (Link): Likewise. * modules/dfa (Link): Likewise. * modules/exclude (Link): Likewise. * modules/fnmatch (Link): Likewise. * modules/fnmatch-gnu (Link): Likewise. * modules/fnmatch-posix (Link): Likewise. * modules/glob (Link): Likewise. * modules/human (Link): Likewise. * modules/javacomp (Link): Likewise. * modules/javaexec (Link): Likewise. * modules/javaversion (Link): Likewise. * modules/mbfile (Link): Likewise. * modules/mbiter (Link): Likewise. * modules/mbmemcasecmp (Link): Likewise. * modules/mbmemcasecoll (Link): Likewise. * modules/mbrlen (Link): Likewise. * modules/mbscasecmp (Link): Likewise. * modules/mbscasestr (Link): Likewise. * modules/mbschr (Link): Likewise. * modules/mbscspn (Link): Likewise. * modules/mbsinit (Link): Likewise. * modules/mbslen (Link): Likewise. * modules/mbsncasecmp (Link): Likewise. * modules/mbsnlen (Link): Likewise. * modules/mbsnrtowcs (Link): Likewise. * modules/mbspbrk (Link): Likewise. * modules/mbspcasecmp (Link): Likewise. * modules/mbsrchr (Link): Likewise. * modules/mbsrtowcs (Link): Likewise. * modules/mbssep (Link): Likewise. * modules/mbsspn (Link): Likewise. * modules/mbsstr (Link): Likewise. * modules/mbstok_r (Link): Likewise. * modules/mbswidth (Link): Likewise. * modules/mbuiter (Link): Likewise. * modules/mkdir-p (Link): Likewise. * modules/propername (Link): Likewise. * modules/quote (Link): Likewise. * modules/quotearg (Link): Likewise. * modules/quotearg-simple (Link): Likewise. * modules/regex-quote (Link): Likewise. * modules/rpmatch (Link): Likewise. * modules/sh-quote (Link): Likewise. * modules/system-quote (Link): Likewise. * modules/trim (Link): Likewise. * modules/unistdio/ulc-asnprintf (Link): Likewise. * modules/unistdio/ulc-fprintf (Link): Likewise. * modules/unistdio/ulc-vasnprintf (Link): Likewise. * modules/unistdio/ulc-vasprintf (Link): Likewise. * modules/unistdio/ulc-vfprintf (Link): Likewise. * modules/unistdio/ulc-vsnprintf (Link): Likewise. * modules/unistdio/ulc-vsprintf (Link): Likewise. * modules/xfreopen (Link): Likewise. * modules/xmemcoll (Link): Likewise. * modules/yesno (Link): Likewise. * modules/regex (Link): Add $(LIB_MBRTOWC). * modules/acl-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC) instead of $(LIBTHREAD). * modules/argmatch-tests (Makefile.am): Likewise. * modules/closein-tests (Makefile.am): Likewise. * modules/copy-file-tests (Makefile.am): Likewise. * modules/dfa-tests (Makefile.am): Likewise. * modules/fnmatch-tests (Makefile.am): Likewise. * modules/glob-tests (Makefile.am): Likewise. * modules/mbmemcasecmp-tests (Makefile.am): Likewise. * modules/mbmemcasecoll-tests (Makefile.am): Likewise. * modules/mbrtowc-tests (Makefile.am): Likewise. * modules/mbscasecmp-tests (Makefile.am): Likewise. * modules/mbscasestr-tests (Makefile.am): Likewise. * modules/mbschr-tests (Makefile.am): Likewise. * modules/mbscspn-tests (Makefile.am): Likewise. * modules/mbsinit-tests (Makefile.am): Likewise. * modules/mbsncasecmp-tests (Makefile.am): Likewise. * modules/mbsnrtowcs-tests (Makefile.am): Likewise. * modules/mbspbrk-tests (Makefile.am): Likewise. * modules/mbspcasecmp-tests (Makefile.am): Likewise. * modules/mbsrchr-tests (Makefile.am): Likewise. * modules/mbsrtowcs-tests (Makefile.am): Likewise. * modules/mbsspn-tests (Makefile.am): Likewise. * modules/mbsstr-tests (Makefile.am): Likewise. * modules/quotearg-simple-tests (Makefile.am): Likewise. * modules/quotearg-tests (Makefile.am): Likewise. * modules/readtokens-tests (Makefile.am): Likewise. * modules/sh-quote-tests (Makefile.am): Likewise. * modules/system-quote-tests (Makefile.am): Likewise. * modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise. * modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise. * modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise. * modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise. * modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise. * modules/yesno-tests (Makefile.am): Likewise. * modules/exclude-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC). * modules/regex-tests (Makefile.am): Likewise. * modules/regex-quote-tests (Makefile.am): Likewise.
* getopt-posix: Fix compilation failure in testdirs.Bruno Haible2020-01-031-1/+2
| | | | | | | | | * lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only when the gnulib module 'getopt-posix' is enabled. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX. * modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a module indicator. * modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.
* doc: Mention the 64-bit inode number problem.Bruno Haible2020-01-031-0/+4
| | | | | | | | | | | * m4/largefile.m4 (AC_SYS_LARGEFILE): Mention that this macro fixes the 64-bit inode number problem. * doc/posix-functions/stat.texi: Mention that this module fixes the 64-bit inode number problem. * doc/posix-functions/lstat.texi: Likewise. * doc/posix-functions/fstat.texi: Likewise. * doc/posix-functions/readdir.texi: Add more details. * doc/posix-functions/readdir_r.texi: Likewise.
* mbrtowc: Fix test failures on MSVC (regression by previous commit).Bruno Haible2020-01-021-1/+129
| | | | | | | | * m4/mbrtowc.m4 (gl_MBRTOWC_STORES_INCOMPLETE): New macro. (gl_FUNC_MBRTOWC): Invoke it. Define MBRTOWC_STORES_INCOMPLETE_BUG. * lib/mbrtowc.c (rpl_mbrtowc): Add workaround for MBRTOWC_STORES_INCOMPLETE_BUG. * doc/posix-functions/mbrtowc.texi: Mention the MSVC bug.
* mbrtowc: Don't replace mbstate_t on MSVC.Bruno Haible2020-01-022-9/+22
| | | | | | | | * m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Require AC_CANONICAL_HOST. Ignore a missing mbsinit function on native Windows. * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Strengthen the test, to detect an MSVC bug. * doc/posix-functions/wcrtomb.texi: Mention the MSVC bug.
* md5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compatPádraig Brady2020-01-011-7/+25
| | | | | | | | | | | * m4/gl-openssl.m4: Add a new "auto-gpl-compat" mode, which will auto enable use of openssl, only for >= version 3, which is newly licensed under the Apache Software License. This will be used from coreutils for example by adding gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat]) to configure.ac. Even though "auto-gpl-compat" is less aggressive than "auto", we leave the default at "no" so projects can opt in to the extra dependency.
* mbrtowc: Include function name in macro names.Bruno Haible2020-01-011-9/+9
| | | | | | | | | * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ. (gl_MBRTOWC_C_LOCALE): Change cache variable name to gl_cv_func_mbrtowc_C_locale_sans_EILSEQ. * lib/mbrtowc.c: Test MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ.
* c32tob: New module.Bruno Haible2020-01-011-1/+17
| | | | | | | | | | | | | | | | | | | * lib/uchar.in.h (_GL_LARGE_CHAR32_T): New macro. (c32tob): New declaration. * lib/c32tob.c: New file. * m4/uchar.m4 (gl_UCHAR_MODULE_INDICATOR, gl_UCHAR_H_DEFAULTS): New macros. (gl_UCHAR_H): Require gl_UCHAR_H_DEFAULTS. * modules/uchar (Depends-on): Add snippet/c++defs. (Makefile.am): Include c++defs.h and substitute GNULIB_C32TOB in uchar.h. * modules/c32tob: New file. * tests/test-uchar.c: Verify that _GL_LARGE_CHAR32_T is correctly defined. * tests/test-uchar-c++.cc: Include signature.h. Test the signature of c32tob. * modules/uchar-c++-tests (Files): Add tests/signature.h. * doc/posix-functions/wctob.texi: Mention the new module.