Make the Linux / Unix backend year 2038 compliant.

This commit is contained in:
Yamagi Burmeister 2017-08-31 18:41:19 +02:00
parent e869223e7f
commit 406857f57a

View file

@ -84,18 +84,17 @@ Sys_Milliseconds(void)
{
struct timeval tp;
struct timezone tzp;
static int secbase;
static long secbase;
gettimeofday(&tp, &tzp);
if (!secbase)
{
secbase = tp.tv_sec;
return tp.tv_usec / 1000;
return (int)(tp.tv_usec / 1000);
}
curtime = (tp.tv_sec - secbase) * 1000 + tp.tv_usec / 1000;
curtime = (int)((tp.tv_sec - secbase) * 1000 + tp.tv_usec / 1000);
return curtime;
}