gettimeofday() should return int.

This commit is contained in:
Themaister 2011-12-25 01:54:29 +01:00
parent c8dee57278
commit 70f07196ea

View File

@ -23,13 +23,26 @@
#else
#include <winsock2.h>
#include <mmsystem.h>
static void gettimeofday(struct timeval *val, void *dummy)
static int gettimeofday(struct timeval *val, void *dummy)
{
(void)dummy;
DWORD msec = timeGetTime();
uint64_t usec = msec * 1000;
val->tv_sec = usec / 1000000;
val->tv_usec = usec % 1000000;
return 0;
}
#endif
#ifdef __CELLOS_LV2__
#include <sys/sys_time.h>
static int gettimeofday(struct timeval *val, void *dummy)
{
(void)dummy;
uint64_t usec = sys_time_get_system_time();
val->tv_sec = usec / 1000000;
val->tv_usec = usec % 1000000;
return 0;
}
#endif
@ -46,17 +59,6 @@ void gfx_window_title_reset(void)
gl_frames = 0;
}
#ifdef __CELLOS_LV2__
#include <sys/sys_time.h>
static void gettimeofday(struct timeval *val, void *dummy)
{
(void)dummy;
uint64_t usec = sys_time_get_system_time();
val->tv_sec = usec / 1000000;
val->tv_usec = usec % 1000000;
}
#endif
bool gfx_window_title(char *buf, size_t size)
{
static struct timeval tv;