From patchwork Wed Dec 11 07:29:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 1207488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515672-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qHJ8bsJD"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OyFXV7sY"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47XpVB2bvmz9sR7 for ; Wed, 11 Dec 2019 18:29:52 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=wSoIS8MD2MrvV5MKqTJXSqF+VQddT5trHJKfXyM3igXaILecnk v90mcSZm2RidwWHWR1x3lKiQavGiKPa5PYPkoXmKQJ6l8236lt7AHuDPX6HZeumd roVhBfn7DNoB2GFAyHb2WW9seROdP5BQauUan9F7nn8Lu/ikqNVMIYftM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=8uDMHMemYwp7aQTBtQ6/mfFQUIc=; b=qHJ8bsJDmqnTrC1ahaSS osuUJhdlcV85Wg/7sTKiAs+eCtPmi0nykUiBlp+k1q7rI/6CEDKxuwvkh7NMVoj0 4/qYHCDMG5WW1JI6woK1Zvtt/H/aMQmiO7FAuKP6yyvViBWZ8mc2w3A/pP83Fjq2 EWbzo9Oh+nPpXYpADUAgwUs= Received: (qmail 98539 invoked by alias); 11 Dec 2019 07:29:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 98522 invoked by uid 89); 11 Dec 2019 07:29:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wr1-f46.google.com Received: from mail-wr1-f46.google.com (HELO mail-wr1-f46.google.com) (209.85.221.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Dec 2019 07:29:43 +0000 Received: by mail-wr1-f46.google.com with SMTP id y11so22802270wrt.6; Tue, 10 Dec 2019 23:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=25buIwENckXJ6VdY3dO248dNU+49zT+NLdV6CuO/bsY=; b=OyFXV7sYqhCjQ+rErHm0uPUNjLfzLXPX+tv2QT0LlXLCHJFVCskyy446tZ1TiHUk3H OwhQqHtu2oIkmwgRmKBw9GTAw1vJkKmT3zxQvJtIwO9EKii9q/Uws8VzbqqikJtblMUt GRN+yFl3SRLwtofttRr9VuKhU4K1k7owfNSr21rvIFxgIGgGeG7srxkazi1nKjDdH8bw T6HgmvtJ+vW1lSVPlDufVT+haE7BAeP8dKkgFXcy0hG9bgj2lJOJ5wqr9Xvh8z02bESF 8cZzsYZBIv/AcEnkamlduTb3Dzp4WNYe+XDl82OIBOui7Yiuczmu1ITX/Iq7qNoEaoqY HxCw== Received: from [192.168.42.160] ([92.184.96.43]) by smtp.googlemail.com with ESMTPSA id t12sm1180860wrs.96.2019.12.10.23.29.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Dec 2019 23:29:36 -0800 (PST) To: "libstdc++@gcc.gnu.org" , gcc-patches From: =?utf-8?q?Fran=C3=A7ois_Dumont?= Subject: [PATCH] Fix gnu-versioned-namespace build Message-ID: <16fe9ee4-310a-d8d1-d581-4afdf4590d9a@gmail.com> Date: Wed, 11 Dec 2019 08:29:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 I plan to commit this tomorrow. Note that rather than just adding the missing _GLIBCXX_[BEGIN,END]_VERSION_NAMESPACE I also move anonymous namespace usage outside std namespace. Let me know if it was intentional.     * src/c++11/random.cc: Add _GLIBCXX_BEGIN_NAMESPACE_VERSION and     _GLIBCXX_END_NAMESPACE_VERSION. Move anonymous namespace outside std     namespace. Tested under Linux x86_64 normal/debug/versioned namespace modes. There are still tests failing in versioned namespace, more patches to come. François diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index 10fbe1dc4c4..d4ebc9556ab 100644 --- a/libstdc++-v3/src/c++11/random.cc +++ b/libstdc++-v3/src/c++11/random.cc @@ -73,8 +73,6 @@ # define USE_MT19937 1 #endif -namespace std _GLIBCXX_VISIBILITY(default) -{ namespace { #if USE_RDRAND @@ -124,6 +122,10 @@ namespace std _GLIBCXX_VISIBILITY(default) #endif } +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + void random_device::_M_init(const std::string& token) { @@ -286,7 +288,7 @@ namespace std _GLIBCXX_VISIBILITY(default) _M_mt.seed(seed); #else // Convert old default token "mt19937" or numeric seed tokens to "default". - if (token == "mt19937" || isdigit((unsigned char)token[0])) + if (token == "mt19937" || std::isdigit((unsigned char)token[0])) _M_init("default"); else _M_init(token); @@ -407,5 +409,7 @@ namespace std _GLIBCXX_VISIBILITY(default) 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL>; #endif // USE_MT19937 -} + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std #endif // _GLIBCXX_USE_C99_STDINT_TR1