]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agolibgmp: remove dependency on havelib
Paul Eggert [Sun, 26 Jul 2020 16:57:47 +0000 (09:57 -0700)]
libgmp: remove dependency on havelib

* m4/libgmp.m4 (gl_LIBGMP): If gl_HAVE_MODULE_HAVELIB is not defined,
use the more-traditional AC_SEARCH_LIBS approach.
This should work better with GNU Emacs configuration,
which uses pkg-config instead of a havelib-style approach.
* modules/havelib (gl_HAVE_MODULE_HAVELIB): New witness macro.
* modules/libgmp (Depends-on): Remove havelib.

4 years agolibgmp: remove HAVE_GMP, LIB_GMP
Paul Eggert [Sun, 26 Jul 2020 00:42:18 +0000 (17:42 -0700)]
libgmp: remove HAVE_GMP, LIB_GMP

* m4/libgmp.m4 (gl_LIBGMP): Do not define HAVE_GMP and LIB_GMP, as
they’re redundant.  I’ll adjust GNU Coreutils accordingly.

4 years agointtypes: Remove support for AIX 4.
Bruno Haible [Sun, 26 Jul 2020 13:17:40 +0000 (15:17 +0200)]
inttypes: Remove support for AIX 4.

* lib/inttypes.in.h: Assume that PRI_MACROS_BROKEN is 0.
* m4/inttypes-pri.m4: Remove file.
* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Don't require gt_INTTYPES_PRI.
(gl_INTTYPES_H_DEFAULTS): Don't initialize PRI_MACROS_BROKEN.
* modules/inttypes-incomplete (Makefile.am): Don't substitute
PRI_MACROS_BROKEN.
* modules/inttypes (Files): Remove m4/inttypes-pri.m4.

4 years agogettimeofday: Remove workaround for Mac OS X 10.0.
Bruno Haible [Sun, 26 Jul 2020 11:46:35 +0000 (13:46 +0200)]
gettimeofday: Remove workaround for Mac OS X 10.0.

* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY_CLOBBER): Remove macro.
(gl_FUNC_GETTIMEOFDAY): Don't invoke it.
* lib/gettimeofday.c: Don't include localtime-buffer.h.
(gettimeofday): Don't test GETTIMEOFDAY_CLOBBERS_LOCALTIME.
* lib/localtime.c: Don't test GETTIMEOFDAY_CLOBBERS_LOCALTIME.
* modules/gettimeofday (Depends-on): Remove localtime-buffer.
* modules/localtime-buffer: Remove file.
* lib/localtime-buffer.h: Remove file.
* lib/localtime-buffer.c: Remove file.
* m4/localtime-buffer.m4: Remove file.
* MODULES.html.sh (Date and time <time.h>): Remove localtime-buffer.

4 years agotzset: Remove workaround for Solaris 2.6.
Bruno Haible [Sun, 26 Jul 2020 11:17:18 +0000 (13:17 +0200)]
tzset: Remove workaround for Solaris 2.6.

* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Remove macro.
(gl_FUNC_TZSET): Don't invoke it. Don't define TZSET_CLOBBERS_LOCALTIME.
Don't require gl_LOCALTIME_BUFFER_DEFAULTS.
* lib/localtime-buffer.h: Don't test TZSET_CLOBBERS_LOCALTIME.
* lib/localtime-buffer.c: Likewise.
* lib/localtime.c: Likewise.
* lib/tzset.c: Don't include localtime-buffer.h.
(tzset): Don't test TZSET_CLOBBERS_LOCALTIME.
* lib/nstrftime.c (__strftime_internal): Assume HAVE_RUN_TZSET_TEST
is 1.
* modules/tzset (Depends-on): Remove localtime-buffer.

4 years agoexpl: Simplify autoconf test.
Bruno Haible [Sun, 26 Jul 2020 10:22:00 +0000 (12:22 +0200)]
expl: Simplify autoconf test.

* m4/expl.m4 (gl_FUNC_EXPL): Merge the "checking whether expl() breaks
with small values..." test into the "checking whether expl works..."
test.

4 years agoalloca: Remove Cray-2 and Cray Y-MP support.
Bruno Haible [Sun, 26 Jul 2020 09:52:44 +0000 (11:52 +0200)]
alloca: Remove Cray-2 and Cray Y-MP support.

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA): Don't define CRAY_STACKSEG_END.
Enable also on Autoconf >= 2.69.
* lib/alloca.c (ADDRESS_FUNCTION, struct stack_control_header,
struct stack_segment_linkage, struct stk_stat, struct stk_trailer,
i00afunc): Remove.

4 years agomultiarch: Prepare for x86_64+arm64 universal binaries in macOS 11.
Bruno Haible [Sun, 26 Jul 2020 00:00:11 +0000 (02:00 +0200)]
multiarch: Prepare for x86_64+arm64 universal binaries in macOS 11.

* m4/multiarch.m4 (gl_MULTIARCH): Recognize also the ARM architectures.

4 years agosigprocmask: Small autoconf macro improvement.
Bruno Haible [Sat, 25 Jul 2020 23:54:38 +0000 (01:54 +0200)]
sigprocmask: Small autoconf macro improvement.

* m4/signalblocking.m4 (gl_SIGNALBLOCKING): Make it possible for the
user to override the value of gl_cv_func_sigprocmask.
* m4/gnulib-common.m4 (gl_SILENT): New macro.

4 years agoSmall autoconf macro improvements.
Bruno Haible [Sat, 25 Jul 2020 23:45:32 +0000 (01:45 +0200)]
Small autoconf macro improvements.

* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Make it possible for the user to
override the value of gl_cv_func_working_mktime.
* m4/multiarch.m4 (gl_MULTIARCH): Show a line "checking whether the
compiler produces multi-arch binaries..." in the configure output.
* m4/size_max.m4 (gl_SIZE_MAX): When not found, say "no".
* m4/parse-datetime.m4 (gl_C_COMPOUND_LITERALS): Improve indentation.

