From 55b34e05b3d735a84e1af9833e19c0b816c18252 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 30 Jun 2015 11:28:43 -0300 Subject: -some changes by okam --- drivers/unix/os_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/unix/os_unix.cpp') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 8ba56490d7..f6d9e0fb4e 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -57,8 +57,14 @@ #include #include #include "globals.h" + +extern bool _print_error_enabled; + void OS_Unix::print_error(const char* p_function,const char* p_file,int p_line,const char *p_code,const char*p_rationale,ErrorType p_type) { + if (!_print_error_enabled) + return; + if (p_rationale && p_rationale[0]) { print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,p_rationale); -- cgit v1.2.3 From 6f9a084ac8a820450632f17384161c6a24da86d3 Mon Sep 17 00:00:00 2001 From: Maximillian Date: Thu, 6 Aug 2015 10:29:33 -0700 Subject: Add OS.get_system_time_msec --- drivers/unix/os_unix.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/unix/os_unix.cpp') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index f6d9e0fb4e..1afd0be61d 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -223,6 +223,13 @@ uint64_t OS_Unix::get_unix_time() const { return time(NULL); }; +uint64_t OS_Unix::get_system_time_msec() const { + struct timeval tv_now; + gettimeofday(&tv_now, null); + uint64_t msec = tv_now.tv_.sec / 1000; + return msec; +} + OS::Date OS_Unix::get_date(bool utc) const { -- cgit v1.2.3 From 6b25e83ba73ae3321aff00d7b3192d8cd80c410c Mon Sep 17 00:00:00 2001 From: xodene Date: Thu, 6 Aug 2015 11:08:48 -0700 Subject: tested and fixed unix os_system_time_msec() --- drivers/unix/os_unix.cpp | 5 +++-- 1 file changed, 3 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 1afd0be61d..314e13cee4 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -225,8 +225,9 @@ 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); - uint64_t msec = tv_now.tv_.sec / 1000; + gettimeofday(&tv_now, NULL); + localtime(&tv_now.tv_usec); + uint64_t msec = tv_now.tv_usec/1000; return msec; } -- cgit v1.2.3