From 5f0a739cc72bf1d1c33274de219e9759ce675c5e Mon Sep 17 00:00:00 2001 From: cebix <> Date: Sun, 26 Oct 2003 00:32:31 +0000 Subject: [PATCH] - fixed compilation problems under BeOS - boot drive wasn't set correctly --- SheepShaver/src/BeOS/main_beos.cpp | 7 ++++--- SheepShaver/src/BeOS/sysdeps.h | 9 +++++++++ SheepShaver/src/Unix/main_unix.cpp | 5 ++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/SheepShaver/src/BeOS/main_beos.cpp b/SheepShaver/src/BeOS/main_beos.cpp index 2b17c6dd..580f41eb 100644 --- a/SheepShaver/src/BeOS/main_beos.cpp +++ b/SheepShaver/src/BeOS/main_beos.cpp @@ -353,6 +353,7 @@ void SheepShaver::MessageReceived(BMessage *msg) void SheepShaver::StartEmulator(void) { char str[256]; + int16 i16; // Open sheep driver and remap low memory sheep_fd = open("/dev/sheep", 0); @@ -446,10 +447,10 @@ void SheepShaver::StartEmulator(void) XPRAMInit(); // Set boot volume - drive = PrefsFindInt32("bootdrive"); + i16 = PrefsFindInt32("bootdrive"); XPRAM[0x1378] = i16 >> 8; XPRAM[0x1379] = i16 & 0xff; - driver = PrefsFindInt32("bootdriver"); + i16 = PrefsFindInt32("bootdriver"); XPRAM[0x137a] = i16 >> 8; XPRAM[0x137b] = i16 & 0xff; @@ -1317,7 +1318,7 @@ void PatchAfterStartup(void) * NVRAM watchdog thread (saves NVRAM every minute) */ -static status_t SheepShaver::nvram_func(void *arg) +status_t SheepShaver::nvram_func(void *arg) { SheepShaver *obj = (SheepShaver *)arg; diff --git a/SheepShaver/src/BeOS/sysdeps.h b/SheepShaver/src/BeOS/sysdeps.h index 46966c57..33149296 100644 --- a/SheepShaver/src/BeOS/sysdeps.h +++ b/SheepShaver/src/BeOS/sysdeps.h @@ -21,6 +21,11 @@ #ifndef SYSDEPS_H #define SYSDEPS_H +// Do we have std namespace? +#ifdef __POWERPC__ +#define NO_STD_NAMESPACE +#endif + #include #include #include @@ -42,6 +47,10 @@ typedef bigtime_t tm_time_t; // 64 bit file offsets typedef off_t loff_t; +// Data types +typedef uint32 uintptr; +typedef int32 intptr; + // Macro for calling MacOS routines #define CallMacOS(type, proc) (*(type)proc)() #define CallMacOS1(type, proc, arg1) (*(type)proc)(arg1) diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index 38f6af29..960c7b6b 100644 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -269,7 +269,6 @@ int main(int argc, char **argv) char str[256]; uint32 *boot_globs; int16 i16; - int drive, driver; int rom_fd; FILE *proc_file; const char *rom_path; @@ -524,10 +523,10 @@ int main(int argc, char **argv) XPRAMInit(); // Set boot volume - drive = PrefsFindInt32("bootdrive"); + i16 = PrefsFindInt32("bootdrive"); XPRAM[0x1378] = i16 >> 8; XPRAM[0x1379] = i16 & 0xff; - driver = PrefsFindInt32("bootdriver"); + i16 = PrefsFindInt32("bootdriver"); XPRAM[0x137a] = i16 >> 8; XPRAM[0x137b] = i16 & 0xff;