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]

[Patch, fortran] PR 56919 SYSTEM_CLOCK on Windows


the attached patch implements the SYSTEM_CLOCK intrinsics on the MinGW
and Cygwin targets using the GetTickCount/GetTickCount64 functions.
These should be quite robust monotonic clocks and AFAICS are the best
we can do on Windows. See e.g. for details.

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 box?), and that _WIN32 is the correct macro to use
to select code which is common to MinGW and Cygwin.

Ok for trunk?

2013-04-12  Janne Blomqvist  <>

    PR fortran/56919
    * intrinsics/time_1.h: Use _WIN32 instead of __MINGW32__ to catch
    both MinGW and Cygwin.
    * intrinsics/system_clock.c (system_clock_4): Use GetTickCount on
    (system_clock_8): Use GetTickCount64 or fallback to GetTickCount
    on _WIN32.
    * (AC_CHECK_FUNCS_ONCE): Check presence of
    * Regenerated.
    * configure: Regenerated.

Janne Blomqvist

Attachment: sysclockwin.diff
Description: Binary data

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