diff --git a/src/pc/debuglog.h b/src/pc/debuglog.h index 66af0e82..f415fba2 100644 --- a/src/pc/debuglog.h +++ b/src/pc/debuglog.h @@ -7,9 +7,13 @@ static void _debuglog_print_timestamp(void) { time_t ltime = time(NULL); +#if defined(_WIN32) + char* str = asctime(localtime(<ime)); +#else struct tm ltime2 = { 0 }; localtime_r(<ime, <ime2); char* str = asctime(<ime2); +#endif printf("%.*s", (int)strlen(str) - 1, str); } diff --git a/src/pc/logfile.h b/src/pc/logfile.h index 99f6eb52..7e1f9387 100644 --- a/src/pc/logfile.h +++ b/src/pc/logfile.h @@ -26,9 +26,13 @@ void logfile_close(enum LogFileType logFileType); static void _logfile_print_timestamp(enum LogFileType logFileType) { FILE* f = gLogFiles[logFileType].file; time_t ltime = time(NULL); +#if defined(_WIN32) + char* str = asctime(localtime(<ime)); +#else struct tm ltime2 = { 0 }; localtime_r(<ime, <ime2); char* str = asctime(<ime2); +#endif fprintf(f, "%.*s", (int)strlen(str) - 1, str); }