This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some questions about adding mingw support for std::random_device

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]