--- BasiliskII/src/Unix/timer_unix.cpp 1999/10/14 16:05:18 1.2 +++ BasiliskII/src/Unix/timer_unix.cpp 2001/07/06 17:36:08 1.10 @@ -1,7 +1,7 @@ /* * timer_unix.cpp - Time Manager emulation, Unix specific stuff * - * Basilisk II (C) 1997-1999 Christian Bauer + * Basilisk II (C) 1997-2001 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,11 +19,17 @@ */ #include "sysdeps.h" +#include "macos_util.h" #include "timer.h" #define DEBUG 0 #include "debug.h" +// For NetBSD with broken pthreads headers +#ifndef CLOCK_REALTIME +#define CLOCK_REALTIME 0 +#endif + /* * Return microseconds since boot (64 bit) @@ -50,16 +56,9 @@ void Microseconds(uint32 &hi, uint32 &lo * Return local date/time in Mac format (seconds since 1.1.1904) */ -const uint32 TIME_OFFSET = 0x7c25b080; // Offset Mac->Unix time in seconds - uint32 TimerDateTime(void) { - time_t uct_now = time(NULL); - long tz = timezone; - time_t local_now = uct_now - tz; - if (daylight) - local_now += 3600; - return (uint32)local_now + TIME_OFFSET; + return TimeToMacTime(time(NULL)); }