On 15 Nov 2007 at 11:13, Maurice Lombardi wrote:
[...]
HAVE_GETTIMEOFDAY 1 is defined in p/rts/rts-config.h and the function gettimeofday() is declared in <sys/time.h>
But os-hacks.h used to compile gpc with mingw contains: ----------------------------------------------------------------------- /* we undefine HAVE_GETTIMEOFDAY because of Cygwin's date/time bug */ #undef HAVE_GETTIMEOFDAY
/* new time() that uses the WinAPI to call GetLocalTime */ #undef time #define time(_timer) \ ( \ { \ time_t *timer = (_timer); \ SYSTEMTIME tmp; \ time_t tmp2 = 0; \ struct tm gnu; \ memset (&gnu, 0, sizeof (gnu)); \ GetLocalTime (&tmp); \ gnu.tm_isdst = -1; \ gnu.tm_year = tmp.wYear - 1900; \ gnu.tm_mon = tmp.wMonth - 1; \ gnu.tm_mday = tmp.wDay; \ gnu.tm_hour = tmp.wHour; \ gnu.tm_min = tmp.wMinute; \ gnu.tm_sec = tmp.wSecond; \ tmp2 = mktime (&gnu); \ if (timer) *timer = tmp2; \ tmp2; \ } \ )
this function time() apparently does not set microseconds.
I thought someone might raise this. The result is exactly the same when those bits of os-hacks.h are removed. Remember that gcc does not use os- hacks.h, and the problem has been reported to show up in a C++ test program as well.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/