From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,LONGWORDS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A0B2F1F55B for ; Sun, 31 May 2020 00:51:20 +0000 (UTC) Received: from localhost ([::1]:56586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfCC7-00072U-EG for normalperson@yhbt.net; Sat, 30 May 2020 20:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfCC3-00072N-6s for bug-gnulib@gnu.org; Sat, 30 May 2020 20:51:15 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.160]:32832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfCBz-0006Kj-Ey for bug-gnulib@gnu.org; Sat, 30 May 2020 20:51:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1590886268; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=1ML1Zy8xCXzXnjyWV0+AvS0QV1Rfso+hupVLvRux/Mw=; b=qvdo45PbpXaxRzbPpB5iiY9+FuqEqinE6LE1zzIVIOsHudufhsw1KxQpYRdTtPFOed m/ytjaPsf3HEUqJHXWJyb1IJSKY3YQ5HvjuYR1iNsIn/pezs/6vJIzd16OC+MeWHMwzf Iui5QOfz7JRjg6G+iOBTqbsBdly3DkoddaonEcx5UMSOBUI+kRma9QMxdiYaZg5y3TRt ALneQixxGl4EPJqmXtB2UA6H1gXHqL9bTT1fvChPZZ/QJZCKCIKL+fcigUGyrSpeqrgO jqQfmQvABw1XkhL7rr+3mzICmXzq2xdOIkz1rcLPrY6Mi11k/zrA66JUhzmXqhHck74N Vkew== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.9.0 DYNA|AUTH) with ESMTPSA id j03713w4V0p7BbZ (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 31 May 2020 02:51:07 +0200 (CEST) From: Bruno Haible To: Paul Eggert Subject: Re: fnmatch: rely on more gnulib modules Date: Sun, 31 May 2020 02:51:06 +0200 Message-ID: <7011871.yb4ltZRR22@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <3104446.WjioaTWNiH@omega> <3149f7dc-fd9d-edd3-5fc2-b2347ad1ee5f@cs.ucla.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5360081.akIcAi7OTS" Content-Transfer-Encoding: 7Bit Received-SPF: none client-ip=81.169.146.160; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/30 20:51:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, LONGWORDS=2.035, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --nextPart5360081.akIcAi7OTS Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Paul Eggert wrote: > fnmatch now depends on a module wmempcpy that does not exist, causing the > bootstrap to fail. Fixed the 'fnmatch' dependencies like this. 2020-05-30 Bruno Haible wmemchr: Relicense under LGPLv2+. * modules/wmemchr (License): Set to LGPLv2+. 2020-05-30 Bruno Haible wmempcpy: New module. Reported by Paul Eggert in . * lib/wchar.in.h (wmempcpy): New declaration. * lib/wmempcpy.c: New file. * m4/wmempcpy.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmempcpy is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wchar (Makefile.am): Substitute GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wmempcpy: New file. * tests/test-wchar-c++.cc: Check the signature of wmempcpy. * doc/glibc-functions/wmempcpy.texi: Mention the new module. * modules/mempcpy (Description): Fix typo. --nextPart5360081.akIcAi7OTS Content-Disposition: attachment; filename="0001-wmempcpy-New-module.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-wmempcpy-New-module.patch" >From 68935ae95b339a42ee955be00aa7921bd37916ba Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 May 2020 02:42:47 +0200 Subject: [PATCH 1/2] wmempcpy: New module. Reported by Paul Eggert in . * lib/wchar.in.h (wmempcpy): New declaration. * lib/wmempcpy.c: New file. * m4/wmempcpy.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmempcpy is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wchar (Makefile.am): Substitute GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wmempcpy: New file. * tests/test-wchar-c++.cc: Check the signature of wmempcpy. * doc/glibc-functions/wmempcpy.texi: Mention the new module. * modules/mempcpy (Description): Fix typo. --- ChangeLog | 17 +++++++++++++++++ doc/glibc-functions/wmempcpy.texi | 8 ++++---- lib/wchar.in.h | 23 +++++++++++++++++++++++ lib/wmempcpy.c | 28 ++++++++++++++++++++++++++++ m4/wchar_h.m4 | 7 +++++-- m4/wmempcpy.m4 | 21 +++++++++++++++++++++ modules/mempcpy | 2 +- modules/wchar | 2 ++ modules/wmempcpy | 27 +++++++++++++++++++++++++++ tests/test-wchar-c++.cc | 5 +++++ 10 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 lib/wmempcpy.c create mode 100644 m4/wmempcpy.m4 create mode 100644 modules/wmempcpy diff --git a/ChangeLog b/ChangeLog index 4b39c3d3..b396b3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ 2020-05-30 Bruno Haible + wmempcpy: New module. + Reported by Paul Eggert in + . + * lib/wchar.in.h (wmempcpy): New declaration. + * lib/wmempcpy.c: New file. + * m4/wmempcpy.m4: New file. + * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmempcpy is declared. + (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMPCPY, HAVE_WMEMPCPY. + * modules/wchar (Makefile.am): Substitute GNULIB_WMEMPCPY, + HAVE_WMEMPCPY. + * modules/wmempcpy: New file. + * tests/test-wchar-c++.cc: Check the signature of wmempcpy. + * doc/glibc-functions/wmempcpy.texi: Mention the new module. + * modules/mempcpy (Description): Fix typo. + +2020-05-30 Bruno Haible + crypto/gc-random: Fix list of crypto devices for NetBSD, OpenBSD. * m4/gc-random.m4 (gl_GC_RANDOM): Don't special-case NetBSD and OpenBSD. diff --git a/doc/glibc-functions/wmempcpy.texi b/doc/glibc-functions/wmempcpy.texi index da5b4d2..be7e782 100644 --- a/doc/glibc-functions/wmempcpy.texi +++ b/doc/glibc-functions/wmempcpy.texi @@ -15,18 +15,18 @@ Documentation: @uref{https://www.kernel.org/doc/man-pages/online/pages/man3/wmempcpy.3.html,,man wmempcpy}. @end itemize -Gnulib module: --- +Gnulib module: wmempcpy Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many non-glibc platforms: +Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin, mingw, MSVC 14, Android 5.1. @end itemize Portability problems not fixed by Gnulib: @itemize @item -This function is missing on many non-glibc platforms: -Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin, mingw, MSVC 14, Android 5.1. -@item On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot accommodate all Unicode characters. @end itemize diff --git a/lib/wchar.in.h b/lib/wchar.in.h index e1fa92f..bfcf611 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -624,6 +624,29 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - " #endif +/* Copy N wide characters of SRC to DEST. + Return pointer to wide characters after the last written wide character. */ +#if @GNULIB_WMEMPCPY@ +# if !@HAVE_WMEMPCPY@ +_GL_FUNCDECL_SYS (wmempcpy, wchar_t *, + (wchar_t *restrict dest, + const wchar_t *restrict src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmempcpy, wchar_t *, + (wchar_t *restrict dest, + const wchar_t *restrict src, size_t n)); +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (wmempcpy); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wmempcpy +# if HAVE_RAW_DECL_WMEMPCPY +_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - " + "use gnulib module wmempcpy for portability"); +# endif +#endif + + /* Set N wide characters of S to C. */ #if @GNULIB_WMEMSET@ # if !@HAVE_WMEMSET@ diff --git a/lib/wmempcpy.c b/lib/wmempcpy.c new file mode 100644 index 0000000..9161c65 --- /dev/null +++ b/lib/wmempcpy.c @@ -0,0 +1,28 @@ +/* Copy wide character array, return pointer after last written wide character. + Copyright (C) 2020 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +#include + +/* Specification. */ +#include + +/* Copy N wide characters of SRC to DEST. + Return pointer to wide characters after the last written wide character. */ +wchar_t * +wmempcpy (wchar_t *dest, const wchar_t *src, size_t n) +{ + return wmemcpy (dest, src, n) + n; +} diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 index be09020..6c4e8a6 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar_h.m4 serial 45 +# wchar_h.m4 serial 46 AC_DEFUN([gl_WCHAR_H], [ @@ -52,7 +52,8 @@ AC_DEFUN([gl_WCHAR_H], #include ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb - wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcsrtombs wcsnrtombs wcwidth + wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime @@ -159,6 +160,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMPCPY=0; AC_SUBST([GNULIB_WMEMPCPY]) GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) @@ -198,6 +200,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY]) HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) diff --git a/m4/wmempcpy.m4 b/m4/wmempcpy.m4 new file mode 100644 index 0000000..1795fc8 --- /dev/null +++ b/m4/wmempcpy.m4 @@ -0,0 +1,21 @@ +# wmempcpy.m4 serial 1 +dnl Copyright (C) 2020 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_WMEMPCPY], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + dnl Persuade glibc to declare wmempcpy(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl The wmempcpy() declaration in lib/wchar.in.h uses 'restrict'. + AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_FUNCS_ONCE([wmempcpy]) + if test $ac_cv_func_wmempcpy = no; then + HAVE_WMEMPCPY=0 + fi +]) diff --git a/modules/mempcpy b/modules/mempcpy index 9af4654..59009aa 100644 --- a/modules/mempcpy +++ b/modules/mempcpy @@ -1,5 +1,5 @@ Description: -mempcpy() function: copy memory area, return point after last written byte. +mempcpy() function: copy memory area, return pointer after last written byte. Files: lib/mempcpy.c diff --git a/modules/wchar b/modules/wchar index cd4464b..a028f65 100644 --- a/modules/wchar +++ b/modules/wchar @@ -50,6 +50,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMPCPY''@/$(GNULIB_WMEMPCPY)/g' \ -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ @@ -90,6 +91,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ diff --git a/modules/wmempcpy b/modules/wmempcpy new file mode 100644 index 0000000..edb4c5f --- /dev/null +++ b/modules/wmempcpy @@ -0,0 +1,27 @@ +Description: +wmempcpy() function: copy wide character array, return pointer after last written wide character. + +Files: +lib/wmempcpy.c +m4/wmempcpy.m4 + +Depends-on: +wchar + +configure.ac: +gl_FUNC_WMEMPCPY +if test $HAVE_WMEMPCPY = 0; then + AC_LIBOBJ([wmempcpy]) +fi +gl_WCHAR_MODULE_INDICATOR([wmempcpy]) + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +all diff --git a/tests/test-wchar-c++.cc b/tests/test-wchar-c++.cc index 63480b1..3b9ba4b 100644 --- a/tests/test-wchar-c++.cc +++ b/tests/test-wchar-c++.cc @@ -95,6 +95,11 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemmove, wchar_t *, (wchar_t *, const wchar_t *, size_t)); #endif +#if GNULIB_TEST_WMEMPCPY +SIGNATURE_CHECK (GNULIB_NAMESPACE::wmempcpy, wchar_t *, + (wchar_t *, const wchar_t *, size_t)); +#endif + #if GNULIB_TEST_WMEMSET SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemset, wchar_t *, (wchar_t *, wchar_t, size_t)); -- 2.7.4 --nextPart5360081.akIcAi7OTS Content-Disposition: attachment; filename="0002-wmemchr-Relicense-under-LGPLv2.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0002-wmemchr-Relicense-under-LGPLv2.patch" >From 0964a8cc11b4e13780e427c7dfc5d6a0fe072c9e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 May 2020 02:48:31 +0200 Subject: [PATCH 2/2] wmemchr: Relicense under LGPLv2+. * modules/wmemchr (License): Set to LGPLv2+. --- ChangeLog | 5 +++++ modules/wmemchr | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b396b3c..e813334 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-05-30 Bruno Haible + wmemchr: Relicense under LGPLv2+. + * modules/wmemchr (License): Set to LGPLv2+. + +2020-05-30 Bruno Haible + wmempcpy: New module. Reported by Paul Eggert in . diff --git a/modules/wmemchr b/modules/wmemchr index f34cc4e..89bc3d1 100644 --- a/modules/wmemchr +++ b/modules/wmemchr @@ -22,7 +22,7 @@ Include: License: -LGPL +LGPLv2+ Maintainer: all -- 2.7.4 --nextPart5360081.akIcAi7OTS--