Fix compilation of rtl_test.c on Mac OS X

pull/18/head
Mike Miller 2016-01-17 22:17:21 +02:00
rodzic 0d825fe08e
commit 06aa92f52c
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -152,9 +152,10 @@ static void underrun_test(unsigned char *buf, uint32_t len, int mute)
static int ppm_gettime(struct time_generic *tg)
{
int rv = ENOSYS;
struct timespec ts;
#ifdef __unix__
struct timespec ts;
rv = clock_gettime(CLOCK_MONOTONIC, &ts);
tg->tv_sec = ts.tv_sec;
tg->tv_nsec = ts.tv_nsec;
@ -162,8 +163,8 @@ static int ppm_gettime(struct time_generic *tg)
struct timeval tv;
rv = gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
tg->tv_sec = tv.tv_sec;
tg->tv_nsec = tv.tv_usec * 1000;
#endif
return rv;
}