From patchwork Sat Feb 25 01:18:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1747719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PNpnB5yKsz245s for ; Sat, 25 Feb 2023 12:18:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67D0338515F1 for ; Sat, 25 Feb 2023 01:18:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 8C0903857C45 for ; Sat, 25 Feb 2023 01:18:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C0903857C45 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,326,1669104000"; d="scan'208";a="102158610" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 24 Feb 2023 17:18:39 -0800 IronPort-SDR: 0ciKZLECs1AXdEIPb/d3gWuj3KWKg4+LRyvnrojgk+7iqbNSxYozqHizxOH5ZLMHAg8Sq/WOWa zRDFowDVYg3z/dsiSWZNGdVRfwFHxUFvxYUYkILKsgTHbPrDVG9+3yQ/e7d+BdnMW1RWDrqM3F fjIgwL7VQOTq6iV6iyvHnZYdMDbBNgiaCZrF6xBJud6ocBtZ8gaEfjVwuuG9Li26F13c7WHZfT BF+WHoBTeX3Yqk0962j+5wyuvtFEJ2gdOlc3OKhfP5bthv+zAjBtUQAnvp/7/A9nOdBWMlrivc smA= Date: Sat, 25 Feb 2023 01:18:35 +0000 From: Joseph Myers To: Subject: Declare wcstofN, wcstofNx for C2x Message-ID: <1da9c0d3-877c-a096-4699-2a748555efb@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3113.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" WG14 accepted the changes in N3105 to define wcstofN and wcstofNx functions for C2x. Thus enable those for C2x (given also __GLIBC_USE (IEC_60559_TYPES_EXT) and support for the relevant _FloatN / _FloatNx type) rather than only for __USE_GNU. Tested for x86_64. diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index cde0d32b0a..191427830e 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -386,42 +386,44 @@ extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; #endif /* C99 */ +#if __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) /* Likewise for `_FloatN' and `_FloatNx' when support is enabled. */ -#if __HAVE_FLOAT16 && defined __USE_GNU +# if __HAVE_FLOAT16 extern _Float16 wcstof16 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT32 && defined __USE_GNU +# if __HAVE_FLOAT32 extern _Float32 wcstof32 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT64 && defined __USE_GNU +# if __HAVE_FLOAT64 extern _Float64 wcstof64 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT128 && defined __USE_GNU +# if __HAVE_FLOAT128 extern _Float128 wcstof128 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT32X && defined __USE_GNU +# if __HAVE_FLOAT32X extern _Float32x wcstof32x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT64X && defined __USE_GNU +# if __HAVE_FLOAT64X extern _Float64x wcstof64x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif -#if __HAVE_FLOAT128X && defined __USE_GNU +# if __HAVE_FLOAT128X extern _Float128x wcstof128x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; -#endif +# endif +#endif /* __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) */ /* Convert initial portion of wide string NPTR to `long int'