From e83d44a0633183b51e0848d1b638e34d6cea3d91 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 17 Sep 2009 16:17:36 +0000 Subject: [PATCH] Dynare++: MinGW has an implementation of gettimeofday(), no need to provide one git-svn-id: https://www.dynare.org/svn/dynare/trunk@2944 ac1d8469-bf42-47a9-8791-bf33cf982152 --- dynare++/kord/journal.cweb | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/dynare++/kord/journal.cweb b/dynare++/kord/journal.cweb index 1df0fa438..0943d44ca 100644 --- a/dynare++/kord/journal.cweb +++ b/dynare++/kord/journal.cweb @@ -17,7 +17,6 @@ SystemResources _sysres; #ifdef __MINGW32__ -@<|gettimeofday| Win32 implementation@>; @<|sysconf| Win32 implementation@>; #endif @@ -240,40 +239,6 @@ void Journal::printHeader() } -@ Taken from list {\tt gdb@@sources.redhat.com}, the author is Danny Smith. - -|_W32_FT_OFFSET| is a time from 1 Jan 1601 to 1 Jan 1970 in 100ns -units, and the the |filetime| is taken from {\tt windows.h} file. - -@s filetime int -@s __stdcall int -@d _W32_FT_OFFSET (116444736000000000LL) -@s w32_ftv int - -@<|gettimeofday| Win32 implementation@>= -typedef struct _filetime { - unsigned long dwLowDateTime; - unsigned long dwHighDateTime; -} filetime; -@# -extern "C" { - void __stdcall GetSystemTimeAsFileTime(filetime*); -}; -@# -typedef union { - long long ns100; // time since 1 Jan 1601 in 100ns units - filetime ft; -} w32_ftv; -@# -void gettimeofday(struct timeval* p, struct timezone* tz) -{ - w32_ftv _now; - GetSystemTimeAsFileTime( &(_now.ft) ); - p->tv_usec=(long)((_now.ns100 / 10LL) % 1000000LL ); - p->tv_sec= (long)((_now.ns100-_W32_FT_OFFSET)/10000000LL); - return; -} - @ Here we implement |sysconf| for MinGW. We implement only page size, number of physial pages, and a number of available physical pages. The pagesize is set to 1024 bytes, real pagesize can differ but it is not