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 3457D386102B for ; Fri, 18 Dec 2020 17:17:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3457D386102B 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-63-y8jNKZJAO4GSfmMI1e_vdg-1; Fri, 18 Dec 2020 12:16:59 -0500 X-MC-Unique: y8jNKZJAO4GSfmMI1e_vdg-1 Received: by mail-ed1-f69.google.com with SMTP id bf13so1346817edb.10 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=So7NV+8LjBu7+qACgsTMkcuQBXS4fibJ5cl3OWJuVA0qXwu32mcrEthOHgdwfR/fCb 0vxZzXLOB4sPXJy2KN1L5EsXrBIJ95TyzcE+w6XuVaC/In86d+dis1hJMUJ4KO6cT+H/ un7Hj+iPiIZQXyDr2kVSyItv46oMBGPzDL9T13J7tUiu9BZ3WOr1F/PW4xvJDNLAwAgI KxJSPobfxf0N+rFJhHigy14Au69jXdsjUi/kkIKa5CkutnxLtZQgbxW6Lj//K+bRZzmJ Y+BDv3gvKM2h1FYYhzdmmy0CRzTN0wzcttueYLGMNKwaq5fk4HTLBakXbHzA0bfHuEoh lnZg== X-Gm-Message-State: AOAM532SBW6J9ySGXZaCgbFa7rvV9LVOHpAAYnf5s0azfbhd8aM+gB/B VlNve5OsZEHojaloudJ26FenJIFCWR46ATMTmQRlssnc6Okxs5Tni/vlv5DkKhu8doy5aC1zHlx dNUZ5mvnkRPi23aIQ4Mygrsd3ftbOtjsoLw== X-Received: by 2002:a17:907:447d:: with SMTP id oo21mr4988122ejb.367.1608311817534; 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches 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 >