mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
hopefully fix Windows build
This commit is contained in:
parent
39784bc7c2
commit
d485411727
1 changed files with 9 additions and 0 deletions
|
@ -97,9 +97,18 @@ int writeLog(int level, const char* msg, fmt::printf_args& args) {
|
||||||
logEntries[pos].text=fmt::vsprintf(msg,args);
|
logEntries[pos].text=fmt::vsprintf(msg,args);
|
||||||
// why do I have to pass a pointer
|
// why do I have to pass a pointer
|
||||||
// can't I just pass the time_t directly?!
|
// can't I just pass the time_t directly?!
|
||||||
|
#ifdef _WIN32
|
||||||
|
struct tm* tempTM=localtime(&thisMakesNoSense);
|
||||||
|
if (tempTM==NULL) {
|
||||||
|
memset(&logEntries[pos].time,0,sizeof(struct tm));
|
||||||
|
} else {
|
||||||
|
memcpy(&logEntries[pos].time,tempTM,sizeof(struct tm));
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (localtime_r(&thisMakesNoSense,&logEntries[pos].time)==NULL) {
|
if (localtime_r(&thisMakesNoSense,&logEntries[pos].time)==NULL) {
|
||||||
memset(&logEntries[pos].time,0,sizeof(struct tm));
|
memset(&logEntries[pos].time,0,sizeof(struct tm));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
logEntries[pos].loglevel=level;
|
logEntries[pos].loglevel=level;
|
||||||
logEntries[pos].ready=true;
|
logEntries[pos].ready=true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue