This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [Patch, fortran] PR 56919 SYSTEM_CLOCK on Windows


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
> box?),

  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[64]
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.

    cheers,
      DaveK


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