mirror of https://github.com/Icinga/icinga2.git
Build fix for Windows
This commit is contained in:
parent
407f88e185
commit
1073f031c8
|
@ -506,6 +506,11 @@ void Application::DisplayBugMessage(std::ostream& os)
|
||||||
<< "***" << "\n";
|
<< "***" << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String Application::GetCrashReportFilename(void)
|
||||||
|
{
|
||||||
|
return GetLocalStateDir() + "/log/icinga2/crash/report." + Convert::ToString(Utility::GetTime());
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/**
|
/**
|
||||||
* Signal handler for SIGINT and SIGTERM. Prepares the application for cleanly
|
* Signal handler for SIGINT and SIGTERM. Prepares the application for cleanly
|
||||||
|
@ -539,11 +544,6 @@ void Application::SigUsr1Handler(int)
|
||||||
RequestReopenLogs();
|
RequestReopenLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
String Application::GetCrashReportFilename(void)
|
|
||||||
{
|
|
||||||
return GetLocalStateDir() + "/log/icinga2/crash/report." + Convert::ToString(Utility::GetTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signal handler for SIGABRT. Helps with debugging ASSERT()s.
|
* Signal handler for SIGABRT. Helps with debugging ASSERT()s.
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,3 +22,38 @@
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
boost::thread_specific_ptr<ScriptFrame *> ScriptFrame::m_CurrentFrame;
|
boost::thread_specific_ptr<ScriptFrame *> ScriptFrame::m_CurrentFrame;
|
||||||
|
|
||||||
|
ScriptFrame::ScriptFrame(void)
|
||||||
|
: Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals())
|
||||||
|
{
|
||||||
|
NextFrame = GetCurrentFrame();
|
||||||
|
SetCurrentFrame(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptFrame::ScriptFrame(const Value& self)
|
||||||
|
: Locals(new Dictionary()), Self(self)
|
||||||
|
{
|
||||||
|
NextFrame = GetCurrentFrame();
|
||||||
|
SetCurrentFrame(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptFrame::~ScriptFrame(void)
|
||||||
|
{
|
||||||
|
ASSERT(GetCurrentFrame() == this);
|
||||||
|
SetCurrentFrame(NextFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptFrame *ScriptFrame::GetCurrentFrame(void)
|
||||||
|
{
|
||||||
|
ScriptFrame **pframe = m_CurrentFrame.get();
|
||||||
|
|
||||||
|
if (pframe)
|
||||||
|
return *pframe;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptFrame::SetCurrentFrame(ScriptFrame *frame)
|
||||||
|
{
|
||||||
|
m_CurrentFrame.reset(new ScriptFrame *(frame));
|
||||||
|
}
|
|
@ -34,43 +34,16 @@ struct I2_BASE_API ScriptFrame
|
||||||
Value Self;
|
Value Self;
|
||||||
ScriptFrame *NextFrame;
|
ScriptFrame *NextFrame;
|
||||||
|
|
||||||
ScriptFrame(void)
|
ScriptFrame(void);
|
||||||
: Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals())
|
ScriptFrame(const Value& self);
|
||||||
{
|
~ScriptFrame(void);
|
||||||
NextFrame = GetCurrentFrame();
|
|
||||||
SetCurrentFrame(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
ScriptFrame(const Value& self)
|
static ScriptFrame *GetCurrentFrame(void);
|
||||||
: Locals(new Dictionary()), Self(self)
|
|
||||||
{
|
|
||||||
NextFrame = GetCurrentFrame();
|
|
||||||
SetCurrentFrame(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~ScriptFrame(void)
|
|
||||||
{
|
|
||||||
ASSERT(GetCurrentFrame() == this);
|
|
||||||
SetCurrentFrame(NextFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ScriptFrame *GetCurrentFrame(void)
|
|
||||||
{
|
|
||||||
ScriptFrame **pframe = m_CurrentFrame.get();
|
|
||||||
|
|
||||||
if (pframe)
|
|
||||||
return *pframe;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static boost::thread_specific_ptr<ScriptFrame *> m_CurrentFrame;
|
static boost::thread_specific_ptr<ScriptFrame *> m_CurrentFrame;
|
||||||
|
|
||||||
static inline void SetCurrentFrame(ScriptFrame *frame)
|
static void SetCurrentFrame(ScriptFrame *frame);
|
||||||
{
|
|
||||||
m_CurrentFrame.reset(new ScriptFrame *(frame));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue