KO Myung-Hun [Thu, 14 Jan 2016 02:23:47 +0000 (11:23 +0900)]
dup, dup2, fcntl: support a directory fd on OS/2 kLIBC
On OS/2 kLIBC, dup(), dup2() and fcntl() do not work on a directory
fd.
* lib/dup.c (dup_nothrow): New.
* lib/dup2.c (klibc_dup2dirfd): New. dup2() for a directory fd.
(klibc_dup2): New.
* lib/fcntl.c (klibc_fcntl): New.
* m4/dup.m4 (gl_FUNC_DUP): Check if dup() works on a directory fd.
* m4/dup2.m4 (gl_FUNC_DUP2): Check if dup2() works on a directory fd.
* m4/fcntl.m4 (gl_FUNC_FCNTL): Check if F_DUPFD works on a directory
fd.
KO Myung-Hun [Thu, 14 Jan 2016 02:23:46 +0000 (11:23 +0900)]
pipe_filter_ii_execute: port to OS/2 kLIBC
Pipes on kLIBC do not support O_NONBLOCK like Win32.
* lib/pipe-filter-ii.c (start_wrapper, _beginthreadex, CloseHandle,
WaiForSingleObject, WaitForMultipleObjects): New on OS/2 kLIBC.
Reuse Win32 code on OS/2 kLIBC.
* lib/spawn-pipe.c: Reuse Win32 code on OS/2 kLIBC.
* lib/w32spawn.h: Do not include windows.h on OS/2 kLIBC.
KO Myung-Hun [Thu, 14 Jan 2016 02:23:45 +0000 (11:23 +0900)]
wchar: fix "conflicting types" error for __wcwidth on OS/2 kLIBC
On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
static inline function. The implementation of wcwidth in wcwidth.c
causes a "conflicting types" error.
* lib/wchar.in.h: Undefine wcwidth on OS/2 kLIBC.
Pádraig Brady [Thu, 14 Jan 2016 09:47:39 +0000 (09:47 +0000)]
sig2str: list all signals on FreeBSD >= 7
FreeBSD >= 7 is contravening POSIX by not defining NSIG
to the maximal statically defined signal value.
It does define _SIG_MAXSIG though, so base SIGNUM_BOUND on that.
* lib/sig2str.h (SIGNUM_BOUND): Define to (_SIG_MAXSIG - 2)
where available, even when NSIG is defined.
Paul Eggert [Wed, 13 Jan 2016 19:10:28 +0000 (11:10 -0800)]
acl-permissions: port to USE_ACL==0 platforms
I ran into this problem when building bleeding-edge GNU Emacs
with gcc -fsanitize=address on Fedora 23. On this platform
the ACL library does not pass the 'configure' test and Emacs
then does not build due in part to what appear to be typos in the
ACL part of Gnulib.
* lib/acl-internal.c (free_permission_context):
* lib/acl-internal.h (struct permission_context):
Test whether USE_ACL is nonzero, not whether it is defined.
Paul Eggert [Tue, 12 Jan 2016 23:20:39 +0000 (15:20 -0800)]
Port "$@" to OpenIndiana ksh93
In http://lists.gnu.org/archive/html/bug-autoconf/2015-12/msg00000.html
Pavel Raiskup reports that ${1+"$@"} runs afoul of a bug in /bin/sh
(derived from ksh 93t+ 2010-03-05). ${1+"$@"} works around an ancient
bug long-dead shells, so remove the workaround.
* build-aux/announce-gen, build-aux/do-release-commit-and-tag:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/prefix-gnulib-mk, build-aux/update-copyright:
* build-aux/useless-if-before-free, tests/test-update-copyright.sh:
Use "$@" instead of ${1+"$@"}.
Paul Eggert [Tue, 12 Jan 2016 17:29:40 +0000 (09:29 -0800)]
Port Universal Time settings to strict POSIX
* build-aux/announce-gen, build-aux/bootstrap:
* build-aux/do-release-commit-and-tag, build-aux/git-version-gen:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/gnupload, build-aux/mkinstalldirs:
* build-aux/move-if-change, build-aux/prefix-gnulib-mk:
* build-aux/update-copyright, build-aux/useless-if-before-free:
* build-aux/vc-list-files, tests/test-strftime.c:
Use TZ="UTC0", not TZ="UTC". Either works on GNU platforms,
but POSIX says the behavior of TZ="UTC" is undefined.
Paul Eggert [Sun, 3 Jan 2016 00:19:53 +0000 (16:19 -0800)]
msvc-inval: fix problem with unset shell var
Problem reported by Karl Berry in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00004.html
* modules/msvc-inval (Depends-on):
AC_REQUIRE gl_MSVC_INVAL instead of merely calling it.
* modules/msvc-nothrow (Depends-on): Likewise for gl_MSVC_NOTHROW.
Paul Eggert [Fri, 1 Jan 2016 08:56:19 +0000 (00:56 -0800)]
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'.
Daiki Ueno [Sun, 27 Dec 2015 21:27:42 +0000 (06:27 +0900)]
maint: fix operator precedence in mbrtowc test
This is a fix for test breakage introduced by commit 45228d96; the
equality expression must be parenthesized when negated with '!',
otherwise we always get:
James Youngman [Wed, 23 Dec 2015 19:22:40 +0000 (19:22 +0000)]
regexprops-generic: update from regex.h
* doc/regexprops-generic.texi: update by running the regexprops binary
from findutils (the command line is 'regexprops "Regular Expressions"
generic'). The recent (ish) change (5a5a9388) to regex.h aligning
gnulib with GNU grep had made this document out-of-date.
Pádraig Brady [Tue, 22 Dec 2015 15:45:56 +0000 (15:45 +0000)]
strftime-tests: avoid false failure on OS X
* tests/test-strftime.c (struct localtime_rz_test): Add an
ahistorical member which is used to warn rather than fail
when tm_isdst isn't set for such entries. This is the case for
"1970-01-01 13:00:00 +1300 (NZDT)" on Darwin 13/14 at least.
Kamil Dudka [Wed, 9 Dec 2015 06:34:56 +0000 (07:34 +0100)]
fts: ensure leaf optimization is used for NFS
NFS provides usable dirent.d_type but not necessarily for all entries
of large directories. See <https://bugzilla.redhat.com/1252549>
* lib/fts.c (leaf_optimization_applies): Append NFS on the white list.
* build-aux/prefix-gnulib-mk (prefix_assignment): Don't change the RHS
of 'V_GPERF.* = ' lines. Reported by Assaf Gordon in:
https://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00015.html
Paul Eggert [Thu, 17 Dec 2015 20:56:55 +0000 (12:56 -0800)]
intprops-test: work around GCC bug 68971
Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00011.html
* tests/test-intprops.c: Ignore -Woverflow in GCC 6 and earlier.
(main): Add a case that better tests 64-bit long in this area.
Pavel Raiskup [Sat, 21 Nov 2015 13:09:15 +0000 (14:09 +0100)]
gnulib-tool: allow multiple --local-dir usage
* gnulib-tool: Use --local-dir to construct compound
$local_gnulib_path path instead of $local_gnulib_dir. Determine
PATH_SEPARATOR early.
(local_gnulib_dir): Rename into $local_gnulib_path everywhere.
(func_gnulib_dir): Cut out PATH_SEPARATOR detection code into
func_determine_path_separator because that needs to be detected
earlier now.
(func_determine_path_separator): New function.
(func_path_foreach, func_path_foreach_inner): New functions.
(func_path_prepend, func_path_append): Likewise.
(func_lookup_local_file, func_lookup_local_file_cb): Likewise.
(func_lookup_file, func_all_modules): Use new functions to work
with local_gnulib_path.
(func_modules_in_dir, func_exists_module): New callbacks for
func_path_foreach.
(func_exists_module, func_get_tests_module): Likewise.
(func_is_local_file, func_should_symlink): New helper methods.
(func_add_file, func_update_file): Use new func_should_symlink
instead, DRY.
(func_reconstruct_cached_local_gnulib_path): New helper.
(func_reconstruct_cached_dir): New callback.
(func_import): The cached_local_gnulib_dir renamed to
cached_local_gnulib_path similarly to local_gnulib_dir.
Use new func_reconstruct_cached_local_gnulib_path.
(func_count_relative_local_gnulib_path): New sub-method.
(func_create_testdir): Use func_should_symlink, DRY.
(func_create_megatestdir): Use new functions to work with
local_gnulib_path correctly.
(func_append_local_dir): New helper.
Paul Eggert [Tue, 10 Nov 2015 20:31:38 +0000 (12:31 -0800)]
intprops: new public macro EXPR_SIGNED
Emacs can use this macro, so make it public.
* doc/intprops.texi (Arithmetic Type Properties): Rename from
'Integer Type Determination', since some of these macros apply
to non-integer types. Clarify what kinds of constant expressions
these macros return. Say when the arguments can be non-integers.
Mention newly published macro EXPR_SIGNED.
* lib/intprops.h (EXPR_SIGNED): Rename from _GL_INT_SIGNED, to
make it public. All uses changed.
Paul Eggert [Fri, 6 Nov 2015 01:41:43 +0000 (17:41 -0800)]
timespec-sub: fix overflow bug; add tests
* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Work even if time_t is narrower than int (a theoretical
possibility). Redo code for a bit more clarity.
* lib/timespec-sub.c (timespec_sub):
Fix off-by-2 bug if a.tv_sec == TYPE_MINIMUM (time_t) and 0 < b.tv_sec.
* modules/timespec-tests, tests/test-timespec.c: New files.
Paul Eggert [Thu, 5 Nov 2015 15:46:32 +0000 (07:46 -0800)]
intprops-test: suppress -Woverlength-strings
Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00008.html
It is not worth the hassle to port this test to compilers that
cannot handle long strings in diagnostics.
* tests/test-intprops.c [__GNUC__]: Ignore -Woverlength-strings.
Pádraig Brady [Wed, 4 Nov 2015 23:01:25 +0000 (23:01 +0000)]
quotearg: add quotearg_n_style_colon()
This quotes with default options of the specified style,
but with quoting enabled for instances of ':'.
While this can be simulated by temporarily modifying
the default quoting style, this is a little awkward,
and care must be taken with such an implementation
to avoid inlining leading to bloated text.
* lib/quotearg.h (quotearg_n_style_colon): Description and declaration.
* lib/quotearg.c (quotearg_n_style_colon): New function implementation.
Paul Eggert [Wed, 4 Nov 2015 16:27:57 +0000 (08:27 -0800)]
intprops: revise _WRAPV macros, revert _OVERFLOW
The incompatible changes to the _OVERFLOW macros were too much of
a hassle in practice, so revert them. Instead, change the new
_WRAPV macros to make them closer in behavior to GCC 5's new
builtin_add_overflow etc. functions. No other software was using
these newly-added macros yet, so this should be OK.
* NEWS: Revert previous change, since the incompatible change
has been reverted, and nobody used the incompatible version.
* doc/intprops.texi (Wraparound Arithmetic, Integer Type Overflow):
Document revised behavior.
(Integer Range Overflow): Adjust example to match above revisions.
* lib/intprops.h (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW)
(INT_MULTIPLY_OVERFLOW): Revert previous change, so that
these can be used in integer constant expressions again.
(INT_CONST_ADD_OVERFLOW, INT_CONST_SUBTRACT_OVERFLOW)
(INT_CONST_MULTIPLY_OVERFLOW): Remove, as these are no longer
needed.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, INT_LEFT_SHIFT_WRAPV):
Remove, as they did not seem that useful.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV)
(_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH)
(_GL_INT_OP_WRAPV_VIA_UNSIGNED):
Support new semantics.
(__has_builtin): New macro, if not alreay defined.
(_GL__GENERIC_BOGUS, _GL_INT_OP_CALC, _GL_INT_OP_CALC1): New macros.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): Remove.
(CHECK_SBINOP, CHECK_SSUM, CHECK_SUM1, CHECK_SSUM1)
(CHECK_SDIFFERENCE, CHECK_SPRODUCT, CHECK_PRODUCT1, CHECK_SPRODUCT1):
New macros.
(CHECK_BINOP, CHECK_UNOP, main, CHECK_SUM): Test new behavior.
Jim Meyering [Tue, 3 Nov 2015 16:32:27 +0000 (08:32 -0800)]
intprops: add parentheses for when OP has precedence lower than "-"
* lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): In "a OP b - c",
"a OP b" must be parenthesized for when OP is like "<<", which has
lower precedence than the following "-". Reported by Pádraig Brady.
Pádraig Brady [Fri, 30 Oct 2015 22:49:16 +0000 (22:49 +0000)]
quotearg: add support for $'' shell escaping
* lib/quotearg.h: Add "shell-escape" and "shell-escape-always"
items and descriptions.
* lib/quotearg.c (quotearg_buffer_restyled): Add support for the
above types by quoting like "shell", but using $'...' syntax
for non printable characters, which should provide unambiguous
printable output for any input.
* tests/test-quotearg-simple.c: Update accordingly.
Pádraig Brady [Mon, 2 Nov 2015 11:25:47 +0000 (11:25 +0000)]
maint: use a more standard return from mbrtowc test
* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Don't return 1
from the test program as this is non standard and often
indicates an unhandled case in the test program.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): Likewise.
Paul Eggert [Fri, 30 Oct 2015 20:45:26 +0000 (13:45 -0700)]
intprops: add WRAPV and const flavors for GCC 5
If available, use GCC 5's builtin functions for efficient integer
overflow checking. Also, add macros like INT_ADD_WRAPV that efficently
and safely compute the low-order bits of the correct answer.
A downside of these efficient functions is that they cannot be
used in constant expressions, so add macros like INT_CONST_ADD_OVERFLOW
and INT_CONST_ADD_WRAPV that can be used even in constant expressions.
* NEWS: Document the incompatible changes to INT_ADD_OVERFLOW etc.
* doc/intprops.texi (Integer Properties, Integer Type Overflow):
Document the changes.
(Wraparound Arithmetic): New section.
(Integer Range Overflow):
Put this subsection last, since it's least useful.
* lib/intprops.h (INT_CONST_ADD_OVERFLOW)
(INT_CONST_SUBTRACT_OVERFLOW, INT_CONST_MULTIPLY_OVERFLOW):
New macros, with the meaning that INT_ADD_OVERFLOW etc. used to have.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, _GL_INT_OP_WRAPV, _GL_EXPR_CAST)
(_GL_INT_OP_WRAPV_LONGISH, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV, _GL_OP_OVERFLOW, _GL_OP_WRAPV, _GL_OP_WRAPV_GENSYM):
New macros.
(INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW, INT_MULTIPLY_OVERFLOW):
Generate calls to GCC builtins if available, for speed.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): New macros.
(main, CHECK_BINOP, CHECK_UNOP, CHECK_SUM, CHECK_PRODUCT)
(CHECK_QUOTIENT, CHECK_REMAINDER):
Test WRAPV and CONST flavors (when available) too.
Pádraig Brady [Fri, 23 Oct 2015 02:15:40 +0000 (03:15 +0100)]
doc: use extended timezone format in iso-8601 example
* doc/parse-datetime.texi: The standard states that extended
format (separated with ':') is to be used consistently throughout.
Note that lib/parse-datetime.y can handle either tz format.
Paul Eggert [Mon, 19 Oct 2015 05:18:49 +0000 (22:18 -0700)]
stdalign: work around pre-4.9 GCC x86 bug
* lib/stdalign.in.h (_Alignof): Work around bug in pre-4.9 GCC on
x86, when -std=gnu11 is used. Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-10/msg00038.html
* top/maint.mk (tight_scope): This is not really required since
commit 3ef58f46 as sed_wrap ensures we don't get an empty expression
that matches all nm entries. But it does remove extraneous entries
that may be confusing or cause issue in future maintenance.
Paul Eggert [Sun, 18 Oct 2015 16:52:45 +0000 (09:52 -0700)]
fts: port to C11 alignof
* doc/posix-headers/stdalign.texi (stdalign.h):
Document the C11 restriction.
* lib/fts.c: Include stddef.h, for max_align_t.
(fts_alloc): Align using max_align_t, not FTSENT.
* modules/fts (Depends-on): Add stddef.
Jim Meyering [Sun, 18 Oct 2015 16:32:21 +0000 (09:32 -0700)]
time_rz: avoid warning from bleeding-edge gcc's -Wnonnull
Compiling with gcc version 6.0.0 20151017 (experimental) (GCC), I
would see this:
lib/time_rz.c: In function 'localtime_rz':
lib/time_rz.c:292:15: error: nonnull argument 'tm' compared to NULL \
[-Werror=nonnull]
if (tm && !save_abbr (tz, tm))
^
That was complaining about "tm" because it is a parameter that was
declared with the __nonnull__ attribute.
* lib/time_rz.c (localtime_rz): Don't bother setting "tm" to the
result of localtime_r.
Jim Meyering [Sun, 18 Oct 2015 02:18:01 +0000 (19:18 -0700)]
maint.mk: _gl_TS_function_match: fix "extern" name extracting regexp
* top/maint.mk (_gl_TS_function_match): This heuristic extern-function-
name-extraction regexp mistakenly used \S+, and would mistakenly
extract "*F" from "extern int *F()" rather than the desired "F".
Use \w+ instead.
Jim Meyering [Sun, 18 Oct 2015 03:12:48 +0000 (20:12 -0700)]
maint.mk: sc_tight_scope: factor and support OS X
* top/maint.mk (_gl_tight_scope): Address three issues:
- factor out four instances of code that wraps a string in "^...$"
- allow nm-reported symbol names to have an optional leading "_"
- add "main" to the list of ignored variable names, because on os x,
"main" has nm-reported type "S" in the variable-checking section.
Mike Frysinger [Thu, 15 Oct 2015 08:04:07 +0000 (17:04 +0900)]
localename: control langinfo.h inclusion
This header is only used to work around buggy behavior in old
versions of glibc, so do not include it all the time. Otherwise
we get build failures on systems that do not provide langinfo.h.
* lib/localename.c: Wrap langinfo.h include with same ifdefs used
in the source later on.
The patch was originally submitted to gettext as:
https://lists.gnu.org/archive/html/bug-gettext/2015-10/msg00011.html
Paul Eggert [Wed, 14 Oct 2015 06:25:18 +0000 (23:25 -0700)]
binary-io, math, pthread, sys_socket, u64, unistd: port to strict C
* lib/binary-io.c, lib/math.c, lib/pthread.c, lib/sys_socket.c:
* lib/u64.c, lib/unistd.c:
Append 'typedef int dummy;', to pacify compilers that are picky
about empty translation units.
Pino Toscano [Mon, 12 Oct 2015 11:27:10 +0000 (12:27 +0100)]
accept4-tests: fix to avoid non portable flags
* tests/test-accept4.c (main): Pass only SOCK_* flags to accept4(),
as they are the only documented ones, and passing others may trigger
EINVAL (seen on FreeBSD 10.1-RELEASE).
* doc/glibc-functions/accept4.texi: Mention that we don't provide
the SOCK_CLOEXEC or SOCK_NONBLOCK defines.
* gnulib-tool (func_emit_pre_early_macros): New function, it wraps
emitting of initial gl_EARLY macros.
(func_import, func_create_testdir): All dumps of gl_PROG_AR_RANLIB
replaced with func_emit_pre_early_macros call.
Pádraig Brady [Fri, 2 Oct 2015 19:21:50 +0000 (20:21 +0100)]
xalloc: avoid GCC 5.1 warning on 32 bit
* lib/xalloc.h: Disable -Wstrict-overflow for uses of
xalloc_oversized(), which was seen to give this warning
on GCC 5.1 on 32 bit: "assuming signed overflow does not occur
when simplifying conditional".
Daiki Ueno [Fri, 2 Oct 2015 02:27:40 +0000 (11:27 +0900)]
uniname/uniname-tests: avoid compiler warnings
* tests/uniname/test-uninames.c (fill_names, fill_aliases): Remove
unused local variables.
(test_alias_lookup): Fix alias name display in failure cases.
Paul Eggert [Sun, 27 Sep 2015 06:55:07 +0000 (23:55 -0700)]
c-ctype: do not worry about EBCDIC + char signed
Drop support for EBCDIC with char being signed, as this breaks too
many programs. Problem reported by Ben Pfaff in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00053.html
* lib/c-ctype.h: Verify that we are not using EBCDIC with
char being signed.
(_C_CTYPE_LOWER_A_THRU_F_N): New macro.
(_C_CTYPE_LOWER_N, _C_CTYPE_A_THRU_F): Use it.
(_C_CTYPE_DIGIT, _C_CTYPE_LOWER, _C_CTYPE_PUNCT, _C_CTYPE_UPPER):
(c_isascii, c_isgraph, c_isprint, c_ispunct, c_tolower, c_toupper):
* tests/test-c-ctype.c (test_all):
Simplify by assuming standard char values cannot be negative.
* tests/test-c-ctype.c (NCHARS, to_char): Remove; all uses removed.
Paul Eggert [Sat, 26 Sep 2015 02:45:59 +0000 (19:45 -0700)]
c-ctype: port better to z/OS EBCDIC
Problems reported by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00050.html
* lib/c-ctype.h (_C_CTYPE_CNTRL): Rewrite in terms of
the C standard escapes and _C_CTYPE_OTHER_CNTRL.
(_C_CTYPE_OTHER_CNTRL): New macro.
* tests/test-c-ctype.c (test_all): Test from CHAR_MIN, not
from SCHAR_MIN, as the functions are defined only from values
promoted from char or from unsigned char, not necessarily from
signed char.
The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR
and ARFLAGS variables. Doing this unconditionally could break
later Automake's AM_PROG_AR invocation (at least it's
AC_CHECK_TOOLS call to detect correct 'ar' binary).
Original purpose of the gl_PROG_AR_RANLIB was only to handle the
Amsterdam Compiler Kit, so make the previous code to have effects
only on ACK, and rather automatically call the Automake's
AM_PROG_AR as soon as possible to decide other cases.
* m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR.
Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR. If neither
is possible, keep setting AR/ARFLAGS to reasonable defaults.
* gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS
right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the
'extensions' module is used.
* modules/extensions (configure.ac-early): Remove as this snippet
is added to gnulib-comp.m4 earlier anyway.
Paul Eggert [Fri, 25 Sep 2015 18:16:27 +0000 (11:16 -0700)]
sockets: MS Windows initalization fixes
Problem reported by Test User in:
http://lists.gnu.org/archive/html/help-shishi/2015-09/msg00001.html
* lib/sockets.h (SOCKETS_1_0, SOCKETS_2_0, SOCKETS_2_1):
Correct the endianness.
* lib/sockets.c (gl_sockets_startup): Return 2 on any version
number mismatch, not just on <. Cleanup before any such failure.
* m4/gc.m4: Use AM_PATH_LIBCRYPT to test for libcrypt versions
at least as recent as 1.4.4. The previously used macro is not
available now, since modules were removed in version 1.6.0.
Paul Eggert [Fri, 25 Sep 2015 07:01:10 +0000 (00:01 -0700)]
c-ctype: rewrite to use inline functions
This simplifies maintenance, since it makes for just one
implementation of each function, letting the compiler have the fun
of optimization. In practice this works well nowadays with GCC.
E.g., c_isascii might need only three instructions even though the
source code lists every ASCII character individually in a large
switch statement.
Also, fix some z/OS porting bugs reported by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00037.html
* NEWS: Document the API change.
* lib/c-ctype.c: Drastically simplify, since this now just expands
inline functions.
* lib/c-ctype.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(C_CTYPE_INLINE): New macro.
(C_CTYPE_CONSECUTIVE_DIGITS, C_CTYPE_CONSECUTIVE_LOWERCASE)
(C_CTYPE_CONSECUTIVE_UPPERCASE): Remove.
Verify that either ASCII or EBCDIC is being used.
(_C_CTYPE_SIGNED_EBCDIC, _C_CTYPE_CNTRL, _C_CTYPE_A_THRU_F_N)
(_C_CTYPE_DIGIT_N, _C_CTYPE_LOWER_N, _C_CTYPE_UPPER_N)
(_C_CTYPE_CASES, _C_CTYPE_A_THRU_F, _C_CTYPE_DIGIT, _C_CTYPE_LOWER)
(_C_CTYPE_UPPER, _C_CTYPE_PUNCT_PLAIN):
New private macros.
(_C_CTYPE_CNTRL): In EBCDIC, '\x07' is a control, not '\xff'.
(c_isalnum, c_isalpha, c_isascii, c_isblank, c_iscntrl, c_isdigit)
(c_isgraph, c_islower, c_isprint, c_ispunct, c_isspace, c_isupper)
(c_isxdigit, c_tolower, c_toupper): Now inline functions.
(c_tolower, c_toupper): When converting, return the unsigned char,
as that is what z/OS does.
* lib/c-strcaseeq.h (CASEEQ): Simplify in the light of the removal
of some c-ctype.h macros.
* modules/c-ctype (Depends-on): Add extern-inline; remove verify.
* tests/test-c-ctype.c (test_all): Fix test for c_toupper and
c_tolower promotion to be compatible with z/OS.