Merge pull request #95 from atsampson/master

Add MacTimeToTime to SheepShaver's macos_util.
This commit is contained in:
asvitkine 2016-08-26 11:55:07 -04:00 committed by GitHub
commit 3cb91cc003
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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
*/