Windows build fixes.

This commit is contained in:
Gunnar Beutner 2013-02-24 08:52:09 +01:00
parent 022be22fa2
commit d011f09f32
7 changed files with 34 additions and 33 deletions

View File

@ -107,17 +107,6 @@ void Application::SetArgV(char **argv)
m_ArgV = argv;
}
#ifdef _DEBUG
void Application::ProfileTimerHandler(void)
{
stringstream msgbuf;
msgbuf << "Active objects: " << Object::GetAliveObjectsCount();
Logger::Write(LogInformation, "base", msgbuf.str());
Object::PrintMemoryProfile();
}
#endif /* _DEBUG */
void Application::ShutdownTimerHandler(void)
{
if (m_ShuttingDown) {
@ -144,14 +133,6 @@ void Application::RunEventLoop(void) const
shutdownTimer->SetInterval(0.5);
shutdownTimer->Start();
#ifdef _DEBUG
/* Set up a timer that periodically prints some information about the object system. */
Timer::Ptr profileTimer = boost::make_shared<Timer>();
profileTimer->OnTimerExpired.connect(boost::bind(&Application::ProfileTimerHandler));
flushTxTimer->SetInterval(15);
flushTxTimer->Start();
#endif /* _DEBUG */
Timer::Initialize();
GetEQ().Join();

View File

@ -113,9 +113,6 @@ private:
static void TimeWatchThreadProc(void);
static void NewTxTimerHandler(void);
#ifdef _DEBUG
static void ProfileTimerHandler(void)
#endif /* _DEBUG */
static void ShutdownTimerHandler(void);
};

View File

@ -26,7 +26,7 @@
<ClCompile Include="dynamicobject.cpp" />
<ClCompile Include="dictionary.cpp" />
<ClCompile Include="dynamictype.cpp" />
<ClCompile Include="event.cpp" />
<ClCompile Include="eventqueue.cpp" />
<ClCompile Include="exception.cpp" />
<ClCompile Include="fifo.cpp" />
<ClCompile Include="i2-base.cpp">
@ -68,7 +68,7 @@
<ClInclude Include="dynamicobject.h" />
<ClInclude Include="dictionary.h" />
<ClInclude Include="dynamictype.h" />
<ClInclude Include="event.h" />
<ClInclude Include="eventqueue.h" />
<ClInclude Include="fifo.h" />
<ClInclude Include="stdiostream.h" />
<ClInclude Include="stream.h" />

View File

@ -10,9 +10,6 @@
<ClCompile Include="dictionary.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="event.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="exception.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
@ -94,6 +91,18 @@
<ClCompile Include="convert.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="objectlock.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="process-unix.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="process-windows.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="eventqueue.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="application.h">
@ -108,9 +117,6 @@
<ClInclude Include="dictionary.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="event.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="exception.h">
<Filter>Headerdateien</Filter>
</ClInclude>
@ -198,6 +204,12 @@
<ClInclude Include="convert.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="objectlock.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="eventqueue.h">
<Filter>Headerdateien</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Quelldateien">

View File

@ -17,8 +17,9 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
#ifndef _WIN32
#include "i2-base.h"
#ifndef _WIN32
#include <execvpe.h>
using namespace icinga;

View File

@ -17,9 +17,9 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
#ifdef _WIN32
#include "i2-base.h"
#ifdef _WIN32
using namespace icinga;
void Process::Initialize(void)
@ -45,6 +45,7 @@ void Process::InitTask(void)
bool Process::RunTask(void)
{
// TODO: implement
return false;
}
#endif /* _WIN32 */

View File

@ -81,8 +81,17 @@ void StreamLogger::ProcessLogEntry(ostream& stream, bool tty, const LogEntry& en
time_t ts = entry.Timestamp;
tm tmnow;
#ifdef _WIN32
tm *temp = localtime(&ts);
if (temp == NULL)
BOOST_THROW_EXCEPTION(PosixException("localtime() failed", errno));
tmnow = *temp;
#else /* _WIN32 */
if (localtime_r(&ts, &tmnow) == NULL)
BOOST_THROW_EXCEPTION(PosixException("localtime_r() failed.", errno));
#endif /* _WIN32 */
strftime(timestamp, sizeof(timestamp), "%Y/%m/%d %H:%M:%S %z", &tmnow);