Bruno Haible [Fri, 1 Feb 2019 02:12:28 +0000 (03:12 +0100)]
strtod, strtold: Use the locale's decimal point.
* lib/strtod.c: Include <locale.h>, <stdio.h>, <langinfo.h>.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(parse_number): Add a radixchar argument. Use it instead of '.'.
(STRTOD): Invoke decimal_point_char and pass the result to parse_number.
* m4/strtod.m4 (gl_PREREQ_STRTOD): Test whether nl_langinfo exists.
* m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise.
* tests/test-strtod1.c: New file.
* tests/test-strtod1.sh: New file.
* modules/strtod-tests (Files): Add test-strtod1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtod1.c and run
test-strtod1.sh.
* tests/test-strtold1.c: New file.
* tests/test-strtold1.sh: New file.
* modules/strtold-tests (Files): Add test-strtold1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtold1.c and run
test-strtold1.sh.
Bruno Haible [Thu, 31 Jan 2019 23:18:57 +0000 (00:18 +0100)]
strtod, strtold: Work around HP-UX 11.31/ia64 bug.
* lib/strtod.c (STRTOD): When there is an extra character after the
exponent marker 'p', reparse the number.
* doc/posix-functions/strtod.texi: Document the HP-UX 11.31 bug.
* doc/posix-functions/strtold.texi: Likewise.
Bruno Haible [Wed, 30 Jan 2019 02:52:31 +0000 (03:52 +0100)]
strtold: New module.
* lib/stdlib.in.h (strtold): New declaration.
* lib/strtold.c: New file.
* lib/strtod.c: Consider USE_LONG_DOUBLE.
(STRTOD, LDEXP, HAVE_UNDERLYING_STRTOD, DOUBLE, MIN, MAX, L_,
USE_LDEXP): New macros.
(LDEXP, scale_radix_exp, parse_number, STRTOD): Adapt for
USE_LONG_DOUBLE.
(underlying_strtod): Remove function. Replace with some macros.
Re-add the code for a missing underlying function that was removed on
2013-02-19.
* m4/strtold.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtold is declared.
(gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOLD, HAVE_STRTOLD,
REPLACE_STRTOLD.
* modules/stdlib (Makefile.am): Substitute GNULIB_STRTOLD, HAVE_STRTOLD,
REPLACE_STRTOLD.
* modules/strtold: New file.
* doc/posix-functions/strtold.texi: Document the new module.
Bruno Haible [Mon, 28 Jan 2019 20:14:08 +0000 (21:14 +0100)]
Fix build error when building a shared libunistring on Android.
* tests/uninorm/test-nfc.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfd.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfkc.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfkd.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
Bruno Haible [Sun, 27 Jan 2019 15:15:39 +0000 (16:15 +0100)]
tests: Don't assume that /tmp exists.
* tests/test-set-mode-acl-1.sh: Skip the test if /tmp does not exist.
* tests/test-copy-acl-1.sh: Likewise.
* tests/test-file-has-acl-1.sh: Likewise.
* tests/test-copy-file-1.sh: Likewise.
Bruno Haible [Sun, 27 Jan 2019 03:57:24 +0000 (04:57 +0100)]
fts: Add support for Android.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Avoid conflicts between the symbols
defined by this module and the ones in libc.
* tests/test-fts.c (main): Treat mkdir error EMLINK like EMFILE.
Bruno Haible [Sat, 26 Jan 2019 23:21:17 +0000 (00:21 +0100)]
mountlist: Use Linux code on Android.
* lib/mountlist.c (setmntent, endmntent): Define fallbacks.
(unescape_tab, read_file_system_list): Enable Linux code on Android
as well.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Test for setmntent
and endmntent.
* modules/mountlist (Depends-on): Add 'getline'.
Bruno Haible [Sat, 26 Jan 2019 14:23:19 +0000 (15:23 +0100)]
ptsname_r: Work around bug on Android 4.3.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Define
HAVE_ESSENTIALLY_WORKING_PTSNAME_R. Test whether the return value is
correct.
* lib/ptsname_r.c (__ptsname_r): If HAVE_ESSENTIALLY_WORKING_PTSNAME_R
is defined, just fix the return value.
* doc/glibc-functions/ptsname_r.texi: Mention the Android bug. Reword:
The behaviour of musl libc is nothing to be "fixed", since it is
compliant with the next POSIX standard.
Bruno Haible [Sat, 26 Jan 2019 10:56:31 +0000 (11:56 +0100)]
ttyname_r: Work around bug on Android 4.3.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test whether ttyname_r is a stub.
* lib/ttyname_r.c (ttyname_r): Implement for Android.
* doc/posix-functions/ttyname_r.texi: Mention the Android bug.
* doc/posix-functions/ttyname.texi: Likewise.
Bruno Haible [Fri, 25 Jan 2019 22:39:28 +0000 (23:39 +0100)]
wcrtomb: Work around bug on Android 4.3.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Test also whether wcrtomb works in
the C locale.
* lib/wcrtomb.c (wcrtomb): Provide alternate implementation for Android,
which does not have the 'wctomb' function.
* doc/posix-functions/wcrtomb.texi: Mention the Android bug.
* tests/test-wcrtomb.c (main): Accept argument '5'.
* tests/test-wcrtomb.sh: Add tests in the POSIX locale.
Bruno Haible [Fri, 25 Jan 2019 22:26:24 +0000 (23:26 +0100)]
setlocale: Work around bug on Android 4.3.
* m4/setlocale.m4 (gl_FUNC_SETLOCALE): Test whether setlocale supports
the "C" locale.
* lib/setlocale.c (setlocale_unixlike): New wrapper for Android.
* doc/posix-functions/setlocale.texi: Mention the Android bug.
Bruno Haible [Thu, 24 Jan 2019 23:42:40 +0000 (00:42 +0100)]
mbtowc: Fix compilation error on Android 4.3.
* lib/stdlib.in.h (mbtowc): Test also HAVE_MBTOWC.
* m4/mbtowc.m4 (gl_FUNC_MBTOWC): Test whether mbtowc exists. Set
HAVE_MBTOWC.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether mbtowc is declared.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_MBTOWC.
* modules/stdlib (Makefile.am): Substitute HAVE_MBTOWC.
* modules/mbtowc (Depends-on, configure.ac): Test also HAVE_MBTOWC.
* doc/posix-functions/mbtowc.texi: Mention the change.
Bruno Haible [Thu, 24 Jan 2019 22:51:11 +0000 (23:51 +0100)]
fchownat: Fix compilation error on Android 4.3.
* lib/unistd.in.h: Include <sys/stat.h> when module 'fchownat' is in
use.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG,
gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Include also <sys/stat.h>.
* doc/posix-functions/fchownat.texi: Mention the issue.
Bruno Haible [Thu, 24 Jan 2019 03:47:08 +0000 (04:47 +0100)]
threadlib: Revert commit from 2018-06-25. We now have a better fix.
* m4/threadlib.m4 (gl_THREADLIB_BODY): Don't attempt to defeat a
preceding -Wl,--as-needed option. Don't check whether the linker
supports --as-needed/--no-as-needed and --push-state/--pop-state.
Bruno Haible [Sun, 20 Jan 2019 22:48:18 +0000 (23:48 +0100)]
log10l: Work around inaccurate implementation on NetBSD.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Add test for a certain accuracy.
* lib/log10l.c: Comment out too simplistic override.
* doc/posix-functions/log10l.texi: Mention the NetBSD bug.
Bruno Haible [Sun, 20 Jan 2019 21:57:41 +0000 (22:57 +0100)]
logl: Work around inaccurate implementation on NetBSD.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Add test for a certain accuracy.
* lib/logl.c: Comment out unused code.
* doc/posix-functions/logl.texi: Mention the NetBSD bug.
Bruno Haible [Sun, 20 Jan 2019 21:28:37 +0000 (22:28 +0100)]
expm1l: Work around inaccurate implementation on NetBSD.
* lib/math.in.h (expm1l): Test also REPLACE_EXPM1L.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Add test for a certain accuracy. Set
REPLACE_EXPM1L.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPM1L.
* modules/math (Makefile.in): Substitute REPLACE_EXPM1L.
* modules/expm1l (Depends-on, configure.ac): Test REPLACE_EXPM1L.
* doc/posix-functions/expm1l.texi: Mention the NetBSD bug.
Bruno Haible [Sun, 20 Jan 2019 21:04:01 +0000 (22:04 +0100)]
expl: Work around inaccurate implementation on NetBSD.
* lib/math.in.h (expl): Test also REPLACE_EXPL.
* m4/expl.m4 (gl_FUNC_EXPL): Add test for a certain accuracy. Set
REPLACE_EXPL.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_EXPL.
* modules/math (Makefile.in): Substitute REPLACE_EXPL.
* modules/expl (Depends-on, configure.ac): Test REPLACE_EXPL.
* doc/posix-functions/expl.texi: Mention the NetBSD bug.
Akim Demaille [Sun, 13 Jan 2019 18:48:35 +0000 (19:48 +0100)]
relocatable: improve documentation
* doc/relocatable-maint.texi (Supporting Relocation): For
substitutions performed by config.status, we need more variables
(for instance datarootdir defaults to '${prefix}/share' so we need
prefix).
Akim Demaille [Sun, 13 Jan 2019 10:16:20 +0000 (11:16 +0100)]
backup: update dependencies
* modules/backup-rename (Depends-on): It now depends on opendirat
instead of opendir. It also uses stdint, and xalloc-oversized.
But no longer dirfd.
* modules/backupfile (Depends-on): Add xalloc-oversized.
Paul Eggert [Sun, 6 Jan 2019 02:02:32 +0000 (18:02 -0800)]
stdopen: modernize and simplify
* lib/stdopen.c: Update copyright date
Do not include sys/types.h; no longer needed these days.
(stdopen): Use C99-style decl in loop. Return int errno
value, rather than just a bool. Do not worry about fd mismatches,
since the caller cares only if 0, 1, 2 are occupied.
* lib/stdopen.h: No need to include <stdbool.h>.
* m4/stdopen.m4: Remove.
* modules/stdopen: New file.
Paul Eggert [Sat, 5 Jan 2019 19:02:51 +0000 (11:02 -0800)]
stdopen: copy from last use in coreutils
* lib/stdopen.c, lib/stdopen.h, m4/stdopen.m4:
New files, taken from their last commit in coreutils
2007-07-23T12:35:58Z!jim@meyering.net 71aa3ea88084d17bcb4fc1031ad7b66f8647115e.
Bruno Haible [Sat, 5 Jan 2019 16:00:53 +0000 (17:00 +0100)]
argp: Don't pass an invalid argument to dgettext().
Reported by He X <xw897002528@gmail.com>.
* lib/argp.h (struct argp): Clarify that the args_doc field may be NULL.
* lib/argp-help.c (argp_args_usage): Don't pass a NULL args_doc to
dgettext().
Paul Eggert [Sun, 23 Dec 2018 02:00:10 +0000 (18:00 -0800)]
stdioext: port to newer 32-bit Android
Problem reported by Tom Yan in:
https://lists.gnu.org/archive/html/bug-gnulib/2018-07/msg00014.html
* lib/stdio-impl.h (_gl_FILE_flags_t) [__ANDROID__]: New macro.
(fp_) [__ANDROID__]: Use it.
Bruno Haible [Fri, 4 Jan 2019 19:31:18 +0000 (20:31 +0100)]
Fix link errors in unit tests.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
* modules/bitset-tests (Makefile.am): Link test-bitset against libintl.
* modules/array-map-tests (Makefile.am): Link test-array_map against
libintl.
* modules/array-set-tests (Makefile.am): Link test-array_set against
libintl.
* modules/hash-map-tests (Makefile.am): Link test-hash_map against
libintl.
* modules/hash-set-tests (Makefile.am): Link test-hash_set against
libintl.
* modules/linkedhash-map-tests (Makefile.am): Link test-linkedhash_map
against libintl.
* modules/linkedhash-set-tests (Makefile.am): Link test-linkedhash_set
against libintl.
Bruno Haible [Fri, 4 Jan 2019 18:34:19 +0000 (19:34 +0100)]
gnulib-tool: New option --extract-recursive-link-directive.
* gnulib-tool (func_usage): Document the new options
--extract-recursive-dependencies, --extract-recursive-link-directive.
(func_verify_module): Document output variables.
(func_get_dependencies_recursively): New function.
(func_get_link_directive_recursively): New function.
Use them to implement the new options
--extract-recursive-dependencies, --extract-recursive-link-directive.
* doc/gnulib-tool.texi (Link-time requirements): New section.