From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 4B2AE38618B2 for ; Fri, 18 Dec 2020 17:17:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B2AE38618B2 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-Ld9eB53XPs6r50SRAvDz0w-1; Fri, 18 Dec 2020 12:16:58 -0500 X-MC-Unique: Ld9eB53XPs6r50SRAvDz0w-1 Received: by mail-ed1-f69.google.com with SMTP id z20so1320068edl.21 for ; Fri, 18 Dec 2020 09:16:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iF0wVvV0eANP8Mf0FvKm5xV8eAXApihLDTByhtZFbvc=; b=tSUrFWPKNaCdzhGR+HFZwyC6nBlpSauYxiMccB1XDRVCa41wkIvmh5G3taocTLNst3 Mlh7BWA9xhP1J/fmriByI2UCVxcj048vMSanxUId5o1KByMOPRwt+j4p6+PXKtbcUnPF Bp6oJil8Wy2BIvSYdSucrh7swF7sXCMKtnskqyu/EqHNyOWZFDJ2ll85l+fkLkjxm7HA h2QSB6z7T8Qsm8GS+8VIwt/nGybS0yqlUoLB5kpGGrEvhfB90gksQ3jV+v7IOxrrL7Be Qvk7zmvFiArR2ydrfN/tgaZM3wtkVDLas/1zNlwm5V9Z6bidkQpFJfhMC36B76CNyEzN 3Yng== X-Gm-Message-State: AOAM533/f3YiYxXxoFt9URhCe9tr9uiMydfctV6S3kk3T7Ew1c2CI5Ah JgQA8iSNa+XrhbJaQrTy5/udFvYi5gdIfd81DxgZdYZRA2U8hr5qxX6+8mfd2YgaJLiTpjOKsBD kaCxbhKGsvEdkX2+akLip7EvSF7ODqbQ= X-Received: by 2002:a17:907:447d:: with SMTP id oo21mr4988120ejb.367.1608311817502; Fri, 18 Dec 2020 09:16:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf0hL0MqFdT3Er0Swm9DCD/aR78JGdrQFppwaXHGnKSXbxRRWACYynyJJQ50NTbZ72xn0IzwVl5wePfkpXIVw= X-Received: by 2002:a17:907:447d:: with SMTP id oo21mr4988089ejb.367.1608311817230; Fri, 18 Dec 2020 09:16:57 -0800 (PST) MIME-Version: 1.0 References: <20201218160407.1498119-1-ppalka@redhat.com> In-Reply-To: <20201218160407.1498119-1-ppalka@redhat.com> From: Patrick Palka Date: Fri, 18 Dec 2020 12:16:45 -0500 Message-ID: Subject: Re: [PATCH] libstdc++: Fix build failure due to missing [PR98374] To: GCC Patches Cc: "Jonathan Wakely via Libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2020 17:17:03 -0000 On Fri, Dec 18, 2020 at 11:04 AM Patrick Palka wrote: > > This fixes a build failure on Windows which lacks . > (We can't use the more portable localeconv() from to obtain > the radix character of the current locale here because it's not > thread-safe, unfortunately.) > > This change means that on Windows and other such systems, we'll just > always assume the radix character used by printf is '.' when formatting > a long double through it. > > libstdc++-v3/ChangeLog: > > PR libstdc++/98374 > * src/c++17/floating_to_chars.cc: Guard include of > with __has_include. > (__floating_to_chars_precision) [!defined(RADIXCHAR)]: Don't > attempt to obtain the radix character of the current locale, > just assume it's '.'. I went ahead and committed this patch under the "obvious" rule as r11-6259. > --- > libstdc++-v3/src/c++17/floating_to_chars.cc | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc > index 474e791e717..6470fbb0b95 100644 > --- a/libstdc++-v3/src/c++17/floating_to_chars.cc > +++ b/libstdc++-v3/src/c++17/floating_to_chars.cc > @@ -33,7 +33,9 @@ > #include > #include > #include > -#include > +#if __has_include() > +# include // for nl_langinfo > +#endif > #include > #include > #include > @@ -1113,6 +1115,7 @@ template > // to handle a radix point that's different from '.'. > char radix[6] = {'.', '\0', '\0', '\0', '\0', '\0'}; > if (effective_precision > 0) > +#ifdef RADIXCHAR > // ???: Can nl_langinfo() ever return null? > if (const char* const radix_ptr = nl_langinfo(RADIXCHAR)) > { > @@ -1121,6 +1124,7 @@ template > // UTF-8 character) wide. > __glibcxx_assert(radix[4] == '\0'); > } > +#endif > > // Compute straightforward upper bounds on the output length. > int output_length_upper_bound; > -- > 2.30.0.rc0 >