From e3e93da6b94cdf14e9a6f466cf5f50a857166928 Mon Sep 17 00:00:00 2001 From: Ariel Manzur Date: Wed, 9 Sep 2015 20:24:38 +0000 Subject: fixed localtime thing for ios, not tested anywhere else --- drivers/unix/os_unix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/unix/os_unix.cpp') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 314e13cee4..05af7ee900 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -226,7 +226,8 @@ uint64_t OS_Unix::get_unix_time() const { uint64_t OS_Unix::get_system_time_msec() const { struct timeval tv_now; gettimeofday(&tv_now, NULL); - localtime(&tv_now.tv_usec); + //localtime(&tv_now.tv_usec); + localtime((const long *)&tv_now.tv_usec); uint64_t msec = tv_now.tv_usec/1000; return msec; } -- cgit v1.2.3 From fad1faddae96454bbe4abfef1bf394b3d2c9c057 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 10 Sep 2015 13:10:23 -0300 Subject: Removing locatime so this function compiles again. I don't think it has any practical use anyway. --- drivers/unix/os_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/unix/os_unix.cpp') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 05af7ee900..96f90e6be1 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -227,8 +227,8 @@ uint64_t OS_Unix::get_system_time_msec() const { struct timeval tv_now; gettimeofday(&tv_now, NULL); //localtime(&tv_now.tv_usec); - localtime((const long *)&tv_now.tv_usec); - uint64_t msec = tv_now.tv_usec/1000; + //localtime((const long *)&tv_now.tv_usec); + uint64_t msec = uint64_t(tv_now.tv_sec)*1000+tv_now.tv_usec/1000; return msec; } -- cgit v1.2.3