This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran] PR 56919 SYSTEM_CLOCK on Windows
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 13 Apr 2013 17:29:25 +0300
- Subject: Re: [Patch, fortran] PR 56919 SYSTEM_CLOCK on Windows
- References: <CAO9iq9FBmgY8A9b7PXKAbcXhHKuMk8mk_cYAgo_mcP2yCcXUyw at mail dot gmail dot com> <51687348 dot 70902 at gmail dot com>
On Fri, Apr 12, 2013 at 11:49 PM, Dave Korn <firstname.lastname@example.org> wrote:
> On 12/04/2013 19:47, Janne Blomqvist wrote:
>> As I don't have a Windows system to test on, I would appreciate if somebody
>> more familiar with that platform could take a quick look. In particular, I
>> *think* it should be Ok to use win32 API functions on Cygwin (that is,
>> cygwin-gcc ships the windows.h and other necessary headers out of the
> Well, after installing the w32api package, but basically yes, that's fine
> for simple stuff like that. (You shouldn't go doing things like creating
> threads or synchronisation through the Win32 API, but calling GetTickCount
> will be fine.)
>> and that _WIN32 is the correct macro to use to select code which is common
>> to MinGW and Cygwin.
> Alas no:
>> $ gcc-4 -E - < /dev/null -dM | grep WIN
>> #define __WINT_MAX__ 4294967295U
>> #define __WINT_MIN__ 0U
>> #define __SIZEOF_WINT_T__ 4
>> #define __CYGWIN__ 1
>> #define __WINT_TYPE__ unsigned int
>> #define __CYGWIN32__ 1
> You should probably use "#if defined(__MINGW32__) || defined (__CYGWIN__)",
> since that'll also work on 64-bit Cygwin, as opposed to using __CYGWIN32__. I
> think __MINGW32__ is defined for 64-bit as well as 32-bit targets.
Ok, I'll do that. Thanks for the info. FWIW, I grepped through the gcc
tree and there's quite a lot of
#if defined(_WIN32) && !defined(__CYGWIN__)
and similar, which in the light of the above, is pointless.
And yes, I also recall that mingw-w64 also defines __MINGW32__.