4 years agodoc: Update for NetBSD 7.1, 8.0, 9.0.
Bruno Haible [Sat, 25 Jul 2020 21:27:40 +0000 (23:27 +0200)]
doc: Update for NetBSD 7.1, 8.0, 9.0.

* doc/*/*.texi: Update.
* m4/exp2l.m4: Update comments.
* m4/expl.m4: Likewise.
* m4/ilogb.m4: Likewise.
* m4/ilogbf.m4: Likewise.
* m4/log10l.m4: Likewise.
* m4/logl.m4: Likewise.
* m4/printf.m4: Likewise.
* m4/rintl.m4: Likewise.
* m4/wcwidth.m4: Likewise.

4 years agodoc: Revert another small part of the last big commit.
Bruno Haible [Sat, 25 Jul 2020 15:11:15 +0000 (17:11 +0200)]
doc: Revert another small part of the last big commit.

4 years agodoc: Fix small mistake in last commit.
Bruno Haible [Sat, 25 Jul 2020 15:03:23 +0000 (17:03 +0200)]
doc: Fix small mistake in last commit.

* doc/posix-functions/open.texi: Keep in sync with doc/posix-headers/fcntl.texi.

4 years agodoc: Update for Mac OS X 10.13.
Bruno Haible [Fri, 24 Jul 2020 23:38:31 +0000 (01:38 +0200)]
doc: Update for Mac OS X 10.13.

* doc/*/*.texi: Update.
* m4/expm1l.m4: Update comments.
* m4/getgroups.m4: Likewise.
* m4/getlogin_r.m4: Likewise.
* m4/linkat.m4: Likewise.
* m4/printf.m4: Likewise.

4 years agodoc: Update for Cygwin 2.9.0.
Bruno Haible [Fri, 24 Jul 2020 23:37:59 +0000 (01:37 +0200)]
doc: Update for Cygwin 2.9.0.

