diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 3f9d157f2..16e3a627f 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -495,6 +495,8 @@ void ImportProject::importVcxproj(const std::string &filename, std::mapname; + fs.msc = true; + fs.useMfc = useOfMfc; fs.defines = "_WIN32=1"; if (p->platform == ProjectConfiguration::Win32) fs.platformType = cppcheck::Platform::Win32W; @@ -502,7 +504,6 @@ void ImportProject::importVcxproj(const std::string &filename, std::map::const_iterator i = itemDefinitionGroupList.begin(); i != itemDefinitionGroupList.end(); ++i) { if (!i->conditionIsTrue(*p)) diff --git a/lib/importproject.h b/lib/importproject.h index 456e8d812..ab6cdd36a 100644 --- a/lib/importproject.h +++ b/lib/importproject.h @@ -40,18 +40,19 @@ class CPPCHECKLIB ImportProject { public: /** File settings. Multiple configurations for a file is allowed. */ struct FileSettings { - FileSettings() : platformType(cppcheck::Platform::Unspecified), useMfc(false) {} + FileSettings() : platformType(cppcheck::Platform::Unspecified), msc(false), useMfc(false) {} std::string cfg; std::string filename; std::string defines; std::string cppcheckDefines() const { - return useMfc ? (defines + ";_MSC_VER=1900;__AFXWIN_H__=1") : defines; + return defines + (msc ? ";_MSC_VER=1900" : "") + (useMfc ? ";__AFXWIN_H__=1" : ""); } std::set undefs; std::list includePaths; std::list systemIncludePaths; std::string standard; cppcheck::Platform::PlatformType platformType; + bool msc; bool useMfc; void setDefines(std::string defs);