From 8ae34ab7802763c2bbf64c8ba99c36d159da7220 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 6 Dec 2020 00:37:33 -0500 Subject: log: use uv_gettimeofday() for Windows POSIX gettimeofday() is not portable. --- src/nvim/log.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/nvim/log.c') diff --git a/src/nvim/log.c b/src/nvim/log.c index 225e40cdb4..19203a3c2a 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -13,9 +13,6 @@ #include #include #include -#if !defined(WIN32) -# include // for gettimeofday() -#endif #include #include "auto/config.h" @@ -296,12 +293,10 @@ static bool v_do_log_to_file(FILE *log_file, int log_level, } int millis = 0; -#if !defined(WIN32) - struct timeval curtime; - if (gettimeofday(&curtime, NULL) == 0) { + uv_timeval64_t curtime; + if (uv_gettimeofday(&curtime) == 0) { millis = (int)curtime.tv_usec / 1000; } -#endif // Print the log message. int64_t pid = os_get_pid(); -- cgit