[Patch, fortran] PR 56919 SYSTEM_CLOCK on Windows
Janne Blomqvist
blomqvist.janne@gmail.com
Sat Apr 13 00:03:00 GMT 2013
Hi,
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.
http://www.python.org/dev/peps/pep-0418/ 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 <jb@gcc.gnu.org>
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
_WIN32.
(system_clock_8): Use GetTickCount64 or fallback to GetTickCount
on _WIN32.
* configure.ac (AC_CHECK_FUNCS_ONCE): Check presence of
GetTickCount64.
* config.h.in: Regenerated.
* configure: Regenerated.
--
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sysclockwin.diff
Type: application/octet-stream
Size: 3226 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130413/a2e3a919/attachment.obj>
More information about the Gcc-patches
mailing list