modules


Log

Author Commit Date CI Message
Paul Eggert b7363b49 2017-07-24T23:12:59 fts-tests: new module * modules/fts-tests, tests/test-fts.c: New files.
Bruno Haible a742bdb3 2017-07-24T01:19:36 Rename module 'strftime' to 'nstrftime'. * m4/nstrftime.m4: Renamed from m4/strftime.m4. * lib/nstrftime.c: Renamed from lib/strftime.c. * modules/nstrftime: Renamed from modules/strftime. (Files, Makefile.am): Update. * tests/test-nstrftime.c: Renamed from tests/test-strftime.c. Fix comment. * modules/nstrftime-tests: Renamed from modules/strftime-tests. (Files, Makefile.am): Update. * modules/strftime: New file, an obsolete indirection. * doc/posix-functions/strftime.texi: Update reference. * config/srclist.txt: Update info.
Paul Eggert 276416a1 2017-07-16T07:26:16 explicit_bzero: new module The explicit_bzero function has been added to glibc. This module is intended to supports its use in GNU programs. * doc/glibc-functions/explicit_bzero.texi, lib/explicit_bzero.c: * m4/explicit_bzero.m4, modules/explicit_bzero: New files. * doc/gnulib.texi (Glibc string.h): Link to new doc. * lib/string.in.h (explicit_bzero): Declare. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Add defaults for it. * modules/string (string.h): Substitute its vars.
Bruno Haible d6be976d 2017-07-16T14:21:55 unicase/locale-language: Fix link dependencies. * modules/unicase/locale-language (Link): New section. * modules/unicase/locale-language-tests (Makefile.am): Link test-locale-language program with $(LIBTHREAD).
Bruno Haible 231fb8c8 2017-07-15T17:00:37 getdtablesize: Add minimal support for OpenVMS. Reported by John E. Malmberg <wb8tyw@qsl.net>. * modules/getdtablesize (Description): Fix. * lib/getdtablesize.c: Fix comment. * m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Don't replace the getdtablesize() function, even though the test fails. * doc/glibc-functions/getdtablesize.texi: Reference SUSv2. Describe limitation on OpenVMS.
Bruno Haible 7f1ef184 2017-07-11T00:53:04 getlogin tests: Avoid #ifdefs when sharing code between modules. * modules/getlogin_r-tests (Files): Add tests/test-getlogin.h. * modules/getlogin-tests (Files): Likewise. Remove tests/test-getlogin_r.c. * tests/test-getlogin.h: Extracted from tests/test-getlogin_r.c. * tests/test-getlogin.c: Extracted from tests/test-getlogin_r.c. * tests/test-getlogin_r.c: Include test-getlogin.h. Omit code that tests getlogin().
Paul Eggert 24605b2f 2017-07-10T11:56:48 getlogin: don’t assume one name per uid Problem reported by Wolfgang F. Muthmann (Bug#27640). * modules/getlogin-tests (Files): Add tests/test-getlogin_r.c. (ttyname): Remove test. * modules/getlogin_r-tests (ttyname): Remove test. * tests/test-getlogin.c: Replace this near-clone of test-getlogin_r.c with ‘#define TEST_LOGIN’ followed by ‘#include "test-getlogin_r.c"’. * tests/test-getlogin_r.c: If TEST_GETLOGIN is defined, test getlogin rather than getlogin_r. This avoids code duplication. (main): Use isatty and fstat rather than ttyname and stat. Use getpwnam instead of getpwuid, to be portable to test platforms that have multiple login names for the same uid.
Bruno Haible 8f706af3 2017-06-29T17:36:28 stat, fstat: Compile stat-w32.c only on platforms that need it. Suggested by Paul Eggert. * modules/stat (configure.ac): Request stat-w32.o only on native Windows. * modules/fstat (configure.ac): Likewise.
Bruno Haible ce4ee4cb 2017-06-12T10:40:29 Relicense some modules under LGPLv2+. Daiki Ueno's approval is in https://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00058.html. * modules/uniwidth/base (License): Change to LGPLv2+. * modules/uniwidth/width (License): Likewise.
Bruno Haible 9611fb9f 2017-06-11T13:09:47 strtod-obsolete: Fix license. * modules/strtod-obsolete (License): Change to LGPL.
Bjarni Ingi Gislason 2b10299b 2017-05-22T18:02:35 Remove repeated words in comments. Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Bruno Haible 4cb5b9b4 2017-05-20T12:15:04 argp, tsearch tests: Fix file list. * modules/argp-tests (Files): Add tests/macros.h. * modules/tsearch-tests (Files): Likewise.
Bruno Haible a85305cb 2017-05-18T22:20:58 copy-file tests: Fix link error (regression from 2017-05-01). Reported by Tom G. Christensen <tgc@jupiterrise.com>. * modules/copy-file-tests (Makefile.am): Link test-copy-file with $(LIB_CLOCK_GETTIME).
Bruno Haible 4be48808 2017-05-18T12:54:51 unicase/special-casing: Fix incompatibility with gperf-3.0.4. * lib/unicase/special-casing.in.h: Renamed from lib/unicase/special-casing.h. * modules/unicase/special-casing (Files): Add lib/unicase/special-casing.in.h. Remove lib/unicase/special-casing.h. (Makefile.am): Add rule for generating unicase/special-casing.h. Update BUILT_SOURCES and MOSTLYCLEANFILES accordingly. * lib/unicase/special-casing.c: Include "unicase/special-casing.h", not "special-casing.h". * lib/unicase/u*.c: Likewise.
Bruno Haible 90d98286 2017-05-16T19:38:06 sigpipe tests: Fix file list. * modules/sigpipe-tests (Files): Add tests/macros.h.
Bruno Haible 451d8ab5 2017-05-15T19:27:45 sys_select: Avoid "was expanded before it was required" warning. * modules/sys_select (configure.ac): Require, not invoke, gl_HEADER_SYS_SELECT.
Bruno Haible 0e9b97cf 2017-05-14T17:33:37 same-inode: Adapt for windows-stat-inodes. * lib/same-inode.h: Include <sys/types.h>. (SAME_INODE) [_GL_WINDOWS_STAT_INODES]: Define specifically. * modules/same-inode (Depends-on): Add sys_types.
Bruno Haible 8123b614 2017-05-14T14:20:01 windows-stat-inodes: New module. * m4/windows-stat-inodes.m4: New file. * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_STAT_INODES. * modules/sys_types (Makefile.am): Substitute WINDOWS_STAT_INODES. * lib/sys_types.in.h [WINDOWS_STAT_INODES]: Override dev_t and ino_t. (_GL_WINDOWS_STAT_INODES): New macro. * lib/stat-w32.c: Set _WIN32_WINNT. Include <string.h>, verify.h. (GetFileInformationByHandleExFunc): New variable. (initialize): Initialize it. (_gl_fstat_by_handle) [_GL_WINDOWS_STAT_INODES]: Initialize st_dev and st_ino appropriately. * lib/stat.c (rpl_stat): Use the directory entry based approach only as a fallback, because it does not provide st_dev and st_ino values. * modules/fstat (Depends-on): Add 'verify'. * modules/windows-stat-inodes: New file. * doc/windows-stat-inodes.texi: New file. * doc/gnulib.texi: Include it. * doc/posix-headers/sys_stat.texi: Mention the new module.
Bruno Haible 4ecbdc82 2017-05-13T03:04:54 year2038: New module. * m4/year2038.m4: New file. * modules/year2038: New file. * doc/year2038.texi: New file. * doc/gnulib.texi: Include it.
Bruno Haible 7a066745 2017-05-13T03:03:07 largefile: Improve and document. * m4/largefile.m4 (gl_LARGEFILE): Set WINDOWS_64_BIT_ST_SIZE to 0 if the mingw headers already define 'stat' appropriately. * modules/largefile (Description): Clarify. * doc/largefile.texi: New file. * doc/gnulib.texi: Include it. * doc/posix-headers/sys_types.texi: Update.
Bruno Haible 63e26828 2017-05-13T02:55:24 truncate-tests: New module. * tests/test-truncate.c: New file. * modules/truncate-tests: New file.
Bruno Haible f4d71054 2017-05-13T02:54:37 truncate: New module. * lib/unistd.in.h (truncate): New declaration. * lib/truncate.c: New file. * m4/truncate.m4: New file. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'truncate' is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_TRUNCATE, HAVE_TRUNCATE, REPLACE_TRUNCATE. * modules/unistd (Makefile.am): Substitute GNULIB_TRUNCATE, HAVE_TRUNCATE, REPLACE_TRUNCATE. * modules/truncate: New file. * tests/test-unistd-c++.cc (truncate): Test signature. * doc/posix-functions/truncate.texi: Mention the new module.
Bruno Haible 7d2f35f7 2017-05-13T02:51:05 windows-stat-timespec: New module. * modules/windows-stat-timespec: New file. * m4/windows-stat-timespec.m4: New file. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_STAT_TIMESPEC. * modules/sys_stat (Makefile.am): Substitute WINDOWS_STAT_TIMESPEC. * lib/sys_stat.in.h (struct stat) [WINDOWS_STAT_TIMESPEC]: Declare with fields st_atim, st_mtim, st_ctim. (st_atime, st_mtime, st_ctime): Define as macros. (_GL_WINDOWS_STAT_TIMESPEC): New macro. * lib/stat-w32.h (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New declaration. * lib/stat-w32.c (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New function. (_gl_convert_FILETIME_to_POSIX): Adjust coding style. (_gl_fstat_by_handle): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat.c (rpl_stat): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat-time.h (STAT_TIMESPEC): Define also if _GL_WINDOWS_STAT_TIMESPEC. * doc/windows-stat-timespec.texi: New file. * doc/gnulib.texi: Include it.
Bruno Haible 44fe2082 2017-05-13T02:46:43 windows-stat-override: New module. * lib/sys_stat.in.h (stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provide own definition. Define GNULIB_defined_struct_stat. (fstat, fstatat, lstat, stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provoke link error if this symbol is used and the corresponding module is not in use. (_stat64, _stat32i64, _stati64, _stat32, _stat64i32): Don't redefine if GNULIB_OVERRIDES_STRUCT_STAT. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_OVERRIDES_STRUCT_STAT. * modules/sys_stat (Makefile.am): Substitute GNULIB_OVERRIDES_STRUCT_STAT. * modules/windows-stat-override: New file.
Bruno Haible 532f7f1e 2017-05-13T02:39:00 fstat: Fix module dependency conditions. * modules/fstat (Depends-on): Fix typo.
Bruno Haible 2511522d 2017-05-11T00:27:52 time: Fix missing initialization of HAVE_TIMEZONE_T. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize HAVE_TIMEZONE_T here... * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): ... not here. * m4/time_rz.m4 (gl_TIME_RZ): Require gl_HEADER_TIME_H_DEFAULTS, not gl_HEADER_SYS_TIME_H_DEFAULTS. * modules/time_rz (Depends-on): Add 'time'. Remove useless quoting. (configure.ac): Remove useless quoting.
Bruno Haible f16bb1a7 2017-05-10T23:39:15 Implement a way to opt out from MSVC support, part 2. * modules/msvc-inval (Include): Document recommended idiom. * modules/msvc-nothrow (Include): Likewise.
Bruno Haible 03c3f38b 2017-05-10T21:52:21 Implement a way to opt out from MSVC support. This is useful for Emacs. * modules/msvc-nothrow (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/accept4.c: Include <io.h> as an alternative to msvc-nothrow.h. * lib/error.c: Likewise. * lib/fcntl.c: Likewise. * lib/flock.c: Likewise. * lib/fstat.c: Likewise. * lib/fsync.c: Likewise. * lib/ioctl.c: Likewise. * lib/isapipe.c: Likewise. * lib/lseek.c: Likewise. * lib/nonblocking.c: Likewise. * lib/poll.c: Likewise. * lib/select.c: Likewise. * lib/sockets.h: Likewise. * lib/sockets.c: Likewise. * lib/stdio-read.c: Likewise. * lib/stdio-write.c: Likewise. * lib/utimens.c: Likewise. * lib/w32sock.h: Likewise. * lib/w32spawn.h: Likewise. * tests/test-cloexec.c: Likewise. * tests/test-dup-safer.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-dup3.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-pipe.c: Likewise. * tests/test-pipe2.c: Likewise. * lib/ftruncate.c: Likewise. (chsize_nothrow): Renamed from chsize. * lib/msvc-nothrow.c: Don't include msvc-inval.h if HAVE_MSVC_INVALID_PARAMETER_HANDLER is not defined. * lib/close.c: Likewise. * lib/dup.c: Likewise. * lib/fclose.c: Likewise. * lib/raise.c: Likewise. * tests/test-fgetc.c: Likewise. * tests/test-fputc.c: Likewise. * tests/test-fread.c: Likewise. * tests/test-fwrite.c: Likewise. * lib/getdtablesize.c: Likewise. (_setmaxstdio_nothrow): Renamed from _setmaxstdio. * lib/isatty.c: Don't include msvc-inval.h if HAVE_MSVC_INVALID_PARAMETER_HANDLER is not defined. Include <io.h> as an alternative to msvc-nothrow.h. * lib/read.c: Likewise. * lib/write.c: Likewise. * lib/dup2.c: Likewise. (dup2_nothrow): New function. (ms_windows_dup2): Use it. * m4/close.m4 (gl_FUNC_CLOSE): Invoke gl_MSVC_INVAL and test HAVE_MSVC_INVALID_PARAMETER_HANDLER only if gl_MSVC_INVAL is defined. * m4/dup.m4 (gl_FUNC_DUP): Likewise. * m4/fdopen.m4 (gl_FUNC_FDOPEN): Likewise. * m4/raise.m4 (gl_FUNC_RAISE): Likewise. * m4/read.m4 (gl_FUNC_READ): Likewise. * m4/write.m4 (gl_FUNC_WRITE): Likewise. * doc/windows-without-msvc.texi: New file. * doc/gnulib.texi (Native Windows Support without MSVC Support): New section.
Paul Eggert d9c44b2b 2017-05-08T10:37:48 intprops: don’t depend on ‘verify’ Problem reported by Ævar Arnfjörð Bjarmason in: http://lists.gnu.org/archive/html/bug-gnulib/2017-05/msg00054.html * lib/intprops.h: Do not include verify.h, and move compile-time checks from here ... * tests/test-intprops.c (main): ... to here, if they’re not here already. Check widths of other standard integer types. * modules/intprops (Depends-on): Remove ‘verify’.
Bruno Haible 26d56678 2017-05-07T21:50:30 utimens: On native Windows, support 100ns resolution also if fd < 0. * lib/utime.in.h: Include <time.h>. (_gl_utimens_windows): New declaration. * lib/utime.c (_gl_utimens_windows): New function, based on utime. (utime): Invoke it. * lib/utimens.c (fdutimens): On native Windows, call _gl_utimens_windows instead of utime. * modules/utime (Depends-on): Add 'time'.
Bruno Haible 308880d8 2017-05-05T23:16:31 utime-h-c++-tests: New module. * tests/test-utime-h-c++.cc: New file. (utime): Declare, missing since 2017-04-30. * modules/utime-h-c++-tests: New file.
Bruno Haible f614b66a 2017-05-05T22:43:41 sys_resource-c++-tests: New module. * tests/test-sys_resource-c++.cc: New file. (getrusage): Declare, missing since 2012-04-13. * modules/sys_resource-c++-tests: New file.
Bruno Haible e31d3f5c 2017-05-05T22:40:19 strings-c++-tests: New module. * tests/test-strings-c++.cc: New file. (ffs): Declare, missing since 2011-07-12. * modules/strings-c++-tests: New file.
Bruno Haible f33c4869 2017-05-05T21:50:57 inttypes-c++-tests: New module. * tests/test-inttypes-c++.cc: New file. (strtoimax): Declare, missing since 2012-01-05. (strtoumax): Declare, missing since 2012-01-05. * modules/inttypes-c++-tests: New file.
Bruno Haible 65758d9c 2017-05-01T18:14:35 copy-file: Fix build error on mingw. * modules/copy-file (Depends-on): Add 'close'.
Bruno Haible 210cb7a9 2017-05-01T17:27:53 tzset: Work around TZ problem on native Windows. * m4/tzset.m4 (gl_FUNC_TZSET): Require AC_CANONICAL_HOST. On native Windows, set REPLACE_TZSET to 1. * lib/tzset.c (tzset): On native Windows, fix TZ if necessary, and invoke '_tzset' instead of 'tzset'. * doc/posix-functions/tzset.texi: Mention the native Windows workaround. * modules/time_rz (Depends-on): Add tzset. * lib/time_rz.c (tzset): Remove fallback definition. * m4/time_rz.m4 (gl_TIME_RZ): Don't test for tzset.
Bruno Haible 45af9a36 2017-05-01T16:37:15 mktime: Fix dependencies. * modules/mktime (Depends-on): Add 'time'.
Bruno Haible e4d101c4 2017-05-01T16:10:46 New module 'localtime-buffer', split off from module 'gettimeofday'. * lib/localtime-buffer.h: New file. * lib/localtime-buffer.c: New file, extracted from lib/gettimeofday.c. * lib/time.in.h (tzset): New declaration. (localtime, gmtime): Don't test GNULIB_GETTIMEOFDAY. * lib/tzset.c: New file, extracted from lib/gettimeofday.c. * lib/gettimeofday.c: Include localtime-buffer.h. Remove code that was moved to lib/localtime-buffer.c or lib/tzset.c. * m4/localtime-buffer.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. * m4/tzset.m4 (gl_FUNC_TZSET): Move code from m4/gettimeofday.m4 to here, with modifications. Set HAVE_TZSET, REPLACE_TZSET. Invoke gl_LOCALTIME_BUFFER_NEEDED. (gl_FUNC_TZSET_CLOBBER): Don't require gl_HEADER_SYS_TIME_H; not needed since 2007-01-18. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Remove code that deals with tzset. (gl_FUNC_GETTIMEOFDAY_CLOBBER): Require gl_LOCALTIME_BUFFER_DEFAULTS. Invoke gl_LOCALTIME_BUFFER_NEEDED instead of gl_GETTIMEOFDAY_REPLACE_LOCALTIME. (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Remove macro. * modules/localtime-buffer: New file. * modules/time (Depends-on): Remove 'gettimeofday'. (Makefile.am): Substitute GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. Don't substitute GNULIB_GETTIMEOFDAY. * modules/tzset (Description): Enable hyperlink to POSIX spec. (Files): Add lib/tzset.c. (Depends-on): Remove gettimeofday. Add localtime-buffer, time. (configure.ac): Arrange to conditionally compile lib/tzset.c. Invoke gl_TIME_MODULE_INDICATOR. * modules/gettimeofday (Depends-on): Add localtime-buffer.
Bruno Haible 3eee3a1e 2017-05-01T13:27:57 copy-file: Preserve sub-second time stamps. * lib/copy-file.c: Include stat-time.h, utimens.h instead of <utime.h>. (qcopy_file_preserving): Use 'struct timespec' and utimens() to transport the time stamps from the original file to the destination file. * m4/copy-file.m4 (gl_COPY_FILE): Don't test for utime, utimes. * modules/copy-file (Depends-on): Add stat-time, utimns instead of utime-h.
Bruno Haible dfcf42ed 2017-05-01T12:36:02 wchar: Fix compilation error with the original mingw.org mingw. * lib/wchar.in.h (rpl_wint_t): If <crtdefs.h> does not exist, include <stddef.h> instead. * m4/wint_t.m4 (gl_TYPE_WINT_T_PREREQ): New macro, extracted from gl_WCTYPE_H. * m4/wctype_h.m4 (gl_WCTYPE_H): Don't set HAVE_CRTDEFS_H here; require gl_TYPE_WINT_T_PREREQ instead. * m4/wchar_h.m4 (gl_WCHAR_H): Require gl_TYPE_WINT_T_PREREQ. * modules/wchar (Makefile.am): Substitute HAVE_CRTDEFS_H. Reported by Eli Zaretskii <eliz@gnu.org>.
Bruno Haible 8974b8ff 2017-05-01T11:50:08 utimens: Add support for native Windows. * lib/utimens.c: Include <windows.h>, msvc-nothrow.h. (fdutimens): Provide a native Windows implementation, like utime.c with added tv_nsec support. * modules/utimens (Depends-on): Add msvc-nothrow, utime. Suggested by Tim Rühsen <tim.ruehsen@gmx.de>.
Bruno Haible 05226f4e 2017-04-30T17:56:49 wcsftime: New module. * lib/wchar.in.h (wcsftime): New declaration. * lib/wcsftime.c: New file. * m4/wcsftime.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test for wcsftime declaration. (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_WCSFTIME, HAVE_WCSFTIME, REPLACE_WCSFTIME. * modules/wchar (Makefile.am): Substitute GNULIB_WCSFTIME, HAVE_WCSFTIME, REPLACE_WCSFTIME. * modules/wcsftime: New file. * doc/posix-functions/wcsftime.texi: Mention the new module.
Bruno Haible 9df4babe 2017-04-30T17:14:35 strftime-fixes: New module. * lib/time.in.h (strftime): New declaration. * lib/strftime-fixes.c: New file. * m4/strftime.m4 (gl_FUNC_GNU_STRFTIME): Inline gl_FUNC_STRFTIME macro. (gl_FUNC_STRFTIME): Remove macro. * m4/strftime-fixes.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_STRFTIME, REPLACE_STRFTIME. * modules/time (Makefile.am): Substitute GNULIB_STRFTIME, REPLACE_STRFTIME. * modules/strftime-fixes: New file. * doc/posix-functions/strftime.texi: Mention the new module.
Bruno Haible db1ee11e 2017-04-30T16:34:54 mktime: Work around TZ problem on native Windows. * lib/mktime.c: Add #ifs to make the algorithmic workaround independent from the native Windows workaround. * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): New macro, extracted from gl_FUNC_MKTIME. If guessing, set gl_cv_func_working_mktime to 'guessing no'. (gl_FUNC_MKTIME): Require it. Require AC_CANONICAL_HOST. Set REPLACE_MKTIME to 1 on native Windows. Define NEED_MKTIME_WORKING, NEED_MKTIME_WINDOWS. (gl_FUNC_MKTIME_INTERNAL): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Set WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. Define NEED_MKTIME_INTERNAL. * m4/timegm.m4 (gl_FUNC_TIMEGM): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Cope with 'guessing yes' value. * modules/mktime-internal (configure.ac): Test WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. * doc/posix-functions/mktime.texi: Mention the native Windows workaround.
Bruno Haible 16778a29 2017-04-30T13:32:40 localtime: New module. * lib/time.in.h (localtime): Declare also if requested by module 'localtime'. * lib/localtime.c: New file. * m4/localtime.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_LOCALTIME. * modules/time (Makefile.am): Substitute GNULIB_LOCALTIME. * modules/localtime: New file. * doc/posix-functions/localtime.texi: Mention the new module.
Bruno Haible 8c59a9eb 2017-04-30T13:19:24 ctime: New module. * lib/time.in.h (ctime): New declaration. * lib/ctime.c: New file. * m4/ctime.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_CTIME, REPLACE_CTIME. * modules/time (Makefile.am): Substitute GNULIB_CTIME, REPLACE_CTIME. * modules/ctime: New file. * doc/posix-functions/ctime.texi: Mention the new module.
Bruno Haible dc2bc508 2017-04-30T11:13:56 utime-tests: New module. * tests/test-utime.c: New file, based on tests/test-utimens.h. * tests/test-utimens-common.h: Include <sys/stat.h>. * modules/utime-tests: New file.
Bruno Haible e5194dce 2017-04-30T03:08:46 utime: New module. * lib/utime.in.h: Add comment for snippets. (utime): New declaration. * lib/utime.c: New file. * m4/utime.m4: New file. * m4/utime_h.m4 (gl_UTIME_H): Test for utime declaration. (gl_UTIME_H_DEFAULTS): Initialize GNULIB_UTIME, HAVE_UTIME, REPLACE_UTIME. * modules/utime-h (Depends-on): Add snippets. (Makefile.am): Substitute GNULIB_UTIME, HAVE_UTIME, REPLACE_UTIME. Insert snippets. * modules/utime: New file. * doc/posix-functions/utime.texi: Mention the new module.
Bruno Haible 127cc815 2017-04-30T01:26:05 utime-h: Modernize handling of 'struct utimbuf'. * lib/utime.in.h: Include next <utime.h> if it exists. (utimbuf): Define to _utimbuf on native Windows. * m4/utime-h.m4 (gl_UTIME_H): Check for prerequisites of include_next. Set UTIME_H on native Windows. (gl_UTIME_MODULE_INDICATOR, gl_HEADER_UTIME_H_DEFAULTS): New macros. * modules/utime-h (Depends-on): Add include_next. (Makefile.am): Substitute also HAVE_UTIME_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, PRAGMA_COLUMNS, NEXT_UTIME_H. * lib/utimens.c (utimbuf): Remove fallback definition. * m4/utimens.m4 (gl_UTIMENS): Don't require gl_CHECK_TYPE_STRUCT_UTIMBUF. * m4/utimbuf.m4: Remove file. * modules/utimens (Files): Remove m4/utimbuf.m4.
Bruno Haible 06464e83 2017-04-30T00:03:50 Make use of module 'utime-h'. * modules/copy-file (Depends-on): Add utime-h. * lib/copy-file.c: Assume that <utime.h> exists. * m4/copy-file.m4 (gl_COPY_FILE): Don't test for <utime.h>. * modules/utimens (Depends-on): Add utime-h. * lib/utimens.c: Assume that <utime.h> exists.
Bruno Haible 8dac05d2 2017-04-30T10:21:22 utime-h: New module. * m4/utime_h.m4: New file. * lib/utime.in.h: New file. * modules/utime-h: New file. * doc/posix-headers/utime.texi: Mention the new module. * tests/test-utime-h.c: New file. * modules/utime-h-tests: New file.
Bruno Haible bd481743 2017-04-29T15:05:15 stat: Fix time_t values and other problems on native Windows platforms. * doc/posix-functions/stat.texi: Mention the problem with the Microsoft implementations of stat(). * lib/stat.c: Include filename.h instead of dosname.h. Include malloca.h, stat-w32.h. (is_unc_root): New function. (rpl_stat): New implementation for native Windows. Remove REPLACE_FUNC_STAT_DIR code. * m4/stat.m4 (gl_FUNC_STAT): On native Windows, set REPLACE_STAT always. Don't define REPLACE_FUNC_STAT_DIR. (gl_PREREQ_STAT): Require gl_HEADER_SYS_STAT_H. * modules/stat (Files): Add lib/stat-w32.h, lib/stat-w32.c. (Depends-on): Remove dosname. Add filename, malloca. (configure.ac): Also compile lib/stat-w32.c.
Bruno Haible fcb99f40 2017-04-29T14:55:22 fstat: Fix time_t values on native Windows platforms. * doc/posix-functions/fstat.texi: Mention the problem with st_*time. * lib/stat-w32.h: New file. * lib/stat-w32.c: New file. * lib/fstat.c: Don't include msvc-inval.h. Include msvc-nothrow.h, stat-w32.h instead. (fstat_nothrow): Remove function. (rpl_fstat): Implement by means of _gl_fstat_by_handle. * m4/fstat.m4 (gl_FUNC_FSTAT): On native Windows, set REPLACE_FSTAT always. (gl_PREREQ_FSTAT): Require gl_HEADER_SYS_STAT_H. * modules/fstat (Files): Add lib/stat-w32.h, lib/stat-w32.c. (Depends-on): Remove msvc-inval. Add pathmax, msvc-nothrow. (configure.ac): Also compile lib/stat-w32.c.
Bruno Haible 62f2dba6 2017-04-26T23:25:11 noreturn: New module. * lib/noreturn.h: New file. * modules/noreturn: New file. * tests/test-noreturn.c: New file. * modules/noreturn-tests: New file. * tests/test-noreturn-c++.cc: New file. * modules/noreturn-c++-tests: New file.
Bruno Haible 2a0c08e4 2017-04-27T18:59:24 wctype-h: Fix compilation error with the original mingw.org mingw. * m4/wctype_h.m4 (gl_WCTYPE_H): Test for <crtdefs.h>. Set HAVE_CRTDEFS_H. * modules/wctype-h (Makefile.am): Substitute HAVE_CRTDEFS_H. * lib/wctype.in.h (rpl_wint_t): If <crtdefs.h> does not exist, include <stddef.h> instead. Reported and proposed by Eli Zaretskii <eliz@gnu.org>.
Bruno Haible 1b19f8fb 2017-04-23T19:02:08 Fix conflict between strerror_r-posix module and AC_FUNC_STRERROR_R. * modules/strerror_r-posix (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/error.c: Test GNULIB_STRERROR_R_POSIX before testing HAVE_DECL_STRERROR_R, HAVE_STRERROR_R, or STRERROR_R_CHAR_P. * lib/argp-help.c (__argp_failure): Likewise.
Paul Eggert 40829639 2017-04-22T18:48:39 poll: improve fast check for out-of-range NFD * lib/poll.c: Do not include intprops.h. (poll): Compare NFD to INT_MAX, not to TYPE_MAXIMUM (nfds_t) / 2. * modules/poll (Depends-on): Remove intprops.
Bruno Haible 63a51f5a 2017-04-23T02:45:19 getlogin_r: Work around bug in Mac OS X 10.12. * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test also against the Mac OS X bug. * lib/getlogin_r.c (getlogin_r): When getlogin_r returns a string of the given size minus 1, call getlogin_r a second time, on a larger buffer. * modules/getlogin_r (Depends-on): Add malloca. * doc/posix-functions/getlogin_r.texi: Mention the Mac OS X bug.
Bruno Haible 518ec8ea 2017-04-22T14:18:45 poll: Enable argument check. * lib/poll.c: Include intprops.h. (poll): Check value of nfd correctly. * modules/poll (Depends-on): Add intprops.
Bruno Haible c5ede3d9 2017-04-22T12:02:38 xbinary-io: Fix build error. * modules/xbinary-io (Depends-on): Add gettext-h. * lib/xbinary-io.c: Include gettext.h and define _(). Reported by Gisle Vanem <gisle.vanem@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00089.html>.
Paul Eggert 30784c47 2017-04-22T02:11:26 parse-datetime: overflow and debug cleanups This long patch was triggered by this bug report from Ruediger Meier: http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00028.html I fixed the bug he noted, then found some others nearby, and then still others. Oh my goodness, there were a lot of bugs. I cleaned up some of the code to follow GNU standards while I was at it. * lib/parse-datetime.y (ISDIGIT): Remove; all callers changed to use c_isdigit. (EPOCH_YEAR): Remove; unused. (TM_YEAR_BASE): Now an enum rather than a macro. (HOUR, debug_strfdatetime): Multiply hour by 3600, not 60, to get time zone offset, since timezones now are in terms of seconds and not minutes. (long_time_t): Remove. All uses replaced by time_t or intmax_t as appropriate. Verify that intmax_t is wide enough. (time_overflow, time_zone_str): New functions, used to deal more reliably with overflow. (dbg_printf): Add printf attribute, to help catch integer width errors. (textint, relative_time, parser_control, time_zone_hhmm, set_hhmmss) (%union, to_hour, yylex, parse_datetime2): Use intmax_t instead of long int and/or long_time_t. All uses changed. (DBGBUFSIZE): Move earlier. (relative_time, set_hhmmss, parser_control): Just use int for nanoseconds and for time zones; that’s wide enough. (parser_control): Use bool for members like year_seen that can be booleans instead of counters. All uses changed. Remove debug_default_input_timezone; no longer needed. All uses removed. (apply_relative_time): Return a bool overflow flag. All uses changed to check for overflow. (apply_relative_time, zone, date, relunit, relunit_snumber) (signed_seconds, unsigned_seconds, yylex, parse_datetime2): Check for integer overflow portably. (str_days): Use just int for N, as it’s wide enough. Prefer 2D char arrays to arrays of char * when it looks like 2D is a win on typical platforms. Prefer snprintf to strncpy/strncat, for simplicity; all buffers are smaller than INT_MAX so this is safe. (TIME_ZONE_BUFSiZE, TM_YEAR_BUFSIZE): New constants. (debug_print_current_time): Don’t assume tv_nsec is of type long, as this is not true on x32. Output "." before any nanoseconds. (debug_print_current_time, parse_datetime2): Output local zones using a more-consistent format. (debug_print_current_time, date, parse_datetime2): (main) [TEST]: Don’t assume time_t is the same width as long. (print_rel_part): New function, replacing ... (PRINT_REL_PART): ... this macro, which was removed. All uses changed. (debug_print_relative_time): Use bool for boolean. (local_zone): dsts_seen now counts only tDST instances. (date): Fix printf of size_t to use %z. Do not assume numeric tokens have negative values merely because the context suggests a syntax with "-" separating tokens. (time_zone_hhmm): Return bool success indicator, which checks for overflow. Store result into PC->time_zone instead. All callers changed. (tm_year_str): New function. Return a bool success indicator and store the result into a buffer. All callers changed. Output the numerically correct string even if adding 1900 to the year would overflow. (to_tm_year): New function, replacing the old to_year. All callers changed. (tm_diff): Sync with glibc. (lookup_word): Use to_uchar instead of doing it by hand. (TZBUFSIZE): Now local to the only function that needs it. (debug_strfdatetime): Simplify now that time zones are int seconds. (debug_strfdate): Work even if tm_year + 1900 would overflow. (get_effective_timezone): Remove. All uses removed. (parse_datetime2): Use fprintf in pieces instead of snprintfing to a fixed-size buffer. Don’t assume that gmtime succeeds iff localtime succeeds. Use tm_gmtoff if available. Simplify how ‘goto fail;’ works in conjunction with the ‘ok’ flag. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don’t define TIME_T_FITS_IN_LONG_INT, as it is no longer needed. * modules/parse-datetime (Depends-on): Add inttypes.
Bruno Haible 2112962a 2017-04-21T03:10:32 Remove red warnings from the generated MODULES.html. * modules/fcntl (Description): Disambiguate function references. * modules/getcwd-lgpl (Description): Likewise. * modules/hostent (Description): Likewise. * modules/servent (Description): Likewise. * modules/tempname (Description): Likewise.
Bruno Haible a7bd2403 2017-04-20T21:27:40 verify tests: Fix spurious failure with parallel make. * gnulib-tool (func_emit_tests_Makefile_am): Emit initialization of EXTRA_PROGRAMS. * tests/test-verify.sh: Build test-verify-try.o, not test-verify.o. * tests/test-verify-try.c: New file. * modules/verify-tests (Files): Add it. (EXTRA_PROGRAMS): Add test-verify-try. (MOSTLYCLEANFILES): Update accordingly. Reported by Adam James Stewart <ajstewart@anl.gov>.
Bruno Haible 3a82bb79 2017-04-19T01:03:34 vma-iter: Fix conflict with module 'largefile' on 32-bit Solaris 9. * modules/vma-iter (configure.ac): Test whether <sys/procfs.h> can be included. * lib/vma-iter.c: On Solaris, test HAVE_SYS_PROCFS_H before including <sys/procfs.h>. * lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Don't define on Solaris when <sys/procfs.h> cannot be included. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Bruno Haible 37d5dc0d 2017-04-19T00:05:34 getopt-gnu: Add comments. * m4/getopt.m4 (gl_FUNC_GETOPT_GNU): Add comments. * modules/getopt-gnu (configure.ac): Likewise.
Paul Eggert ffc927ee 2017-04-08T23:48:02 getopt: prefer - to _ in new file names * lib/getopt-cdefs.in.h: Rename from lib/getopt_cdefs.in.h. * lib/getopt-core.h: Rename from lib/getopt_core.h. * lib/getopt-ext.h: Rename from lib/getopt_ext.h. * lib/getopt-pfx-core.h: Rename from lib/getopt_pfx_core.h. * lib/getopt-pfx-ext.h: Rename from lib/getopt_pfx_ext.h. All uses changed.
Paul Eggert 4172365d 2017-04-08T17:26:03 getopt: port recent getopt changes to macOS Problem reported by Harald Maier (Bug#26398). The macOS C compiler uses __nonnull for its own purposes and that clashes with glibc's __nonnull. * lib/getopt.in.h: Add comment for _GL_ARG_NONNULL snippet. * lib/getopt_cdefs.in.h (__nonnull): Remove. * lib/getopt_core.h (getopt): * lib/getopt_ext.h (getopt_long, getopt_long_only): Use _GL_ARG_NONNULL, not __nonnull. * lib/unistd.in.h: Move snippet hooks to before where the getopt .h files are included, so that _GL_ARG_NONNULL is defined in time. * modules/getopt-posix (Depends-on): Add snippet/arg-nonnull. (getopt.h): Interpolate _GL_ARG_NONNULL snippet.
Paul Eggert 28ac412b 2017-04-06T15:41:05 getopt-gnu: omit some duplicate code * m4/getopt.m4 (gl_FUNC_GETOPT_GNU): Don’t require gl_FUNC_GETOPT_POSIX, as the configure.ac code generated by gnulib-tool already does this. * modules/getopt-gnu (configure.ac): Omit code duplicated from getopt-posix, which we depend on.
Zack Weinberg e7207fdf 2017-04-06T11:14:14 getopt: split up getopt.in.h and eliminate __need_getopt Over in glibc, all of the __need macros are being phased out in favor of small headers that declare only the necessary components, as this is much simpler and less prone to bugs. As getopt is shared with glibc, gnulib needs to do the same for __need_getopt. __need_getopt is misnamed; what it really means is "we want only the getopt features specified in POSIX, not the GNU extensions". glibc placed the "meat" of getopt.h into getopt_core.h and getopt_ext.h; these files can be shared verbatim with gnulib. The portability wrapper, on the other hand, they have renounced altogether; glibc's getopt.h will no longer be shared with gnulib at all. In exchange, certain glibc-specific quirks (having to do with __posix_getopt) no longer need appear in gnulib's headers at all. This patch merges getopt_core.h and getopt_ext.h from glibc, and splits up the current gnulib-side portability wrapper into three additional headers: getopt_pfx_core.h and getopt_pfx_ext.h handle __GETOPT_PREFIX for their respective headers, getopt_cdefs.in.h handles things like __BEGIN_DECLS and __THROW, and getopt.in.h and unistd.in.h just use them. All new files are clearly marked with whether they are shared with glibc. * lib/getopt.in.h: Eliminate __need_getopt. Break up into ... * lib/getopt_core.h, lib/getopt_ext.h: ... these new files shared with glibc, and ... * lib/getopt_cdefs.in.h, lib/getopt_pfx_core.h * lib/getopt_pfx_ext.h: ... these new files not shared with glibc. * lib/unistd.in.h: Include getopt_cdefs.h and getopt_pfx_core.h, instead of defining __need_getopt and including the full getopt.h. * m4/getopt.m4 (gl_GETOPT_SUBSTITUTE_HEADER): Check for sys/cdefs.h. Define substitution variables GETOPT_CDEFS_H and HAVE_SYS_CDEFS_H. * modules/getopt-posix (Files): Add new headers and sort list. (Depends-on): No longer need snippet/arg-nonnull. (Makefile.am): Generate getopt_cdefs.h.
Zack Weinberg fbd6c988 2017-04-06T11:14:13 getopt: clean up getopt.c and getopt1.c file headers In getopt.c, there is no need to include wchar.h at all, and it is safe nowadays to assume that stdlib.h does declare getenv (several other gnulib modules make this assumption). In getopt1.c, the #ifdef _LIBC block at the top can be simplified by using "" inclusions consistently, and there is no actual need to include stdlib.h (except in the #ifdef TEST block, where it should be unconditional), nor to provide a backup definition of NULL at all. * lib/getopt1.c: Simplify #ifdeffage at top of file. Move inclusion of stdlib.h to #ifdef TEST block and make unconditional. Do not define NULL. * lib/getopt.c: Don't include wchar.h. No need to declare getenv. * m4/getopt.m4 (gl_PREREQ_GETENV): Delete. * modules/getopt-gnu, modules/getopt-posix: Don't call gl_PREREQ_GETENV.
Bruno Haible 06d9e730 2017-04-02T21:53:54 relocatable-lib-lgpl: Fix link error (regression from 2011-06-16). * modules/relocatable-lib-lgpl (configure.ac): Add AC_LIBOBJ invocation, like it was done in modules/relocatable-lib on 2011-05-21 and in modules/relocatable-prog on 2011-08-15. Reported by Reuben Thomas <rrt@sc3d.org>.
Bruno Haible c1a21de2 2017-03-15T22:07:56 vma-iter: Add support for HP-UX. * modules/vma-iter (configure.ac): Check for 'pstat_getprocvm'. * lib/vma-iter.c (vma_iterate): On HP-UX, use pstat_getprocvm(). * lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on HP-UX. * lib/get-rusage-as.c: Update comment about HP-UX. * lib/get-rusage-data.c: Likewise. (get_rusage_data): Use get_rusage_data_via_setrlimit.
Paul Eggert 47cbe8ba 2017-03-14T13:23:25 snippets: move unadjusted snippet sources to lib Problem reported by Michal Privoznik in: http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00039.html * lib/_Noreturn.h: Rename from build-aux/snippet/_Noreturn.h. * lib/arg-nonnull.h: Rename from build-aux/snippet/arg-nonnull.h. * lib/c++defs.h: Rename from build-aux/snippet/c++defs.h. * lib/unused-parameter.h: Rename from build-aux/snippet/unused-parameter.h. * lib/warn-on-use.h: Rename from build-aux/snippet/warn-on-use.h. * modules/snippet/_Noreturn (Files:, _NORETURN_H): * modules/snippet/arg-nonnull (Files:, ARG_NONNULL_H): * modules/snippet/c++defs (Files:, CXXDEFS_H): * modules/snippet/unused-parameter (Files:, UNUSED_PARAMETER_H): * modules/snippet/warn-on-use (Files: WARN_ON_USE_H): Adjust to file renamings.
Mathieu Lirzin f30205c5 2017-03-14T12:19:40 gnulib-tool: don't automatically distribute files from top/ * gnulib-tool (func_get_automake_snippet_unconditional): To be able to not distribute top/README-release by default, don't distribute files from top/ unconditionally. * modules/gnumakefile (Makefile.am): Distribute top/GNUmakefile. * modules/maintainer-makefile (Makefile.am): Distribute top/maint.mk.
Paul Eggert 1c2185b8 2017-03-14T01:20:11 snippets: work around GNU Make 3.82 VPATH When using 'gnulib-tool --gnu-make' on Emacs, and building the resulting tarball on Solaris 10 which bundles GNU Make 3.82, an out-of-source (VPATH) build failed because the sans-copyright snippet file was not built before the file that used it. Presumably this is some sort of VPATH thing. Work around the problem by using the original snippet, i.e., don’t bother to remove its copyright notice. * modules/snippet/_Noreturn, modules/snippet/link-warning: Don’t assume Automake in comments. Omit long-incorrect comment. * modules/snippet/arg-nonnull (BUILT_SOURCES, arg-nonnull.h) (MOSTLYCLEANFILES): * modules/snippet/c++defs (BUILT_SOURCES, c++defs.h) (MOSTLYCLEANFILES): * modules/snippet/unused-parameter (BUILT_SOURCES, unused-parameter.h) (MOSTLYCLEANFILES): * modules/snippet/warn-on-use (BUILT_SOURCES, warn-on-use.h) (MOSTLYCLEANFILES): Remove. * modules/snippet/arg-nonnull (ARG_NONNULL_H): * modules/snippet/c++defs (CXXDEFS_H): * modules/snippet/unused-parameter (UNUSED_PARAMETER_H): * modules/snippet/warn-on-use (WARN_ON_USE_H): Don’t bother to remove the copyright notice; just use the original snippet as-is.
Pádraig Brady 405cd675 2017-03-08T19:44:46 parse-datetime: remove extraneous generated source file * modules/parse-datetime: Remove the tmp generated source.
Bruno Haible bc1d4143 2017-03-04T11:24:37 tests: Avoid compiler warning about uses of null_ptr. * tests/null-ptr.h: New file. * tests/test-canonicalize.c: Include null-ptr.h. (null_ptr): Remove function. * tests/test-canonicalize-lgpl.c: Likewise. * tests/test-memmem.c: Likewise. * tests/test-ptsname_r.c: Likewise. * modules/canonicalize-tests (Files): Add tests/null-ptr.h. * modules/canonicalize-lgpl-tests: Likewise. * modules/memmem-tests: Likewise. * modules/ptsname_r-tests: Likewise. Reported by Jim Meyering.
Pádraig Brady 3f61a6d1 2017-02-20T20:26:35 nproc: support nested OMP_NUM_THREADS, and OMP_THREAD_LIMIT * lib/nproc.c (parse_omp_threads): A new function refactored from num_processors() to support parsing both of the above environment variables. (num_processors): Prefer using omp_get_num_threads() with [_OPENMP] to accurately reflect the current OpenMP nesting level. Also support the OMP_THREAD_LIMIT environment variable to limit the max value determined from OMP_NUM_THREADS. * modules/nproc: Depend on minmax header. Suggested by Oliver Heimlich.
Bruno Haible 6361efe6 2017-02-20T22:34:24 lock tests: Fix build failure on z/OS. Reported by Daniel Richard G. <skunk@iskunk.org>. * modules/lock-tests (configure.ac): Test for <semaphore.h>. * tests/test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not exist.
Paul Eggert 820fa6ad 2017-02-16T00:17:56 xbinary-io: rename from xsetmode This patch is taken from suggestions by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00060.html http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00061.html * lib/binary-io.c (__gl_setmode_check): Set errno to EINVAL, not ENOTTY, when it is an inappropriate device. * lib/binary-io.h (SET_BINARY): Resurrect. * lib/xbinary-io.c: Rename from lib/xsetmode.c. (xset_binary_mode_error): Rename from xsetmode_error. * lib/xbinary-io.h: Rename from lib/xsetmode.h. (xset_binary_mode): Rename from xsetmode. All uses changed. * modules/xbinary-io: Rename from modules/xsetmode. Update file names. * tests/test-binary-io.sh (tmpfiles): Remove no-longer-used file name. * NEWS: Update to match revised behavior.
Paul Eggert 7de8fbee 2017-02-15T14:30:33 xsetmode: new module This is to fix a problem noted by Eric Blake. Code was using xfreopen to change files to binary mode, but this fails for stdout when in append mode. Such code should use xsetmode instead. * NEWS: Document incompatible changes to binary-io module. * lib/binary-io.c (__gl_setmode_check) [__DJGPP__ || __EMX__]: New function. * lib/binary-io.h (__gl_setmode): Rename from set_binary_mode. (set_binary_mode): New function, which also checks for tty. * lib/xsetmode.c, lib/xsetmode.h, modules/xsetmode: New files.
Bruno Haible e3f94e9d 2017-02-10T22:42:36 search: Don't assume that tsearch() exists if 'VISIT' is defined. * m4/search_h.m4 (gl_SEARCH_H): Determine HAVE_TYPE_VISIT. * modules/search (Makefile.am): Substitute HAVE_TYPE_VISIT. * lib/search.in.h (VISIT): Define if HAVE_TYPE_VISIT is 0.
Bruno Haible b6acb8db 2017-02-01T22:47:27 lock tests: Fix link error. * modules/lock-tests (test_rwlock1_LDADD): Add @YIELD_LIB@. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Paul Eggert 4e6e16b3 2017-01-20T17:11:55 parse-datetime: handle timezones reentrantly This API change was prompted by a report by Pádraig Brady in: https://bug.debian.org/851934#10 To help fix the bug, make parse_datetime2 more reentrant. * NEWS: Document this incompatible change. * lib/parse-datetime.h, lib/parse-datetime.y (parse_datetime2): Add two arguments, the timezone and the timezone name. All callers changed. If TZ="..." is specified, use it for calculating defaults. * lib/parse-datetime.y: Don't include xalloc.h or use xmalloc, as this code should be usable in a library. (mktime_ok, get_effective_timezone): Accept timezone arg too. All callers changed. (get_tz): Remove. (get_effective_timezone): Check for failures. * modules/parse-datetime: Add time_r, time_rz. Remove xalloc.
Eric Blake bb276b41 2017-01-19T14:26:30 localename: port to cygwin 2.6 Cygwin 2.6 introduced uselocale() and thread-local locales in general, but lacks any way to get at the name of each portion of a locale_t object short of peeking behind an opaque object. Cygwin has just been patched to add NL_LOCALE_NAME() patterned after glibc's extension of the same name[1], but as that version of Cygwin has not yet been released, we might as well work around it in the meantime. [1] https://sourceware.org/ml/newlib/2017/msg00071.html * lib/localename.c (gl_locale_name_thread_unsafe): Add clause for Cygwin. * modules/localename (Depends-on): Add extensions, since NL_LOCALE_NAME() is not visible without it. Signed-off-by: Eric Blake <eblake@redhat.com>
Pádraig Brady 440ea67a 2017-01-17T09:08:14 parse-datetime: fix dependence on AC_PROG_SED * modules/parse-datetime: Use `sed` directly like all other modules. Reported by J William Piggott
Bruno Haible 60ce0fd7 2017-01-16T22:07:51 host-cpu-c-abi: Add support for armhf, arm64, x32, s390x. * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Require gl_C_ASM. On x86_64 systems, distinguish x86_64 and x32. On arm systems, distinguish arm, armhf, arm64, and no longer distinguish arm and armel. On s390x systems, distinguish s390 and s390x. * modules/host-cpu-c-abi (Files): Add m4/asm-underscore.m4. * NEWS: Mention the change regarding 'armel'.
Paul Eggert 916a6324 2017-01-10T14:35:34 dfa: port to older GCC Problem reported by Assaf Gordon in: http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html * modules/c99: New module. This merely attempts to use the latest C version, which should be enough to solve this particular problem. The idea is to document which Gnulib modules assume C99 or later. * modules/dfa (Depends-on): Add it.
Paul Eggert e89646ad 2017-01-09T11:55:22 maint: time stamp -> timestamp Use the spelling "timestamp", as that is what POSIX uses.
Pádraig Brady 73ecb533 2017-01-03T00:52:13 parse-datetime: fix generated paths for coverage files * modules/parse-datetime: Adjust the paths for parse-datetime.y within parse-datetime.c, so that gcc generates appropriate .gcno files, allowing lcov to proceed without error. Previously it would error trying to find "lib/lib/parse-datetime.y".
Bruno Haible be95b17a 2017-01-05T12:51:36 lock: Provide guarantee to avoid writer starvation for rwlocks. The rationale is: 1) Read-preferring read-write locks are prone to writer starvation if the number of reader threads multiplied by the percentage of time they have the lock held is too high. 2) Write- preferring read-write locks are the only reliable way to avoid this. 3) There have been reports of 'test-lock' hanging on glibc systems http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00009.html, and glibc indeed implements read-preferring rwlocks by default, see http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html and https://sourceware.org/bugzilla/show_bug.cgi?id=13701 . * m4/pthread_rwlock_rdlock.m4: New file. * m4/lock.m4 (gl_LOCK): Invoke gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. * lib/glthread/lock.h [USE_POSIX_THREADS]: Test HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation of rwlock initialization on glibc systems without HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation of rwlocks altogether on non-glibc systems without HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. [USE_PTH_THREADS]: Use a different implementation of rwlocks altogether. * lib/glthread/lock.c [USE_POSIX_THREADS] (glthread_rwlock_init_for_glibc): New function. [USE_POSIX_THREADS] (glthread_rwlock_rdlock_multithreaded): Update comment. [USE_PTH_THREADS]: New implementation of rwlocks. [USE_WINDOWS_THREADS] (glthread_rwlock_rdlock_func): Prefer writers over readers. * modules/lock (Files): Add m4/pthread_rwlock_rdlock.m4. (Depends-on): Add 'extensions'. * tests/test-rwlock1.c: New file. * lock-tests (Files): Add it. (Depends-on): Add usleep. (Makefile.am): Add test-rwlock1 to the tests.
Paul Eggert a3fd683d 2017-01-01T02:59:23 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert 8e63aebd 2016-12-29T01:16:51 xalloc: x2nrealloc check for ptrdiff_t overflow * lib/xalloc.h (x2nrealloc): Check for ptrdiff_t overflow, too. * modules/xalloc, modules/xvasprintf (Depends-on): Add stdint.
Bruno Haible 5a400b3f 2016-12-19T21:12:54 stdint: Fix WINT_MAX to match the gnulib provided wint_t on minw. * m4/wint_t.m4 (gt_TYPE_WINT_T): Define GNULIB_OVERRIDES_WINT_T here. * m4/stdint.m4 (gl_STDINT_H): Don't define GNULIB_OVERRIDES_WINT_T. Invoke gt_TYPE_WINT_T instead. (gl_STDINT_TYPE_PROPERTIES): Test GNULIB_OVERRIDES_WINT_T. * modules/stdint (Files): Add m4/wint_t.m4. * modules/wchar (Makefile.am): Substitute GNULIB_OVERRIDES_WINT_T. * modules/wctype-h (Makefile.am): Likewise. * lib/wchar.in.h (wint_t): Override if GNULIB_OVERRIDES_WINT_T is set, not only on MSVC. * lib/wctype.in.h (wint_t): Likewise.
Paul Eggert 571a9a5a 2016-12-19T08:20:45 getopt-posix-tests: fix Makefile typo * modules/getopt-posix-tests (test_getopt_posix_LDADD): Fix typo: the last ‘_’ was missing in the name. I suspect that the typo explains this build failure: https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/39 although I can’t reproduce the problem on Solaris 10 sparc.
Bruno Haible bd70cf69 2016-12-18T14:03:37 Split tests for getopt-posix and getopt-gnu. * tests/test-getopt-posix.c: New file. * tests/test-getopt-gnu.c: New file, with code from test-getopt.c. * tests/test-getopt-main.h: Renamed from tests/test-getopt.c. Remove stuff moved to test-getopt-gnu.c. Test TEST_GETOPT_GNU instead of GNULIB_TEST_GETOPT_GNU. * modules/getopt-posix-tests (Files): Add test-getopt-posix.c, test-getopt-main.h. Remove test-getopt.c, test-getopt_long.h. (Makefile.am): Test test-getopt-posix instead of test-getopt. * modules/getopt-gnu-tests: New file. * modules/getopt-gnu (configure.ac): Don't define GNULIB_TEST_GETOPT_GNU.
Bruno Haible 571d60e6 2016-12-18T13:07:43 getopt: Fix link error for users of getopt() in <unistd.h>. * lib/getopt.in.h (getopt etc.): Do the macro definitions also when __need_getopt is defined. Undefine all macros before defining them. * modules/getopt (Include): Clarify that including <unistd.h> is also OK. * tests/test-getopt.c: Add comment.
Bruno Haible f9c744db 2016-12-18T00:38:37 getlogin, getlogin_r: Fix link errors on MSVC. * m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro. * modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN. (Link): New section. * modules/getlogin_r (Files): Add m4/getlogin.m4. (configure.ac): Require gl_LIB_GETLOGIN. (Link): New section. * NEWS: Mention the new link requirements. * modules/getlogin-tests (test_getlogin_LDADD): New variable. * modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.
Bruno Haible 51150279 2016-12-17T20:51:33 tanhf: Avoid redefinition error on MSVC. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_TANHF. * m4/tanhf.m4 (gl_FUNC_TANHF): Set REPLACE_TANHF to 1 if the function may be defined as an inline function. * modules/math (Makefile.am): Substitute REPLACE_TANHF. * lib/math.in.h (tanhf): Override if REPLACE_TANHF is 1.
Bruno Haible 9ef2e6d2 2016-12-17T20:48:34 tanf: Avoid redefinition error on MSVC. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_TANF. * m4/tanf.m4 (gl_FUNC_TANF): Set REPLACE_TANF to 1 if the function may be defined as an inline function. * modules/math (Makefile.am): Substitute REPLACE_TANF. * lib/math.in.h (tanf): Override if REPLACE_TANF is 1.