8, changes to porting h for mac

master
Omnistudent 2013-11-25 22:07:19 +01:00
parent 497070c3bb
commit 4bf23d0fd1
2 changed files with 21 additions and 0 deletions

BIN
src/.porting.h.swp Normal file

Binary file not shown.

View File

@ -188,6 +188,27 @@ bool threadSetPriority(threadid_t tid, int prio);
#else // Posix
#include <sys/time.h>
#include <time.h>
#include <mach/mach_time.h>
#include <mach/mach.h> // This one makes policy thread work
#include <mach/mach_init.h>
#include <mach/thread_policy.h>
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 0
change get getTimeNs()
inline u32 getTimeNs()
{
//struct timespec ts;
//clock_gettime(CLOCK_REALTIME, &ts);
struct timeval tv;
gettimeofday(&tv, NULL);
// tv_sec = tv.tv_sec;
// tv_nsec = tv.tv_usec * 1000;
return tv.tv_sec * 1000000000 + tv.tv_usec*1000;
}
inline u32 getTimeS()
{