only simplify Microsoft MFC code when Windows platform is selected
This commit is contained in:
parent
e234e8cc5b
commit
af5272dfb0
|
@ -10393,6 +10393,11 @@ void Tokenizer::simplifyBuiltinExpect()
|
|||
// Remove Microsoft MFC 'DECLARE_MESSAGE_MAP()'
|
||||
void Tokenizer::simplifyMicrosoftMFC()
|
||||
{
|
||||
// skip if not Windows
|
||||
if (!(_settings->platformType == Settings::Win32 ||
|
||||
_settings->platformType == Settings::Win64))
|
||||
return;
|
||||
|
||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||
{
|
||||
if (Token::simpleMatch(tok->next(), "DECLARE_MESSAGE_MAP ( )"))
|
||||
|
|
|
@ -5544,16 +5544,16 @@ private:
|
|||
void microsoftMFC()
|
||||
{
|
||||
const char code1[] = "class MyDialog : public CDialog { DECLARE_MESSAGE_MAP() private: CString text; };";
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code1,false));
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code1,false,true,Settings::Win32));
|
||||
|
||||
const char code2[] = "class MyDialog : public CDialog { DECLARE_DYNAMIC(MyDialog) private: CString text; };";
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code2,false));
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code2,false,true,Settings::Win32));
|
||||
|
||||
const char code3[] = "class MyDialog : public CDialog { DECLARE_DYNCREATE(MyDialog) private: CString text; };";
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code3,false));
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code3,false,true,Settings::Win32));
|
||||
|
||||
const char code4[] = "class MyDialog : public CDialog { DECLARE_DYNAMIC_CLASS(MyDialog) private: CString text; };";
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code4,false));
|
||||
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code4,false,true,Settings::Win32));
|
||||
}
|
||||
|
||||
void borland()
|
||||
|
|
Loading…
Reference in New Issue