From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25550 invoked by alias); 28 Dec 2012 14:12:01 -0000 Received: (qmail 25539 invoked by uid 22791); 28 Dec 2012 14:12:00 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ia0-f182.google.com (HELO mail-ia0-f182.google.com) (209.85.210.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Dec 2012 14:11:51 +0000 Received: by mail-ia0-f182.google.com with SMTP id x2so8882466iad.13 for ; Fri, 28 Dec 2012 06:11:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.40.135 with SMTP id x7mr24666132igk.79.1356703910798; Fri, 28 Dec 2012 06:11:50 -0800 (PST) Received: by 10.43.5.199 with HTTP; Fri, 28 Dec 2012 06:11:50 -0800 (PST) In-Reply-To: References: Date: Fri, 28 Dec 2012 14:12:00 -0000 Message-ID: Subject: Re: Some questions about adding mingw support for std::random_device From: Jonathan Wakely To: niXman Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00144.txt.bz2 On 28 December 2012 08:05, niXman wrote: > Hi, > > I want to add mingw support for std::random_device and I have a few questions. > > 1) When configuring libstdc++, the GLIBCXX_CHECK_RANDOM_TR1 test > passes successfully, because MSYS is used. But the compiler and the > programs created by it can not use '/dev/urandom' || '/dev/random', > because they do not use MSYS-runtime. As I know nothing about MSYS I don't understand this. Why do the files exist but can't be used? Do you mean the files are present on the system where GCC is built, but not on the system where compiled programs run? > The first question is, do I need > to change the GLIBCXX_CHECK_RANDOM_TR1 test itself so that for mingw > it would be not successful, or I have to add in the file > 'libstdc++-v3/include/bits/random.h' an additional checking by the > preprocessor and ignore the value of _GLIBCXX_USE_RANDOM_TR1 macro? I > think the first variant is more logical because the second variant > seems to be some cleaning up. Fixing the test would be better, but if it's not possible to tell whether the files are usable until runtime then no preprocessor test can work. > 2) Since the I'm very new in autotools, tell me please, how should I > change the GLIBCXX_CHECK_RANDOM_TR1 test? Change the acinclude.m4 file, then regenerate the other files by running autoreconf. You'll need the right version of autoconf, which is 2.64