From 2e156b8c4fc2f45a1af62ffc155361a4163d742e Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Thu, 3 Jun 2010 01:22:02 +0000 Subject: [PATCH] Add a temp stub to dialog_log.cpp to get it building on windows. This still has memory issues which I'll fix along with a new util function to get localtime_r() data on windows+unix. Originally committed to SVN as r4412. --- aegisub/src/dialog_log.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aegisub/src/dialog_log.cpp b/aegisub/src/dialog_log.cpp index 1f8ce48d6..d84075641 100644 --- a/aegisub/src/dialog_log.cpp +++ b/aegisub/src/dialog_log.cpp @@ -46,6 +46,7 @@ #include #include #endif +#include #include #include "dialog_log.h" @@ -97,6 +98,7 @@ LogWindow::EmitLog::EmitLog(wxTextCtrl *t): text_ctrl(t) { void LogWindow::EmitLog::Write(agi::log::SinkMessage *sm) { +#ifndef _WIN32 tm tmtime; localtime_r(&sm->tv.tv_sec, &tmtime); wxString log = wxString::Format("%c %02d:%02d:%02d %ld <%-25s> [%s:%s:%d] %s\n", @@ -110,9 +112,19 @@ void LogWindow::EmitLog::Write(agi::log::SinkMessage *sm) { sm->func, sm->line, strndup(sm->message, sm->len)); +#else + wxString log = wxString::Format("%c %ld <%-25s> [%s:%s:%d] %s\n", + agi::log::Severity_ID[sm->severity], + sm->tv.tv_usec, + sm->section, + sm->file, + sm->func, + sm->line, + sm->message); text_ctrl->AppendText(log); } +#endif void LogWindow::EmitLog::log(agi::log::SinkMessage *sm) { Write(sm);