mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-22 13:31:08 +00:00
Merge branch 'master' of https://github.com/cebix/macemu
This commit is contained in:
commit
bc7cd78467
@ -185,10 +185,10 @@ typedef char * caddr_t;
|
||||
#endif
|
||||
|
||||
/* Time data type for Time Manager emulation */
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
typedef struct timespec tm_time_t;
|
||||
#elif defined(__MACH__)
|
||||
#if defined(__MACH__)
|
||||
typedef mach_timespec_t tm_time_t;
|
||||
#elif defined(HAVE_CLOCK_GETTIME)
|
||||
typedef struct timespec tm_time_t;
|
||||
#else
|
||||
typedef struct timeval tm_time_t;
|
||||
#endif
|
||||
|
@ -57,14 +57,14 @@ static inline void mach_current_time(tm_time_t &t) {
|
||||
void Microseconds(uint32 &hi, uint32 &lo)
|
||||
{
|
||||
D(bug("Microseconds\n"));
|
||||
#if defined(HAVE_CLOCK_GETTIME)
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
uint64 tl = (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#elif defined(__MACH__)
|
||||
#if defined(__MACH__)
|
||||
tm_time_t t;
|
||||
mach_current_time(t);
|
||||
uint64 tl = (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#elif defined(HAVE_CLOCK_GETTIME)
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
uint64 tl = (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#else
|
||||
struct timeval t;
|
||||
gettimeofday(&t, NULL);
|
||||
@ -91,10 +91,10 @@ uint32 TimerDateTime(void)
|
||||
|
||||
void timer_current_time(tm_time_t &t)
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
#elif defined(__MACH__)
|
||||
#if defined(__MACH__)
|
||||
mach_current_time(t);
|
||||
#elif defined(HAVE_CLOCK_GETTIME)
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
#else
|
||||
gettimeofday(&t, NULL);
|
||||
#endif
|
||||
@ -229,14 +229,14 @@ int32 timer_host2mac_time(tm_time_t hosttime)
|
||||
|
||||
uint64 GetTicks_usec(void)
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#elif defined(__MACH__)
|
||||
#if defined(__MACH__)
|
||||
tm_time_t t;
|
||||
mach_current_time(t);
|
||||
return (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#elif defined(HAVE_CLOCK_GETTIME)
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return (uint64)t.tv_sec * 1000000 + t.tv_nsec / 1000;
|
||||
#else
|
||||
struct timeval t;
|
||||
gettimeofday(&t, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user