mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +00:00
log: use uv_gettimeofday() for Windows
POSIX gettimeofday() is not portable.
This commit is contained in:
@@ -13,9 +13,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if !defined(WIN32)
|
|
||||||
# include <sys/time.h> // for gettimeofday()
|
|
||||||
#endif
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "auto/config.h"
|
#include "auto/config.h"
|
||||||
@@ -296,12 +293,10 @@ static bool v_do_log_to_file(FILE *log_file, int log_level,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int millis = 0;
|
int millis = 0;
|
||||||
#if !defined(WIN32)
|
uv_timeval64_t curtime;
|
||||||
struct timeval curtime;
|
if (uv_gettimeofday(&curtime) == 0) {
|
||||||
if (gettimeofday(&curtime, NULL) == 0) {
|
|
||||||
millis = (int)curtime.tv_usec / 1000;
|
millis = (int)curtime.tv_usec / 1000;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Print the log message.
|
// Print the log message.
|
||||||
int64_t pid = os_get_pid();
|
int64_t pid = os_get_pid();
|
||||||
|
Reference in New Issue
Block a user