diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-23 10:45:42 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-23 14:41:54 -0700 |
commit | 32107c10ed727cc70661f6856e423b4863e94ffc (patch) | |
tree | f5d543ca48a8ce905a92f04a0b95835cb9bf3cdc /modules | |
parent | f320c1ebec8a551bfd32d264371a1c4ab4c8f0d6 (diff) | |
download | gnulib-32107c10ed727cc70661f6856e423b4863e94ffc.tar.gz |
glob: merge from glibc with Zanella glob changes
Merge glob from glibc, with changes for glob proposed
by Adhemerval Zanella in the thread starting here:
https://sourceware.org/ml/libc-alpha/2017-08/msg01079.html
plus some fixes for this merge.
* lib/flexmember.h: Change license wording to something that
works unchanged in Glibc, since this code might be used in
Glibc and this will minimize 'diff' output.
* lib/glob_internal.h, lib/glob_pattern_p.c, lib/globfree.c:
New files, ported from glibc.
* lib/glob_pattern_p.c, lib/globfree.c, lib/glob.c [!_LIBC]:
Include <config.h> first.
* lib/glob-libc.h (_Restrict_): Remove. All uses replaced
with __restrict.
(__size_t): Remove. All uses replaced by size_t.
(size_t): Define by defining __need_size_t and including <stddef.h>.
This should work even in non-glibc platforms, where any name
pollution is OK.
Use __USE_MISC instead of __USE_BSD || __USE_GNU.
(struct stat64): Don’t worry about __GLOB_GNULIB.
(glob, globfree, glob_pattern_p): Remove macros for
__USE_FILE_OFFSET64 && __GNUC__ < 2 && !defined __GLOB_GNULIB
case. Remove _GL_ARG_NONNULL as GNU behavior is to accept NULL
but set errno.
* lib/glob.c (_GL_ARG_NONNULL) [!_LIBC]: Remove. All uses
removed since the glibc behavior works on null pointers.
Do not include stdio.h; old SunOS is irrelevant now.
Do not worry about GLOB_ONLY_P as we now mimic glibc here.
Include glob_internal.h.
(D_INO_TO_RESULT): Depend on (_LIBC || D_INO_IN_DIRENT), not
((POSIX || WINDOWS32) && !__GNU_LIBRARY__). The latter probably
worked only coincidentally.
(attribute_hidden, __attribute_noinline__, __glibc_unlikely):
Remove macros; now done in glob.in.h.
(size_add_wrapv): Do not use __builtin_add_overflow if __ICC.
(glob): Properly initialize glob structure with
GLOB_BRACE|GLOB_DOOFFS (bug 20707).
Remove old code using SHELL since Bash no longer
uses this.
(glob, prefix_array): Separate MS code better.
(glob, glob_in_dir): Use C99 decls before statements when glibc
does.
(glob_in_dir): Remove old Amiga and VMS code.
(globfree, __glob_pattern_type, __glob_pattern_p): Move to
separate files.
* lib/glob.in.h (attribute_hidden, __attribute_noinline__)
(__glibc_unlikely):
Move here from glob.c.
(__restrict): New macro here, replacing the _Restrict_ in glob.c.
(weak_alias): New macro.
(__size_t): Remove. All uses replaced by size_t.
* modules/d-ino (License): Now LGPLv2+, for compatibility with glob.
* modules/flexmember (License): Now LGPLv2+, which it should have
been anyway since flexmember.h is not unlimited-license.
* modules/glob (Files): Add +lib/glob_internal.h,
lib/glob_pattern_p.c, lib/globfree.c.
(Depends-on): Remove snippet/arg-nonnull.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/d-ino | 2 | ||||
-rw-r--r-- | modules/flexmember | 2 | ||||
-rw-r--r-- | modules/glob | 10 |
3 files changed, 9 insertions, 5 deletions
diff --git a/modules/d-ino b/modules/d-ino index e8d6abafae..fdc6b41bf6 100644 --- a/modules/d-ino +++ b/modules/d-ino @@ -14,7 +14,7 @@ Makefile.am: Include: License: -LGPL +LGPLv2+ Maintainer: Jim Meyering diff --git a/modules/flexmember b/modules/flexmember index 510767619d..2afdc93ef2 100644 --- a/modules/flexmember +++ b/modules/flexmember @@ -15,7 +15,7 @@ Makefile.am: Include: License: -unlimited +LGPLv2+ Maintainer: Paul Eggert, Jim Meyering diff --git a/modules/glob b/modules/glob index 29df7ab89b..0d64124c17 100644 --- a/modules/glob +++ b/modules/glob @@ -6,17 +6,20 @@ Files: lib/glob.in.h lib/glob-libc.h lib/glob.c +lib/glob_internal.h +lib/glob_pattern_p.c +lib/globfree.c m4/glob.m4 Depends-on: extensions largefile -snippet/arg-nonnull snippet/c++defs snippet/warn-on-use alloca [test -n "$GLOB_H"] builtin-expect [test -n "$GLOB_H"] closedir [test -n "$GLOB_H"] +d-ino [test -n "$GLOB_H"] d-type [test -n "$GLOB_H"] dirfd [test -n "$GLOB_H"] flexmember [test -n "$GLOB_H"] @@ -37,6 +40,8 @@ configure.ac: gl_GLOB if test -n "$GLOB_H"; then AC_LIBOBJ([glob]) + AC_LIBOBJ([glob_pattern_p]) + AC_LIBOBJ([globfree]) gl_PREREQ_GLOB fi @@ -46,12 +51,11 @@ BUILT_SOURCES += $(GLOB_H) # We need the following in order to create <glob.h> when the system # doesn't have one that works with the given compiler. if GL_GENERATE_GLOB_H -glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ - -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/glob.in.h; \ } > $@-t && \ |