Paul Eggert [Tue, 3 Jan 2017 00:05:14 +0000 (16:05 -0800)]
doc: modernize for C11 etc.
* doc/gnulib-readme.texi (Portability guidelines): Modernize a bit
for C11, MinGW, etc. This responds to Paul Smith's question in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00014.html
Paul Eggert [Mon, 2 Jan 2017 20:22:17 +0000 (12:22 -0800)]
dfa: prefer functions to FETCH_WC macro
* lib/dfa.c (FETCH_WC): Remove, replacing with ...
(fetch_wc, bracket_fetch_wc): ... new functions. These store the
wint_t result into DFA->lex.wctok instead of to a separate arg.
All callers changed. Move more local decls closer to where
they're used.
Paul Eggert [Mon, 2 Jan 2017 05:23:18 +0000 (21:23 -0800)]
dfa: prefer functions and constants to macros
* lib/dfa.c: Prefer constants to macros where either will do.
(streq, isasciidigit, newline_constraint)
(letter_constraint, other_constraint, succeeds_in_context)
(prev_newline_constraint, prev_letter_constraint)
(prev_other_constraint, prev_newline_dependent)
(prev_letter_dependent, accepting, accepts_in_context):
Now static functions instead of function-like macros.
Use lower-case names accordingly. All uses changed.
Jim Meyering [Sat, 31 Dec 2016 16:06:24 +0000 (08:06 -0800)]
dfa: narrow the scope of many local variables
* lib/dfa.c: Now that we are no longer constrained to c89, move
declarations of many variables (often indices) "down" into the
scope(s) where used or to the point of definition. This is a
no-semantic-change diff.
Paul Eggert [Sun, 1 Jan 2017 02:59:23 +0000 (02:59 +0000)]
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'.
Tagging during a rebase doesn't make sense, but it at least should
not choke with:
$ ./build-aux/do-release-commit-and-tag 1.4.18 stable
./build-aux/do-release-commit-and-tag: line 146: test: too many arguments
do-release-commit-and-tag: not on branch (no branch, rebasing branch-1.4)
* build-aux/do-release-commit-and-tag (curr_br): $branch can
contain spaces when rebasing.
Eric Blake [Sat, 31 Dec 2016 02:37:10 +0000 (20:37 -0600)]
maint.mk: hoist gnulib_dir definition earlier
Commit 1894933 introduced a temporary warning during all uses of 'make':
Can't open /lib/intprops.h: No such file or directory.
due to an early evaluation of $(shell) prior to the default definition
of $(gnulib_dir). While that has been fixed in commit ffff79d, hoisting
the definition to the top will prevent further edits from inadvertently
reintroducing the problem.
* top/maint.mk (gnulib_dir): Move near top of file.
Jim Meyering [Sat, 31 Dec 2016 09:31:59 +0000 (01:31 -0800)]
maint.mk: do not always evaluate intprops-related shell
* top/maint.mk (_intprops_names): Change := to just "=" to avoid
using gnulib_dir undefined (gnulib_dir is defined later in the
file, which will be fixed separately), and besides, there is no
need to incur the cost of this shell invocation for every single
use of this .mk file. Reported by Eric Blake in
https://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00137.html
Paul Eggert [Fri, 30 Dec 2016 08:42:22 +0000 (00:42 -0800)]
dfa: simplify multibyte_prop etc.
This follows up on a change made when dfa.c was in grep, namely grep
commit c797046c7c13c2647182b919a79a4c5b4ecf82b1
dated 2015-08-12 07:35:03 -0700, which removed unused multibyte support.
That earlier simplification allows for some more simplification
and trimming down here.
* lib/dfa.c (struct mb_char_classes): New member nchars_alloc.
(struct lexer_state): New mamber brack.
(struct dfa, addtok_mb): multibyte_prop elements are now char, not int,
since they must be in the range 0..3 now.
Remove members mbcsets, nmbcsets, mbcsets_alloc, since
the brack member now supersedes them.
(parse_bracket_exp): Update dfa->lex.brack instead of dfa->mbcsets.
(addtok): Use dfa->lex.brack instead of dfa->mbcsets.
(dfaparse): Remove unnecessary initializations of already-0 storage.
(free_mbdata): Free d->lex.brack.chars instead of d->mbcsets.
(dfassbuild): No need to clear sup->mbcsets.
Paul Eggert [Fri, 30 Dec 2016 05:44:17 +0000 (21:44 -0800)]
dfa: wrap charclass inside a struct
This lets GCC check for aliases more accurately.
On my platform (gcc Ubuntu 5.4.0-6ubuntu1~16.04.4 x86-64,
en_US.utf8 locale) this makes 'grep -Fi -f list.txt list.txt >out'
about 1% faster, where list.txt is generated by 'aspell dump
master | head -n 100000 >list.txt'. Also, it shrinks the grep
text by 64 bytes, woohoo! See Bug#22239.
* lib/dfa.c (charclass): Wrap inside a struct. All uses changed.
(CHARCLASS_INIT, tstbit, setbit, clrbit, zeroset, fillset, notset)
(equal, emptyset, charclass_index, setbit_wc, setbit_case_fold_c):
Adjust to this, e.g., by using charclass * rather than charclass.
All callers changed as needed.
(copyset): Remove. All uses changed to simple assignment.
(parse_bracket_exp): Use zeroset instead of memset.
Eric Blake [Thu, 29 Dec 2016 21:05:34 +0000 (15:05 -0600)]
getopt: fix parallel test failure
I hit a testsuite failure due to a failure removing test-getopt.tmp,
when running tests in parallel.
* tests/test-getopt-posix.c (TEST_GETOPT_TMP_NAME): Set name.
* tests/test-getopt-gnu.c (TEST_GETOPT_TMP_NAME): Likewise.
* tests/test-getopt-main.h (main): Use different file names
in case test-getopt-gnu and test-getopt-posix run in parallel.
Bruno Haible [Sat, 24 Dec 2016 17:21:59 +0000 (18:21 +0100)]
lock test: Fix performance problem on multi-core machines.
* tests/test-lock.c (USE_VOLATILE): New macro.
(struct atomic_int): New type.
(init_atomic_int, get_atomic_int_value, set_atomic_int_value): New
functions.
(lock_checker_done, rwlock_checker_done, reclock_checker_done): Define
as 'struct atomic_int'.
(lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock,
reclock_checker_thread, test_recursive_lock): Use the new functions.
Reported by Eric Blake in
https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html
and by Pádraig Brady in
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.
Paul Eggert [Mon, 19 Dec 2016 16:20:45 +0000 (08:20 -0800)]
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.
Paul Eggert [Mon, 19 Dec 2016 01:35:19 +0000 (17:35 -0800)]
dfa: improve worst-case 'replace' performance
See my note in Bug#22357#71.
* lib/dfa.c (insert, delete): Rework to avoid duplicate test.
(merge_constrained): New function, which is like
the old 'merge' function, except with a new argument C2.
Simplify the body by avoiding the need for different sections
of code depending on whether one input is exhausted.
(merge): Use the new function.
(delete): Return the constraint of the deleted position,
not the entire position. Caller changed.
(replace): Change from O(N*(N + log N)) to O(N log N) algorithm.
Norihiro Tanaka [Thu, 15 Dec 2016 00:31:57 +0000 (16:31 -0800)]
dfa: performance improvement for removal of epsilon closure
* lib/dfa.c (delete): Use binary search to find deleted index.
(replace): New function. It replaces a position with the followed set.
(epsclosure): Replace it with a new algorithm. Update caller.
Bruno Haible [Sun, 18 Dec 2016 13:03:37 +0000 (14:03 +0100)]
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 [Sun, 18 Dec 2016 12:07:43 +0000 (13:07 +0100)]
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 [Sat, 17 Dec 2016 23:27:17 +0000 (00:27 +0100)]
Un-deprecate the 'progname' module.
* NEWS: Describe the appropriate use-cases of 'progname' versus
'getprogname'. Based on discussion summary at
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00105.html
Bruno Haible [Sat, 17 Dec 2016 19:51:33 +0000 (20:51 +0100)]
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 [Sat, 17 Dec 2016 19:48:34 +0000 (20:48 +0100)]
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.
Bruno Haible [Sat, 17 Dec 2016 19:44:37 +0000 (20:44 +0100)]
sqrtf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SQRTF.
* m4/sqrtf.m4 (gl_FUNC_SQRTF): Set REPLACE_SQRTF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SQRTF.
* lib/math.in.h (sqrtf): Override if REPLACE_SQRTF is 1.
Bruno Haible [Sat, 17 Dec 2016 19:41:36 +0000 (20:41 +0100)]
sinhf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SINHF.
* m4/sinhf.m4 (gl_FUNC_SINHF): Set REPLACE_SINHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SINHF.
* lib/math.in.h (sinhf): Override if REPLACE_SINHF is 1.
Bruno Haible [Sat, 17 Dec 2016 19:38:33 +0000 (20:38 +0100)]
sinf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SINF.
* m4/sinf.m4 (gl_FUNC_SINF): Set REPLACE_SINF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SINF.
* lib/math.in.h (sinf): Override if REPLACE_SINF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:41:12 +0000 (19:41 +0100)]
expf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_EXPF.
* m4/expf.m4 (gl_FUNC_EXPF): Set REPLACE_EXPF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_EXPF.
* lib/math.in.h (expf): Override if REPLACE_EXPF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:36:54 +0000 (19:36 +0100)]
coshf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSHF.
* m4/coshf.m4 (gl_FUNC_COSHF): Set REPLACE_COSHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_COSHF.
* lib/math.in.h (coshf): Override if REPLACE_COSHF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:31:58 +0000 (19:31 +0100)]
cosf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSF.
* m4/cosf.m4 (gl_FUNC_COSF): Set REPLACE_COSF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_COSF.
* lib/math.in.h (cosf): Override if REPLACE_COSF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:26:04 +0000 (19:26 +0100)]
atan2f: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ATAN2F.
* m4/atan2f.m4 (gl_FUNC_ATAN2F): Set REPLACE_ATAN2F to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ATAN2F.
* lib/math.in.h (atan2f): Override if REPLACE_ATAN2F is 1.
Bruno Haible [Sat, 17 Dec 2016 18:21:51 +0000 (19:21 +0100)]
atanf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ATANF.
* m4/atanf.m4 (gl_FUNC_ATANF): Set REPLACE_ATANF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ATANF.
* lib/math.in.h (atanf): Override if REPLACE_ATANF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:15:56 +0000 (19:15 +0100)]
asinf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ASINF.
* m4/asinf.m4 (gl_FUNC_ASINF): Set REPLACE_ASINF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ASINF.
* lib/math.in.h (asinf): Override if REPLACE_ASINF is 1.
Bruno Haible [Sat, 17 Dec 2016 18:08:14 +0000 (19:08 +0100)]
acosf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ACOSF.
* m4/acosf.m4 (gl_FUNC_ACOSF): Set REPLACE_ACOSF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ACOSF.
* lib/math.in.h (acosf): Override if REPLACE_ACOSF is 1.
Bruno Haible [Sat, 17 Dec 2016 15:44:51 +0000 (16:44 +0100)]
Avoid redefinition errors on MSVC.
* m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if
the function may be defined as an inline function.
* m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if
the function may be defined as an inline function.
Bruno Haible [Sat, 17 Dec 2016 12:27:08 +0000 (13:27 +0100)]
fpending: Revert workaround against Emacs bug.
* lib/stdio-impl.h [__MINGW32__]: Revert conditional.
The Emacs bug is fixed by Eli Zaretskii in
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00715.html
Paul Eggert [Sat, 17 Dec 2016 02:20:21 +0000 (18:20 -0800)]
builtin-expect: improve port to IBM XL C
Problem reported for z/OS by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00079.html
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
Test for <builtins.h> directly.
Paul Eggert [Sat, 17 Dec 2016 00:47:26 +0000 (16:47 -0800)]
builtin-expect: port to IBM XL C
Problem reported for z/OS by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00074.html
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
Also allow __builtin_expect defined via a standard include file.
Paul Eggert [Fri, 16 Dec 2016 17:34:02 +0000 (09:34 -0800)]
regex: fix integer-overflow bug in never-used code
Problem reported by Clément Pit–Claudel in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html
* lib/regex_internal.h: Include intprops.h.
* lib/regexec.c (re_search_2_stub): Use it to avoid undefined
behavior on integer overflow.
* modules/regex (Depends-on): Add intprops.
Paul Eggert [Fri, 16 Dec 2016 15:38:58 +0000 (07:38 -0800)]
fpending: fix port to MinGW on Emacs
* lib/stdio-impl.h [__MINGW32__]: Do not include errno.h.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
Is Plan 9 still a valid porting target, anyway?
Paul Eggert [Thu, 15 Dec 2016 17:59:21 +0000 (09:59 -0800)]
xalloc: do not exceed PTRDIFF_MAX
* lib/xmalloc.c (xcalloc) [HAVE_GNU_CALLOC]: Do not omit
xalloc_oversized check, since objects larger than PTRDIFF_MAX
bytes have pointer-subtraction problems.
Paul Eggert [Thu, 15 Dec 2016 17:56:53 +0000 (09:56 -0800)]
malloca: do not exceed PTRDIFF_MAX
* lib/malloca.h: Include xalloc-oversized.
(nmalloca): Use xalloc_oversized instead of rolling our own.
* modules/malloca (Depends-on):
* modules/relocatable-prog-wrapper (Depends-on):
Add xalloc-oversized.
Paul Eggert [Thu, 15 Dec 2016 17:53:45 +0000 (09:53 -0800)]
quotearg: pacify GCC better
* modules/quotearg (Depends-on): Add minmax, stdint.
* lib/quotearg.c: Include minmax.h, stdint.h.
(nslots): Now int, as there seems little point to going to extra
work merely to support the INT_MAX slot, which nobody ever uses.
(quotearg_n_options): Redo size-overflow checks to pacify GCC
and to catch (mostly-theoretical) ptrdiff_t problems too.
This can be done via one comparison.
Paul Eggert [Thu, 15 Dec 2016 01:09:04 +0000 (17:09 -0800)]
xalloc-oversized: check for PTRDIFF_MAX too
This avoids undefined behavior when subtracting pointers to
objects containing more than PTRDIFF_MAX bytes.
* lib/xalloc-oversized.h (__xalloc_oversized, xalloc_oversized):
Also return 1 if the result would exceed PTRDIFF_MAX>
* modules/xalloc-oversized (Depends-on):
Add stdint.
Paul Eggert [Wed, 14 Dec 2016 21:21:04 +0000 (13:21 -0800)]
dfa: fix some unlikely integer overflows
I found these while reviewing the recent Coverity-related fix.
This patch changes part of dfa.c to prefer ptrdiff_t instead of
size_t for object counts. Using ptrdiff_t is the style typically
used in Emacs; although it wastes a sign bit as sizes can never be
negative, it makes -fsanitize=undefined more likely to catch
integer overflows in index calculation, and nowadays the upside is
typically more important than the downside. Although perhaps the
rest of dfa.c should be changed to prefer ptrdiff_t as well (much
of dfa.c already does, since it uses state_num which is signed),
that is a bigger change and is not needed to fix the bugs I found.
* lib/dfa.c: Include stdint.h and intprops.h.
(TOKEN_MAX): New macro.
(position_set, struct mb_char_classes, struct dfa, maybe_realloc)
(charclass_index, parse_bracket_exp, addtok, insert, merge)
(realloc_trans_if_necessary, free_mbdata):
Use ptrdiff_t instead of size_t for object counts related to xpalloc.
This is safe because xpalloc checks that the sizes do not exceed
either SIZE_MAX or PTRDIFF_MAX.
(xpalloc): New function, mostly taken from Emacs.
(maybe_realloc, copy, realloc_trans_if_necessary): Use it.
(maybe_realloc): Add NITEMS_MAX to signature. All callers changed.
(charclass_index): Check for integer overflow in computing
charclass index; it must not exceed TOKEN_MAX - CSET, as CSET is
added to it later.
(alloc_position_set): Check for integer overflow. On typical
platforms this check has zero overhead, since the constant
expression is false.
(realloc_trans_if_necessary):
Remove assertion, which I hope Coverity no longer needs.
* modules/dfa (Depends-on): Add intprops, stdint.
John W. Eaton [Tue, 13 Dec 2016 17:43:09 +0000 (12:43 -0500)]
link: fix test to declare use of rename()
The test in link.m4 needs to include <stdio.h> to provide a declaration
for the rename function. The test fails if building with GCC's
-Werror=implicit-function-declaration option.
This was reported as part of a bug with building Octave on Fedora, which
now uses -Werror=implicit-function-declaration by default.
Bruno Haible [Tue, 13 Dec 2016 10:19:35 +0000 (11:19 +0100)]
fpending: Port to native Windows with MSVC.
* lib/fpending.c: Include stdio-impl.h.
(__fpending): Include all known implementations. Err out if it's not
ported.
* m4/fpending.m4 (gl_PREREQ_FPENDING): Remove macro.
* modules/fpending (Files): Add lib/stdio-impl.h.
(configure.ac): Don't invoke gl_PREREQ_FPENDING.
Jim Meyering [Mon, 12 Dec 2016 06:39:42 +0000 (22:39 -0800)]
non-recursive-gnulib-prefix-hack.m4: remove leading "(" in case stmt
* m4/non-recursive-gnulib-prefix-hack.m4: That leading "(" happens
to work with most shells, but not with the one provided by many
Solaris 10 systems, so running configure with such a /bin/sh evokes
e.g., "./configure: syntax error at line 33602: `(' unexpected".
Reported by Assaf Gordon in
https://lists.gnu.org/archive/html/sed-devel/2016-12/msg00002.html
Bruno Haible [Sat, 10 Dec 2016 13:04:42 +0000 (14:04 +0100)]
threadlib: Optimize out runtime test on Solaris >= 10.
* m4/threadlib.m4 (gl_THREADLIB_BODY): Don't set
PTHREAD_IN_USE_DETECTION_HARD if configuring on Solaris 10 or newer.
Reported by Peter Felecan at <https://savannah.gnu.org/bugs/?32087>.
Paul Eggert [Fri, 9 Dec 2016 23:09:03 +0000 (15:09 -0800)]
dfa: fix performance bug that recomputes trans
* lib/dfa.c (build_state): Fix performance bug introduced in Nov
25 on-demand changes. The bug caused build_state to reset all
d->trans elements to -2 even when d->trans was already non-null.
Use C99 style decls after statements in this function.
Paul Eggert [Fri, 9 Dec 2016 16:16:13 +0000 (08:16 -0800)]
same-inode: port to MinGW
Here st_ino is always 0, so change the definition of SAME_INODE so
that 1 means the two files are the same, 0 with st_ino != 0 means
they differ, and 0 with st_ino == 0 means we don’t know. Problem
reported by Bruno Haible (Bug#25146).
* doc/posix-headers/sys_stat.texi (sys/stat.h): Update.
* lib/same-inode.h (SAME_INODE): Return 0 on MinGW.
gnulib-tool: properly list the LGPL3orGPLv2 license
* gnulib-tool (func_import): Adhere to the license guideline when
rewriting the license text to "LGPLv3+ or GPLv2":
https://www.gnu.org/prep/maintain/maintain.html#Licensing-of-GNU-Packages