From b44a674d7e003b1a6c54f16a6e756b1876f73fba Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sat, 20 Aug 2016 03:14:21 +0100 Subject: [PATCH] Add MacTimeToTime to SheepShaver's macos_util. Commit e1693eb92bcf13101f55da460b315fd48028c4ed made extfs_unix.cpp require this function in both BasiliskII and SheepShaver, but only added the function itself to BasiliskII. --- SheepShaver/src/include/macos_util.h | 1 + SheepShaver/src/macos_util.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/SheepShaver/src/include/macos_util.h b/SheepShaver/src/include/macos_util.h index 0b8e3eee..aec13cff 100644 --- a/SheepShaver/src/include/macos_util.h +++ b/SheepShaver/src/include/macos_util.h @@ -357,6 +357,7 @@ extern uint32 FindLibSymbol(const char *lib, const char *sym); // Find symbol in extern void InitCallUniversalProc(void); // Init CallUniversalProc() extern long CallUniversalProc(void *upp, uint32 info); // CallUniversalProc() extern uint32 TimeToMacTime(time_t t); // Convert time_t value to MacOS time +extern time_t MacTimeToTime(uint32 t); // Convert MacOS time to time_t value extern uint32 Mac_sysalloc(uint32 size); // Allocate block in MacOS system heap zone extern void Mac_sysfree(uint32 addr); // Release block occupied by the nonrelocatable block p diff --git a/SheepShaver/src/macos_util.cpp b/SheepShaver/src/macos_util.cpp index 13b21397..bb33ace5 100644 --- a/SheepShaver/src/macos_util.cpp +++ b/SheepShaver/src/macos_util.cpp @@ -339,6 +339,17 @@ uint32 TimeToMacTime(time_t t) } +/* + * Convert MacOS time to time_t (seconds since 1.1.1970) + */ + +time_t MacTimeToTime(uint32 t) +{ + // simply subtract number of seconds between 1.1.1904 and 1.1.1970 + return t - 2082826800; +} + + /* * Memory allocators in MacOS system heap zone */