--- ./src/Unix/timer_unix.cpp Fri Feb 2 12:52:58 2001 +++ ../BasiliskII-0.9/./src/Unix/timer_unix.cpp Mon Jul 9 10:38:21 2001 @@ -57,15 +57,24 @@ uint32 TimerDateTime(void) { - time_t utc_now = time(NULL); -#if defined(__linux__) || defined(__SVR4) - time_t local_now = utc_now - timezone; -#elif defined(__FreeBSD__) || defined(__NetBSD__) - time_t local_now = utc_now + localtime(&utc_now)->tm_gmtoff; -#else - time_t local_now = utc_now; -#endif - return (uint32)local_now + TIME_OFFSET; + time_t t = time(NULL); + // From 9 Jul 01 CVS version of BasiliskII, function TimeToMacTime() + + // This code is taken from glibc 2.2 + + // Convert to number of seconds elapsed since 1-Jan-1904 + struct tm *local = localtime(&t); + const int TM_EPOCH_YEAR = 1900; + const int MAC_EPOCH_YEAR = 1904; + int a4 = ((local->tm_year + TM_EPOCH_YEAR) >> 2) - !(local->tm_year & 3); + int b4 = (MAC_EPOCH_YEAR >> 2) - !(MAC_EPOCH_YEAR & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = a100 >> 2; + int b400 = b100 >> 2; + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + uint32 days = local->tm_yday + 365 * (local->tm_year - 4) + intervening_leap_days; + return local->tm_sec + 60 * (local->tm_min + 60 * (local->tm_hour + 24 * days)); } --- ./src/Unix/sigsegv.cpp Sun May 20 20:21:54 2001 +++ ../BasiliskII-0.9/./src/Unix/sigsegv.cpp Mon Jul 9 08:29:39 2001 @@ -250,9 +250,9 @@ #include #include -static caddr_t page = 0; +static volatile caddr_t page = 0; static int page_size; -static int handler_called = 0; +static volatile int handler_called = 0; static bool sigsegv_test_handler(sigsegv_address_t fault_address, sigsegv_address_t instruction_address) { @@ -281,6 +281,10 @@ page[123] = 45; page[123] = 45; +#ifdef sgi + // Keep SGI's MIPSPro compilers from moving the read of handler_called + __synchronize(); +#endif if (handler_called != 1) return 1; --- ./src/Unix/configure Thu May 31 14:47:29 2001 +++ ../BasiliskII-0.9/./src/Unix/configure Mon Jul 9 08:29:39 2001 @@ -4390,7 +4390,7 @@ #line 4391 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int) throw(); +extern "C" void exit(int); #endif #include @@ -4455,7 +4455,7 @@ #line 4456 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int) throw(); +extern "C" void exit(int); #endif #include @@ -4526,7 +4526,7 @@ #line 4527 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int) throw(); +extern "C" void exit(int); #endif #include @@ -4604,7 +4604,7 @@ #line 4605 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int) throw(); +extern "C" void exit(int); #endif #define HAVE_SIGINFO_T 1 @@ -4668,7 +4668,7 @@ #line 4669 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int) throw(); +extern "C" void exit(int); #endif #define HAVE_SIGCONTEXT_SUBTERFUGE 1