* doc/*/*.texi: Update.

4 years agoparse-datetime: modernize doc
Paul Eggert [Fri, 24 Jul 2020 19:20:14 +0000 (12:20 -0700)]
parse-datetime: modernize doc

* doc/parse-datetime.texi: Use more-current examples.
Don’t lead with 32-bit time_t, as it’s on its way out.
Capitalize “Epoch” to be consistent with POSIX.

4 years agotimespec: remove dependence on ‘verify’
Paul Eggert [Fri, 24 Jul 2020 17:58:46 +0000 (10:58 -0700)]
timespec: remove dependence on ‘verify’

* lib/timespec.h: Do not include verify.h; no longer needed.
* modules/timespec (Depends-on): Remove ‘verify’.

4 years agoOptimize a few more three-valued comparisons
Paul Eggert [Fri, 24 Jul 2020 16:52:36 +0000 (09:52 -0700)]
Optimize a few more three-valued comparisons

* lib/timespec.h (timespec_cmp, timespec_sign):
* lib/utimecmp.c (utimecmpat):
Avoid conditional branches by using _GL_CMP.

4 years agoFix _GL_CMP parenthesization typo
Paul Eggert [Fri, 24 Jul 2020 15:57:05 +0000 (08:57 -0700)]
Fix _GL_CMP parenthesization typo

* m4/gnulib-common.m4 (_GL_CMP): Properly parenthesize.

4 years agodfa: Revert breaking gawk.
Bruno Haible [Fri, 24 Jul 2020 12:25:30 +0000 (14:25 +0200)]
dfa: Revert breaking gawk.

Reported by Arnold Robbins <arnold@skeeve.com>.

* lib/dfa.c (compare): Don't reference the _GL_CMP macro.

4 years agoOptimize three-valued comparison between integers.
Bruno Haible [Wed, 22 Jul 2020 16:35:20 +0000 (18:35 +0200)]
Optimize three-valued comparison between integers.

(a > b ? 1 : a < b ? -1 : 0) is the same as (a > b) - (a < b).

* m4/gnulib-common.m4 (gl_COMMON): Define _GL_CMP.
* lib/c-strcasecmp.c (c_strcasecmp): Use _GL_CMP.
* lib/c-strncasecmp.c (c_strncasecmp): Likewise.
* lib/dfa.c (compare): Likewise.
* lib/fts.c (fts_compare_ino): Likewise.
* lib/mbmemcasecmp.c (mbmemcasecmp): Likewise.
* lib/mbscasecmp.c (mbscasecmp): Likewise.
* lib/mbsncasecmp.c (mbsncasecmp): Likewise.
* lib/memcasecmp.c (memcasecmp): Likewise.
* lib/memcmp2.c (memcmp2): Likewise.
* lib/savedir.c (direntry_cmp_inode): Likewise.
* lib/strcasecmp.c (strcasecmp): Likewise.
* lib/strncasecmp.c (strncasecmp): Likewise.
* lib/unistr/u-cmp2.h (FUNC): Likewise.

4 years agolchmod: Use /proc on Cygwin.
Bruno Haible [Thu, 23 Jul 2020 21:16:05 +0000 (23:16 +0200)]
lchmod: Use /proc on Cygwin.

* lib/lchmod.c (lchmod): Use /proc on Cygwin.

4 years agofchmodat: Use /proc on Cygwin
Ken Brown [Thu, 23 Jul 2020 17:44:22 +0000 (13:44 -0400)]
fchmodat: Use /proc on Cygwin

* lib/fchmodat.c (fchmodat): Use /proc on Cygwin.

4 years agoaligned-malloc: Optionally use aligned_alloc.
Bruno Haible [Tue, 21 Jul 2020 16:09:35 +0000 (18:09 +0200)]
aligned-malloc: Optionally use aligned_alloc.

* lib/aligned-malloc.h: Verify the alignment.
(aligned_malloc): Use aligned_alloc as an alternative.
* modules/aligned-malloc (configure.ac): Test for aligned_alloc.
* doc/posix-functions/aligned_alloc.texi: Mention the modules
'aligned-malloc' and 'pagealign_alloc'.

4 years agoaligned-malloc: Add tests.
Bruno Haible [Tue, 21 Jul 2020 08:04:36 +0000 (10:04 +0200)]
aligned-malloc: Add tests.

* tests/test-aligned-malloc.c: New file.
* modules/aligned-malloc-tests: New file.

4 years agoaligned-malloc: New module.
Bruno Haible [Tue, 21 Jul 2020 08:03:42 +0000 (10:03 +0200)]
aligned-malloc: New module.

* lib/aligned-malloc.h: New file.
* m4/malloc-align.m4: New file.
* modules/aligned-malloc: New file.
* doc/posix-functions/posix_memalign.texi: Mention the new module.
* doc/glibc-functions/memalign.texi: Likewise.

4 years agointtypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.
Bruno Haible [Tue, 21 Jul 2020 07:53:29 +0000 (09:53 +0200)]
inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.

* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): On 64-bit native Windows, make
sure PRIPTR_PREFIX is defined to "ll", not "l".

4 years agoprintf-posix: Make an autoconf test more future-proof.
Bruno Haible [Tue, 21 Jul 2020 07:48:09 +0000 (09:48 +0200)]
printf-posix: Make an autoconf test more future-proof.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): Include <inttypes.h> before
using uintptr_t.

4 years agolist, oset, omap: Relicense some of the container modules under LGPLv2+.
Bruno Haible [Mon, 20 Jul 2020 19:22:12 +0000 (21:22 +0200)]
list, oset, omap: Relicense some of the container modules under LGPLv2+.

* modules/list (License): Change to LGPLv2+.
* modules/array-list (License): Likewise.
* modules/carray-list (License): Likewise.
* modules/linked-list (License): Likewise.
* modules/avltree-list (License): Likewise.
* modules/rbtree-list (License): Likewise.
* modules/oset (License): Likewise.
* modules/array-oset (License): Likewise.
* modules/avltree-oset (License): Likewise.
* modules/rbtree-oset (License): Likewise.
* modules/omap (License): Likewise.
* modules/array-omap (License): Likewise.
* modules/avltree-omap (License): Likewise.
* modules/rbtree-omap (License): Likewise.

4 years agooset: Add an 'update' operation.
Bruno Haible [Mon, 20 Jul 2020 18:06:29 +0000 (20:06 +0200)]
oset: Add an 'update' operation.

* lib/gl_array_oset.c (gl_array_update): New function.
(gl_array_oset_implementation): Use it.
* lib/gl_avltree_omap.c (NODE_PAYLOAD_DISPOSE): Add parameters.
* lib/gl_rbtree_omap.c (NODE_PAYLOAD_DISPOSE): Add parameters.
* lib/gl_avltree_ordered.h (gl_tree_add_node_before): New function,
extracted from gl_tree_nx_add_before.
(gl_tree_nx_add_before): Invoke it.
(gl_tree_add_node_after): New function, extracted from
gl_tree_nx_add_after.
(gl_tree_nx_add_after): Invoke it.
(gl_tree_remove_node_no_free): New function, extracted from
gl_tree_remove_node.
(gl_tree_remove_node): Invoke it.
* lib/gl_rbtree_ordered.h (gl_tree_add_node_before): New function,
extracted from gl_tree_nx_add_before.
(gl_tree_nx_add_before): Invoke it.
(gl_tree_add_node_after): New function, extracted from
gl_tree_nx_add_after.
(gl_tree_nx_add_after): Invoke it.
(gl_tree_remove_node_no_free): New function, extracted from
gl_tree_remove_node.
(gl_tree_remove_node): Invoke it.
* lib/gl_anytree_oset.h (gl_tree_next_node): New function, extracted
from gl_tree_iterator_next.
(gl_tree_iterator_next): Invoke it.
(gl_tree_prev_node, gl_tree_update): New functions.
* lib/gl_avltree_oset.c (NODE_PAYLOAD_DISPOSE): Add parameters.
(gl_avltree_oset_implementation): Use gl_tree_update.
* lib/gl_rbtree_oset.c (NODE_PAYLOAD_DISPOSE): Add parameters.
(gl_rbtree_oset_implementation): Use gl_tree_update.
* lib/gl_oset.h (struct gl_oset_implementation): Add 'update' member.
(gl_oset_update): New function.
* lib/gl_oset.hh (gl_OSet): Add 'update' member.
* modules/avltree-oset (configure.ac): Require AC_C_INLINE.
* modules/rbtree-oset (configure.ac): Likewise.
* tests/test-oset-update.h: New file.
* tests/test-array_oset.c: Include test-oset-update.h.
(main): Invoke test_update.
* tests/test-avltree_oset.c: Likewise.
* tests/test-rbtree_oset.c: Likewise.
* modules/array-oset-tests (Files): Add tests/test-oset-update.h.
* modules/avltree-oset-tests (Files): Likewise.
* modules/rbtree-oset-tests (Files): Likewise.
* tests/test-oset-c++.cc (action): New function.
(main): Test the 'update' member function.

4 years agomd5, sha1, sha256, sha512: pacify Autoconf 2.70
Paul Eggert [Wed, 15 Jul 2020 17:57:05 +0000 (10:57 -0700)]
md5, sha1, sha256, sha512: pacify Autoconf 2.70

* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Use m4_if rather than a
shell if, so that the argument to AC_CHECK_HEADERS is
a simple string that does not require shell evaluation.
This fixes a warning generated by Autoconf 2.69b.

4 years agoautoupdate
Karl Berry [Mon, 13 Jul 2020 14:17:03 +0000 (07:17 -0700)]
autoupdate

4 years agolibgmp: Avoid warning when --without-libgmp is used.
Bruno Haible [Sun, 12 Jul 2020 21:56:29 +0000 (23:56 +0200)]
libgmp: Avoid warning when --without-libgmp is used.

* lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
GCC >= 8, not for GCC >= 4.6.

4 years agolibgmp: Link to the correct shared library.
Bruno Haible [Sun, 12 Jul 2020 21:47:52 +0000 (23:47 +0200)]
libgmp: Link to the correct shared library.

* m4/libgmp.m4 (gl_LIBGMP): Invoke AC_LIB_HAVE_LINKFLAGS.
* modules/libgmp (Depends-on): Add havelib.
(Link): Mention $(LIBGMP) and $(LTLIBGMP).
* modules/libgmp-tests (Makefile.am): Link test-libgmp with $(LIBGMP).

4 years agolibgmp tests: Add some safety checks.
Bruno Haible [Sun, 12 Jul 2020 20:51:22 +0000 (22:51 +0200)]
libgmp tests: Add some safety checks.

* modules/libgmp-tests (Depends-on): Add verify.
* tests/test-libgmp.c: Verify GMP_NUMB_BITS value.
(main): Verify that gmp.h and libgmp versions match.

4 years agoAdd a copyright header.
Bruno Haible [Sun, 12 Jul 2020 20:23:30 +0000 (22:23 +0200)]
Add a copyright header.

* tests/test-libgmp.c: Add a copyright header.

4 years agoautoupdate
Karl Berry [Sun, 12 Jul 2020 15:13:33 +0000 (08:13 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Sat, 11 Jul 2020 15:09:12 +0000 (08:09 -0700)]
autoupdate

4 years agoautoupdate
Karl Berry [Fri, 10 Jul 2020 15:48:34 +0000 (08:48 -0700)]
autoupdate

4 years agounicodeio: Fix wrong result on NetBSD.
Bruno Haible [Fri, 10 Jul 2020 07:51:52 +0000 (09:51 +0200)]
unicodeio: Fix wrong result on NetBSD.

* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters also on NetBSD.

4 years agounicodeio: Fix wrong result on Solaris 11.
Bruno Haible [Thu, 9 Jul 2020 15:28:48 +0000 (17:28 +0200)]
unicodeio: Fix wrong result on Solaris 11.

Reported by Kiyoshi Kanazawa <yoi_no_myoujou@yahoo.co.jp>
via Akim Demaille <akim.demaille@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00036.html>.

* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters on Solaris.
* tests/test-unicodeio.c (main): In the "C" locale, expect either the
UTF-8 output or the specified fallback.

4 years agounicodeio: Add tests.
Bruno Haible [Wed, 8 Jul 2020 18:01:36 +0000 (20:01 +0200)]
unicodeio: Add tests.

* tests/test-unicodeio.c: New file.
* tests/test-unicodeio1.sh: New file.
* tests/test-unicodeio2.sh: New file.
* tests/test-unicodeio3.sh: New file.
* modules/unicodeio-tests: New file.

4 years agounicodeio: Document link requirements.
Bruno Haible [Wed, 8 Jul 2020 18:00:00 +0000 (20:00 +0200)]
unicodeio: Document link requirements.

* modules/unicodeio (Link): New section.

4 years agodoc: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 01:21:36 +0000 (03:21 +0200)]
doc: Remove support for some very old platforms.

* doc/posix-functions/memcmp.texi: Don't mention "older platforms".
* doc/posix-functions/memcpy.texi: Likewise.
* doc/posix-functions/memmove.texi: Likewise.
* doc/posix-functions/memset.texi: Likewise.
* doc/posix-functions/getcwd.texi: Likewise.

4 years agomemchr: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 01:19:54 +0000 (03:19 +0200)]
memchr: Remove support for some very old platforms.

* m4/memchr-obsolete.m4: Remove file.
* modules/memchr-obsolete: Remove file.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Assume module 'memchr-obsolete' is
absent. Don't define HAVE_MEMCHR.
* lib/string.in.h (memchr): Assume HAVE_MEMCHR is 1.
* modules/memchr (Depends-on): Remove memchr-obsolete.
(configure.ac): Assume HAVE_MEMCHR is 1.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't initialize
HAVE_MEMCHR.
* modules/string (Makefile.am): Don't substitute HAVE_MEMCHR.
* doc/posix-functions/memchr.texi: Don't mention module
'memchr-obsolete'.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* modules/strnlen (Depends-on): Remove memchr-obsolete.

4 years agodup2: Remove support for some very old platforms.
Bruno Haible [Wed, 8 Jul 2020 00:52:09 +0000 (02:52 +0200)]
dup2: Remove support for some very old platforms.

* m4/dup2-obsolete.m4: Remove file.
* modules/dup2-obsolete: Remove file.
* m4/dup2.m4 (gl_FUNC_DUP2): Assume module 'dup2-obsolete' is absent.
Don't define HAVE_DUP2.
* lib/unistd.in.h (dup2): Assume HAVE_DUP2 is 1.
* lib/dup2.c: Likewise.
* modules/dup2 (Depends-on, configure.ac): Likewise.
(Depends-on): Remove dup2-obsolete.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize HAVE_DUP2.
* modules/unistd (Makefile.am): Don't substitute HAVE_DUP2.
* doc/posix-functions/dup2.texi: Don't mention module 'dup2-obsolete'.

4 years agocanonicalize: Trim module dependencies.
Bruno Haible [Wed, 8 Jul 2020 00:07:38 +0000 (02:07 +0200)]
canonicalize: Trim module dependencies.

* lib/hash-triple.h: Group declarations.
* lib/hash-triple-simple.c: New file, extracted from lib/hash-triple.c.
* lib/hash-triple.c: Don't include <stdlib.h>, <string.h>, hash-pjw.h.
(STREQ): Remove macro.
(triple_hash, triple_compare_ino_str, triple_free): Remove functions.
* modules/hash-triple-simple: New file, based on modules/hash-triple.
* modules/hash-triple (Files): Remove lib/hash-triple.h.
(Depends-on): Add hash-triple-simple. Remove hash-pjw.
* modules/canonicalize (Depends-on): Remove hash-triple. Add
hash-triple-simple.
* modules/file-set (Depends-on): Likewise.

4 years agoClarify dependencies to double-slash-root.
Bruno Haible [Tue, 7 Jul 2020 23:37:19 +0000 (01:37 +0200)]
Clarify dependencies to double-slash-root.

* modules/canonicalize (Files): Remove m4/double-slash-root.m4.
(Depends-on): Add double-slash-root.
* modules/canonicalize-lgpl (Depends-on): Add double-slash-root.
* modules/dirname-lgpl (Depends-on): Add double-slash-root.

4 years agolibgmp: new module
Paul Eggert [Tue, 7 Jul 2020 01:54:11 +0000 (18:54 -0700)]
libgmp: new module

The idea is to let programs simply include <gmp.h>, and
so long as they live within the mini-gmp subset they need
not worry about whether the GMP libraries are installed.
* MODULES.html.sh: Mention it.
* config/srclist.txt: Mention files copied from GMP source.
* config/srclistvars.sh (GMP): New var.
* lib/mini-gmp-gnulib.c, m4/libgmp.m4, modules/libgmp:
* modules/libgmp-tests, tests/test-libgmp.c: New files.
* lib/mini-gmp.c, lib/mini-gmp.h: New files, copied from GMP.

4 years agoUntabify.
Bruno Haible [Sun, 5 Jul 2020 19:39:35 +0000 (21:39 +0200)]
Untabify.

4 years agomkancesdirs: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:14:05 +0000 (21:14 +0200)]
mkancesdirs: Trim module dependencies.

* lib/mkancesdirs.c: Include filename.h instead of dirname.h.
* modules/mkancesdirs (Depends-on): Remove dirname-lgpl. Add filename.

4 years agogetprogname: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:12:33 +0000 (21:12 +0200)]
getprogname: Trim module dependencies.

* lib/getprogname.c: Include basename-lgpl.h instead of dirname.h.
* modules/getprogname (Depends-on): Remove dirname-lgpl. Add
basename-lgpl.

4 years agofilenamecat-lgpl: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:10:11 +0000 (21:10 +0200)]
filenamecat-lgpl: Trim module dependencies.

* lib/filenamecat-lgpl.c: Include basename-lgpl.h, filename.h instead of
dirname.h.
* modules/filenamecat-lgpl (Depends-on): Remove dirname-lgpl. Add
basename-lgpl, filename.

4 years agobackupfile, backup-rename: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:07:46 +0000 (21:07 +0200)]
backupfile, backup-rename: Trim module dependencies.

* lib/backupfile.c: Include basename-lgpl.h instead of dirname.h.
* modules/backupfile (Depends-on): Remove dirname-lgpl. Add
basename-lgpl.
* modules/backup-rename (Depends-on): Likewise.

4 years agoargp: Trim module dependencies.
Bruno Haible [Sun, 5 Jul 2020 19:05:21 +0000 (21:05 +0200)]
argp: Trim module dependencies.

* lib/argp-namefrob.h: Include basename-lgpl.h instead of dirname.h.
* modules/argp (Depends-on): Remove dirname-lgpl. Add basename-lgpl.

4 years agobasename-lgpl: New module.
Bruno Haible [Sun, 5 Jul 2020 16:06:13 +0000 (18:06 +0200)]
basename-lgpl: New module.

* lib/basename-lgpl.h: New file, based on lib/dirname.h and
lib/basename-lgpl.c.
* lib/basename-lgpl.c: Include basename-lgpl.h, not dirname.h. Include
<stdbool.h>, filename.h.
(last_component): Rename a local variable.
* lib/dirname.h: Include basename-lgpl.h.
(DOUBLE_SLASH_IS_DISTINCT_ROOT): Remove macro.
(last_component, base_len): Remove declarations.
* modules/basename-lgpl: New file.
* modules/dirname-lgpl (Files): Remove lib/basename-lgpl.c.
(Depends-on): Add basename-lgpl. Remove double-slash-root.
(Makefile.am): Don't compile basename-lgpl.c.
* doc/posix-functions/basename.texi: Mention the module 'basename-lgpl',
not 'dirname'.

4 years agodirname, dirname-lgpl: Simplify.
Bruno Haible [Sun, 5 Jul 2020 16:05:31 +0000 (18:05 +0200)]
dirname, dirname-lgpl: Simplify.

* m4/dirname.m4: Remove file.
* modules/dirname (configure.ac): Don't invoke gl_DIRNAME.
* modules/dirname-lgpl (Files): Remove m4/dirname.m4.
(configure.ac): Don't invoke gl_DIRNAME_LGPL.

4 years agotests: avoid shadowing warning
Bernhard Voelker [Thu, 2 Jul 2020 21:11:52 +0000 (23:11 +0200)]
tests: avoid shadowing warning

* tests/test-memchr.c (main): Give page_boundary variable a tight scope.

4 years agosupersede: Add tests.
Bruno Haible [Sun, 5 Jul 2020 10:27:29 +0000 (12:27 +0200)]
supersede: Add tests.

* tests/test-supersede.c: New file.
* tests/test-supersede-open.h: New file.
* tests/test-supersede-fopen.h: New file.
* modules/supersede-tests: New file.

4 years agosupersede: New module.
Bruno Haible [Sun, 5 Jul 2020 10:27:24 +0000 (12:27 +0200)]
supersede: New module.

* lib/supersede.h: New file.
* lib/supersede.c: New file.
* m4/supersede.m4: New file.
* modules/supersede: New file.

4 years agoAdd some copyright headers.
Bruno Haible [Sun, 5 Jul 2020 09:07:03 +0000 (11:07 +0200)]
Add some copyright headers.

* lib/dev-ino.h: Add copyright header.
* lib/di-set.h: Likewise.
* lib/fchown-stub.c: Likewise.
* lib/file-set.h: Likewise.
* lib/hash-triple.h: Likewise.
* lib/idcache.h: Likewise.
* lib/ino-map.h: Likewise.
* lib/mkancesdirs.h: Likewise.
* lib/scratch_buffer.h: Likewise.
* lib/se-context.in.h: Likewise.
* lib/stdopen.h: Likewise.
* lib/userspec.h: Likewise.

4 years agogetrandom: Relicense under LGPLv2+.
Bruno Haible [Sat, 4 Jul 2020 16:24:45 +0000 (18:24 +0200)]
getrandom: Relicense under LGPLv2+.

Paul Eggert's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00023.html>.

* modules/getrandom (License): Change to LGPLv2+.

4 years agogetumask: Add tests.
Bruno Haible [Sat, 4 Jul 2020 16:16:06 +0000 (18:16 +0200)]
getumask: Add tests.

* tests/test-getumask.c: New file.
* modules/getumask-tests: New file.

4 years agogetumask: New module.
Bruno Haible [Sat, 4 Jul 2020 16:14:46 +0000 (18:14 +0200)]
getumask: New module.

* lib/sys_stat.in.h (getumask): New declaration.
* lib/getumask.c: New file.
* m4/getumask.m4: New file.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Test whether getumask is
declared.
(gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_GETUMASK, HAVE_GETUMASK.
* modules/sys_stat (Makefile.am): Substitute GNULIB_GETUMASK,
HAVE_GETUMASK.
* modules/getumask: New file.
* tests/test-sys_stat-c++.cc (getumask): Check signature.
* doc/glibc-functions/getumask.texi: New file.
* doc/gnulib.texi (Glibc sys/stat.h): Include it.

4 years agoclean-temp: Add support for temporary files with given mode.
Bruno Haible [Sat, 4 Jul 2020 16:06:52 +0000 (18:06 +0200)]
clean-temp: Add support for temporary files with given mode.

* lib/clean-temp.h (gen_register_open_temp): Add mode argument.
* lib/clean-temp.c (struct try_create_file_params): New type.
(try_create_file): New function.
(gen_register_open_temp): Add mode argument. Use try_tempname instead of
gen_tempname.

4 years agoclean-temp: Document limitations.
Bruno Haible [Sat, 4 Jul 2020 13:22:33 +0000 (15:22 +0200)]
clean-temp: Document limitations.

* lib/clean-temp.h: Document limitations.

4 years agoclean-temp: Add support for temporary files with unpredictable names.
Bruno Haible [Sat, 4 Jul 2020 13:18:20 +0000 (15:18 +0200)]
clean-temp: Add support for temporary files with unpredictable names.

* lib/clean-temp.h (gen_register_open_temp): New declaration.
* lib/clean-temp.c: Include tempname.h.
(gen_register_open_temp): New function.
* modules/tempname (configure.ac): Define a module indicator.

4 years agoclean-temp: Add support for temporary files anywhere in the file system.
Bruno Haible [Sat, 4 Jul 2020 13:17:32 +0000 (15:17 +0200)]
clean-temp: Add support for temporary files anywhere in the file system.

* lib/clean-temp.h (register_temporary_file, unregister_temporary_file,
cleanup_temporary_file): New declarations.
* lib/clean-temp.c (file_cleanup_list_lock, file_cleanup_list): New
variables.
(dir_cleanup_list_lock): Renamed from cleanup_list_lock.
(dir_cleanup_list): Renamed from cleanup_list.
(cleanup_action): Process the file_cleanup_list as well.
(do_init_clean_temp): New function.
(clean_temp_once): New variable.
(init_clean_temp): New function.
(create_temp_dir): Invoke it.
(register_temporary_file, unregister_temporary_file,
cleanup_temporary_file): New functions.
(do_unlink, do_rmdir): Remove 'dir' argument. Add 'cleanup_verbose'
argument.

4 years agoclean-temp: Improve comments.
Bruno Haible [Sat, 4 Jul 2020 12:52:27 +0000 (14:52 +0200)]
clean-temp: Improve comments.

* lib/clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
fwriteerror_temp, close_stream_temp): Clarify intended use.
* lib/clean-temp.c: Likewise.

4 years agoclean-temp: Fix last commit.
Bruno Haible [Sat, 4 Jul 2020 12:51:46 +0000 (14:51 +0200)]
clean-temp: Fix last commit.

4 years agoclean-temp: Make multithread-safe, part 2.
Bruno Haible [Sat, 4 Jul 2020 12:39:09 +0000 (14:39 +0200)]
clean-temp: Make multithread-safe, part 2.

* lib/fatal-signal.h: Include <signal.h>.
(get_fatal_signal_set): New declaration.
* lib/fatal-signal.c (get_fatal_signal_set): New function.
* lib/clean-temp.c: Include asyncsafe-spin.h, gl_linked_list.h.
(struct closeable_fd): New type.
(fatal_signal_set): New variable.
(init_fatal_signal_set): New function.
(asyncsafe_close, asyncsafe_fclose_variant): New functions.
(cleanup_action): Invoke asyncsafe_close instead of close.
(create_temp_dir): Invoke init_fatal_signal_set.
(register_fd): Use a plain linked list. Add a 'struct closeable_fd *'
element.
(unregister_fd): Remove function.
(close_temp): Cleanup descriptors list on the fly. Invoke
init_fatal_signal_set. Invoke asyncsafe_close instead of close.
(fclose_variant_temp): New function.
(fclose_temp, fwriteerror_temp, close_stream_temp): Use it.
* modules/clean-temp (Depends-on): Add asyncsafe-spin, linked-list.

4 years agoclean-temp: Make multithread-safe, part 1.
Bruno Haible [Sat, 4 Jul 2020 12:39:03 +0000 (14:39 +0200)]
clean-temp: Make multithread-safe, part 1.

* lib/clean-temp.c: Include glthread/lock.h.
(cleanup_list_lock): New variable.
(register_temp_file, unregister_temp_file, register_temp_subdir,
unregister_temp_subdir, cleanup_temp_dir_contents): Use it.
(create_temp_dir): Likewise. Don't free the old array.
(descriptors_lock): New variable.
(register_fd, unregister_fd): Use it.
* modules/clean-temp (Depends-on): Add lock.

4 years agofatal-signal: Make multithread-safe.
Bruno Haible [Sat, 4 Jul 2020 10:43:26 +0000 (12:43 +0200)]
fatal-signal: Make multithread-safe.

* lib/fatal-signal.c (init_fatal_signals): Add comment.
(do_init_fatal_signal_set): New function, extracted from
init_fatal_signal_set.
(fatal_signal_set_once): New variable.
(init_fatal_signal_set): Use gl_once.

4 years agogetrandom: Fix compilation error on native Windows (regression from 2020-06-28).
Bruno Haible [Sat, 4 Jul 2020 02:00:01 +0000 (04:00 +0200)]
getrandom: Fix compilation error on native Windows (regression from 2020-06-28).

* lib/getrandom.c: Don't include <ntdef.h>. Instead, define NTSTATUS.
* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Include <windows.h> before
<bcrypt.h>.

4 years agodfa tests: Follow common file naming conventions.
Bruno Haible [Fri, 3 Jul 2020 16:49:18 +0000 (18:49 +0200)]
dfa tests: Follow common file naming conventions.

* tests/test-dfa-match-aux.c: Renamed from tests/dfa-match-aux.c.
* tests/test-dfa-match.sh: Renamed from tests/dfa-match.sh. Update.
* tests/test-dfa-invalid-char-class.sh: Renamed from
tests/dfa-invalid-char-class.sh. Update.
* modules/dfa-tests (Files, Makefile.am): Update.

4 years agoasyncsafe-spin: Use GCC extended asm syntax for SunStudio 12 compiler.
Bruno Haible [Fri, 3 Jul 2020 10:35:45 +0000 (12:35 +0200)]
asyncsafe-spin: Use GCC extended asm syntax for SunStudio 12 compiler.

* lib/asyncsafe-spin.c (memory_barrier, atomic_compare_and_swap): Use
the GCC extended asm syntax also for the Sun Studio 12 compilers.

4 years agoasyncsafe-spin: Reduce code duplication.
Bruno Haible [Fri, 3 Jul 2020 10:27:37 +0000 (12:27 +0200)]
asyncsafe-spin: Reduce code duplication.

* lib/asyncsafe-spin.c: (do_lock, do_unlock): New functions.
(asyncsafe_spin_lock, asyncsafe_spin_unlock): Use them.
* modules/asyncsafe-spin (configure.ac): Require AC_C_INLINE.

4 years agolchmod: Simplify after 2020-02-22 change.
Bruno Haible [Fri, 3 Jul 2020 10:18:34 +0000 (12:18 +0200)]
lchmod: Simplify after 2020-02-22 change.

* m4/lchmod.m4 (gl_FUNC_LCHMOD): Don't require AC_C_INLINE.

4 years agogen-uni-tables: Make sure the compiler does not barf on 'inline'.
Bruno Haible [Fri, 3 Jul 2020 10:12:02 +0000 (12:12 +0200)]
gen-uni-tables: Make sure the compiler does not barf on 'inline'.

* modules/gen-uni-tables (configure.ac): Require AC_C_INLINE.

4 years agodfa: Make sure the compiler does not barf on 'inline'.
Bruno Haible [Fri, 3 Jul 2020 10:09:13 +0000 (12:09 +0200)]
dfa: Make sure the compiler does not barf on 'inline'.

* modules/dfa (configure.ac): Require AC_C_INLINE.

4 years agobitset: Make sure the compiler does not barf on 'inline'.
Bruno Haible [Fri, 3 Jul 2020 10:06:17 +0000 (12:06 +0200)]
bitset: Make sure the compiler does not barf on 'inline'.

* modules/bitset (configure.ac): New section.

4 years agomanywarnings: improve port to GCC 10.1
Paul Eggert [Thu, 2 Jul 2020 00:00:51 +0000 (17:00 -0700)]
manywarnings: improve port to GCC 10.1

* build-aux/gcc-warning.spec: Also list warnings that are default
or are enabled by already-given flags.  This lets us speed up
checking for attributes, and makes the generated compilation
commands shorter.  Add -Wanalyzer-too-complex (too much noise).
* m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT)
(gl_MANYWARN_ALL_GCC): Use gl_AS_VAR_APPEND to append
to shell variables that may have long values.
(gl_MANYWARN_ALL_GCC): Omit flags that are default or are
consequences of other flags, to speed up checking and
shorten commands.

4 years agotests: pacify gcc -fanalyzer on zerosize_ptr
Paul Eggert [Wed, 1 Jul 2020 23:45:41 +0000 (16:45 -0700)]
tests: pacify gcc -fanalyzer on zerosize_ptr

* tests/test-memcasecmp.c (main):
* tests/test-memchr.c (main):
* tests/test-memchr2.c (main):
* tests/test-memcmp.c (main):
* tests/test-memmem.c (main):
* tests/test-memrchr.c (main):
* tests/unistr/test-chr.h (main):
* tests/unistr/test-cmp.h (test_cmp):
Check whether zerosize_ptr returns NULL before using it.
This pacifies GCC 10.1’s new fanalyzer option, and matches
other uses of zerosize_ptr.

4 years agoasyncsafe-spin: Add tests.
Bruno Haible [Wed, 1 Jul 2020 21:00:44 +0000 (23:00 +0200)]
asyncsafe-spin: Add tests.

* tests/test-asyncsafe-spin1.c: New file.
* tests/test-asyncsafe-spin2.c: New file, based on tests/test-lock.c and
tests/test-pthread-spin.c.
* modules/asyncsafe-spin-tests: New file.

4 years agoasyncsafe-spin: New module.
Bruno Haible [Wed, 1 Jul 2020 20:59:08 +0000 (22:59 +0200)]
asyncsafe-spin: New module.

* lib/asyncsafe-spin.h: New file.
* lib/asyncsafe-spin.c: New file, based on lib/pthread-spin.c.
* modules/asyncsafe-spin: New file.

4 years agowindows-spin: Fix race condition on multiprocessor systems.
Bruno Haible [Wed, 1 Jul 2020 20:55:50 +0000 (22:55 +0200)]
windows-spin: Fix race condition on multiprocessor systems.

* lib/windows-spin.c (glwthread_spin_init): Add a memory barrier.

4 years agopthread-spin: Add optimized fallback for GCC versions >= 4.1, < 4.7.
Bruno Haible [Wed, 1 Jul 2020 20:52:41 +0000 (22:52 +0200)]
pthread-spin: Add optimized fallback for GCC versions >= 4.1, < 4.7.

* lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock): For GCC >= 4.1, < 4.7, use
an implementation based on other GCC built-ins.

4 years agopthread-spin: Optimize fallback for GCC versions >= 4.7.
Bruno Haible [Wed, 1 Jul 2020 20:49:05 +0000 (22:49 +0200)]
pthread-spin: Optimize fallback for GCC versions >= 4.7.

* lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock): Use a lock word instead of a
lock byte.

4 years agopthread-spin: Add error checking.
Bruno Haible [Wed, 1 Jul 2020 20:13:27 +0000 (22:13 +0200)]
pthread-spin: Add error checking.

* lib/pthread-spin.c: Include <stdbool.h>.
(pthread_spin_init, pthread_spin_lock, pthread_spin_trylock,
pthread_spin_unlock) [GCC>=4.7]: Prefer an implementation that verifies
the unlocks.
* modules/pthread-spin (Depends-on): Add stdbool.

4 years agopthread-spin: Add tests.
Bruno Haible [Wed, 1 Jul 2020 20:06:45 +0000 (22:06 +0200)]
pthread-spin: Add tests.

* tests/test-pthread-spin.c: New file, based on tests/test-lock.c.
* modules/pthread-spin-tests: New file.

4 years agotests: Reduce code duplication.
Bruno Haible [Wed, 1 Jul 2020 20:06:27 +0000 (22:06 +0200)]
tests: Reduce code duplication.

* tests/atomic-int-posix.h: New file, extracted from
tests/test-pthread-mutex.c.
* tests/test-pthread-mutex.c: Include it. Remove the corresponding code.
* tests/test-pthread-rwlock.c: Likewise.
* modules/pthread-mutex-tests (Files): Add tests/atomic-int-posix.h.
* modules/pthread-rwlock-tests (Files): Likewise.

4 years agotests: Refactor.
Bruno Haible [Wed, 1 Jul 2020 20:06:13 +0000 (22:06 +0200)]
tests: Refactor.

* tests/atomic-int-isoc.h: New file, extracted from tests/test-mtx.c.
* tests/test-mtx.c: Include it. Remove the corresponding code.
* modules/mtx-tests (Files): Add tests/atomic-int-isoc.h.

4 years agotests: Refactor.
Bruno Haible [Wed, 1 Jul 2020 20:05:15 +0000 (22:05 +0200)]
tests: Refactor.

* tests/atomic-int-gnulib.h: New file, extracted from tests/test-lock.c.
* tests/test-lock.c: Include it. Remove the corresponding code.
* modules/lock-tests (Files): Add tests/atomic-int-gnulib.h.

4 years agosys_socket: Don't define socklen_t if it is already defined on mingw.
Bruno Haible [Tue, 30 Jun 2020 00:26:45 +0000 (02:26 +0200)]
sys_socket: Don't define socklen_t if it is already defined on mingw.

Reported by Keith Marshall <keith.d.marshall@ntlworld.com> in
<https://savannah.gnu.org/bugs/?57725>,
by Rahul Das <bokul_4u@yahoo.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00081.html>,
and by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00068.html>.

* lib/sys_socket.in.h (socklen_t): Remove definition.

4 years agoautoupdate
Paul Eggert [Tue, 30 Jun 2020 00:39:54 +0000 (17:39 -0700)]
autoupdate

4 years ago* top/maint.mk: Pacify Autoconf TAB-8-space rule.
Paul Eggert [Mon, 29 Jun 2020 23:37:14 +0000 (16:37 -0700)]
* top/maint.mk: Pacify Autoconf TAB-8-space rule.

4 years agoalloca-opt: Fix warning on mingw.
Bruno Haible [Mon, 29 Jun 2020 22:54:54 +0000 (00:54 +0200)]
alloca-opt: Fix warning on mingw.

Reported and solution by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00069.html>.

* lib/alloca.in.h: On mingw, include <alloca.h> and then test again
whether alloca is defined.

4 years agogetrandom: do not depend on ‘open’ on mingw
Paul Eggert [Sun, 28 Jun 2020 20:18:11 +0000 (13:18 -0700)]
getrandom: do not depend on ‘open’ on mingw

Similarly for at-internal, getloadavg.  These modules do not call
the ‘open’ function when they are compiled on mingw.  On mingw,
this avoids having to compile open.c when building Emacs, which
does its own thing with ‘open’.
* modules/at-internal, modules/getloadavg, modules/getrandom:
(Depends-on): Don’t depend on ‘open’ on mingw.
(Depends-on): Require AC_CANONICAL_HOST, for host_os.
* modules/getloadavg (Depends-on):
Depend on intprops, open, stdbool, stdlib only if compiling
getloadavg.c.

4 years agodoc: Add a note about sigprocmask vs. pthread_sigmask.
Bruno Haible [Sun, 28 Jun 2020 20:10:32 +0000 (22:10 +0200)]
doc: Add a note about sigprocmask vs. pthread_sigmask.

* doc/posix-functions/sigprocmask.texi: Add note.

4 years agogetrandom: Fix compilation errors on older versions of mingw.
Bruno Haible [Sun, 28 Jun 2020 17:04:03 +0000 (19:04 +0200)]
getrandom: Fix compilation errors on older versions of mingw.

Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00059.html>.

* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Test whether <bcrypt.h> exists.
* lib/getrandom.c: If <bcrypt.h> is not available, include <ntdef.h> and
define/declare BCRYPT_ALG_HANDLE, BCRYPT_USE_SYSTEM_PREFERRED_RNG,
BCryptGenRandom ourselves.