vc6 build errors

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6880 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2017-07-23 19:53:39 +00:00
parent 75bb9168ba
commit fb2accece2
3 changed files with 21 additions and 19 deletions

View file

@ -3451,16 +3451,16 @@ int CEXEBuild::parse_pragma(LineParser &line)
return ret;
}
void CEXEBuild::DiagState::Push()
void DiagState::Push()
{
CEXEBuild::DiagState *p = new DiagState();
DiagState *p = new DiagState();
p->m_Disabled = m_Disabled; // Copy current state
p->m_pStack = m_pStack, m_pStack = p;
}
bool CEXEBuild::DiagState::Pop()
bool DiagState::Pop()
{
if (!m_pStack) return false;
CEXEBuild::DiagState *pPop = m_pStack;
DiagState *pPop = m_pStack;
m_pStack = pPop->m_pStack, pPop->m_pStack = 0;
m_Disabled.swap(pPop->m_Disabled);
delete pPop;

View file

@ -165,6 +165,21 @@ namespace MakensisAPI {
#define FLAG_OFFSET(flag) (FIELD_OFFSET(exec_flags_t, flag)/sizeof(int))
class DiagState {
public:
DiagState() : m_pStack(0) { assert(DIAGCODE_INTERNAL_LAST <= 0xffff); }
~DiagState() { delete m_pStack; }
void Enable(DIAGCODE n) { m_Disabled.erase(static_cast<unsigned short>(n)); }
void Disable(DIAGCODE n) { m_Disabled.insert(static_cast<unsigned short>(n)); }
bool IsDisabled(DIAGCODE n) { return m_Disabled.find(static_cast<unsigned short>(n)) != m_Disabled.end(); }
void Push();
bool Pop();
static bool IsValidCode(unsigned int n) { return n >= DIAGCODE_INTERNAL_FIRST && n <= DIAGCODE_INTERNAL_LAST; }
protected:
DiagState *m_pStack;
std::set<unsigned short> m_Disabled;
};
class CEXEBuild {
public:
CEXEBuild(signed char pponly);
@ -396,20 +411,7 @@ class CEXEBuild {
void print_warnings();
void warninghelper(DIAGCODE dc, bool fl, const TCHAR *fmt, va_list args);
class DiagState {
public:
DiagState() : m_pStack(0) { assert(DIAGCODE_INTERNAL_LAST <= 0xffff); }
~DiagState() { delete m_pStack; }
void Enable(DIAGCODE n) { m_Disabled.erase(static_cast<unsigned short>(n)); }
void Disable(DIAGCODE n) { m_Disabled.insert(static_cast<unsigned short>(n)); }
bool IsDisabled(DIAGCODE n) { return m_Disabled.find(static_cast<unsigned short>(n)) != m_Disabled.end(); }
void Push();
bool Pop();
static bool IsValidCode(unsigned int n) { return n >= DIAGCODE_INTERNAL_FIRST && n <= DIAGCODE_INTERNAL_LAST; }
protected:
DiagState *m_pStack;
std::set<unsigned short> m_Disabled;
} diagstate;
DiagState diagstate;
/** Are we defining an uninstall version of the code?
* @param un Use like a boolean to define whether in uninstall mode.

View file

@ -868,7 +868,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
multiple_entries_instruction=0;
entry ent={};
entry ent={0,};
switch (which_token)
{
// macro stuff