plat unix 64 bit timestamps on 32-bit os

Signed-off-by: Imo Farcher <ifar@gmx.net>
This commit is contained in:
Imo Farcher 2015-01-26 15:39:36 +08:00 committed by Andy Green
parent 49f72aa451
commit 97a748a2d0
2 changed files with 2 additions and 2 deletions

View file

@ -721,7 +721,7 @@ LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
for (n = 0; n < LLL_COUNT; n++)
if (level == (1 << n)) {
now = time_in_microseconds() / 100;
sprintf(buf, "[%lu:%04d] %s: ", (unsigned long) now / 10000,
sprintf(buf, "[%llu:%04d] %s: ", (unsigned long long) now / 10000,
(int)(now % 10000), log_level_names[n]);
break;
}

View file

@ -8,7 +8,7 @@ unsigned long long time_in_microseconds(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec * 1000000) + tv.tv_usec;
return ((unsigned long long)tv.tv_sec * 1000000LL) + tv.tv_usec;
}
LWS_VISIBLE int libwebsockets_get_random(struct libwebsocket_context *context,