From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 9DD003858C2D; Mon, 6 Feb 2023 20:15:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DD003858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675714518; bh=w/5Q/hd+QWFzhUg/5g7w9ksXr1QJBfbJS1PgAQZGKVA=; h=From:To:Subject:Date:From; b=mc+nEcCQrMOR/7dTkc3t/TiIYEDYjzi66U6ABGTNIZABMplj7UoJoHodD4Fx5k8hX uP5TEW1Rvf6HLVZ1vTm7m2RpTttlMPrD196YzdbuRqB0eaQQzDFssn1W4eq/DGlMTY qCmtf+bcYeWdT+yXcGB1iqbJkma6gm90154iAkkM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] string: Hook up the default implementation on test-stpcpy X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: c863e33f784381c7341dc01e21c78d465e985bd6 X-Git-Newrev: 11aabacce87227bbd5681b4f118b040544d3a0f9 Message-Id: <20230206201518.9DD003858C2D@sourceware.org> Date: Mon, 6 Feb 2023 20:15:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=11aabacce87227bbd5681b4f118b040544d3a0f9 commit 11aabacce87227bbd5681b4f118b040544d3a0f9 Author: Adhemerval Zanella Date: Tue Jan 31 16:29:53 2023 -0300 string: Hook up the default implementation on test-stpcpy Reviewed-by: Richard Henderson Diff: --- string/test-stpcpy.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/string/test-stpcpy.c b/string/test-stpcpy.c index c7a416f93a..5d344b6a23 100644 --- a/string/test-stpcpy.c +++ b/string/test-stpcpy.c @@ -26,26 +26,36 @@ #include "test-string.h" #ifndef WIDE # define CHAR char -# define SIMPLE_STPCPY simple_stpcpy # define STPCPY stpcpy #else # include # define CHAR wchar_t -# define SIMPLE_STPCPY simple_wcpcpy # define STPCPY wcpcpy #endif /* !WIDE */ -CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *); - -IMPL (SIMPLE_STPCPY, 0) IMPL (STPCPY, 1) -CHAR * -SIMPLE_STPCPY (CHAR *dst, const CHAR *src) -{ - while ((*dst++ = *src++) != '\0'); - return dst - 1; -} +/* Also check the generic implementation. */ +#undef STPCPY +#undef weak_alias +#define weak_alias(a, b) +#undef libc_hidden_def +#define libc_hidden_def(a) +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(a) +#undef attribute_hidden +#define attribute_hidden +#ifndef WIDE +# define STPCPY __stpcpy_default +# include "string/stpcpy.c" +IMPL (__stpcpy_default, 1) +#else +# define __wcslen wcslen +# define __wmemcpy wmemcpy +# define WCPCPY __wcpcpy_default +# include "wcsmbs/wcpcpy.c" +IMPL (__wcpcpy_default, 1) +#endif #undef CHAR #include "test-strcpy.c"