This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, libgfortran, committed] Don't use rand_s on CYGWIN
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: NightStrike <nightstrike at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>, JonY <10walls at gmail dot com>
- Date: Sun, 12 Mar 2017 22:46:50 +0200
- Subject: Re: [Patch, libgfortran, committed] Don't use rand_s on CYGWIN
- Authentication-results: sourceware.org; auth=none
- References: <CAO9iq9HLQ_pgS=foupwWUzmRXaKnx4J5GbMy_TjDgzuh3vHayw@mail.gmail.com> <CAF1jjLvoGe-e0VsRTikY-s6YB5Kts3p9pi3qWrX+Ls+Rgvt_XQ@mail.gmail.com>
On Sun, Mar 12, 2017 at 7:26 PM, NightStrike <nightstrike@gmail.com> wrote:
> On Mon, Feb 27, 2017 at 6:15 AM, Janne Blomqvist
> <blomqvist.janne@gmail.com> wrote:
>> Don't try to use rand_s on CYGWIN
>>
>> CYGWIN seems to include _mingw.h and thus __MINGW64_VERSION_MAJOR is
>> defined even though rand_s is not available. Thus add an extra check
>> for __CYGWIN__.
>>
>> Thanks to Tim Prince and Nightstrike for bringing this issue to my attention.
>>
>> Committed as r245755.
>>
>> 2017-02-27 Janne Blomqvist <jb@gcc.gnu.org>
>>
>> * intrinsics/random.c (getosrandom): Don't try to use rand_s on
>> CYGWIN.
>
> 1) There was no patch attached to the email.
Oh, sorry. Well, you can see it at
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=245755
> 2) As mentioned on IRC, I don't think this is the right fix. The real
> problem is that time_1.h includes windows.h on CYGWIN, which it
> shouldn't be doing. This then pollutes the translation unit with all
> sorts of MINGW-isms that aren't exactly appropriate for cygwin.
> Removing the include in time_1.h and then adjusting a few ifdefs in
> system_clock.c that also had the same bug fixes the problem. The
> testsuite is running right now on this.
It used to be something like that, but IIRC there were some complaints
about SYSTEM_CLOCK on cygwin that were due to the cygwin
clock_gettime() or something like that, and after some discussion with
someone who knows something about cygwin/mingw (since you apparently
have no memory of it, I guess it was Kai), it was decided to use
GetTickCount & QPC also on cygwin.
--
Janne Blomqvist