fix: linux compatibility(from cyano.CN)

This commit is contained in:
Roy Qu 2023-08-17 22:08:31 +08:00
parent 3d3e92bfdb
commit 98f015f661
3 changed files with 8 additions and 1 deletions

View File

@ -6438,7 +6438,12 @@ void CppParser::setLanguage(ParserLanguage newLanguage)
mCppTypeKeywords = CppTypeKeywords; mCppTypeKeywords = CppTypeKeywords;
#ifdef ENABLE_SDCC #ifdef ENABLE_SDCC
if (mLanguage == ParserLanguage::SDCC) { if (mLanguage == ParserLanguage::SDCC) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
mCppKeywords.insert(SDCCKeywords); mCppKeywords.insert(SDCCKeywords);
#else
for (auto &k : SDCCKeywords.keys())
mCppKeywords[k] = SDCCKeywords[k];
#endif
mCppTypeKeywords.unite(SDCCTypeKeywords); mCppTypeKeywords.unite(SDCCTypeKeywords);
} }
#endif #endif

View File

@ -2406,7 +2406,7 @@ QStringList Settings::CompilerSet::defines(bool isCpp) {
trimmedLine = trimmedLine.mid(2); trimmedLine = trimmedLine.mid(2);
if (trimmedLine.contains("=")) { if (trimmedLine.contains("=")) {
QList<QByteArray> items=trimmedLine.split('='); QList<QByteArray> items=trimmedLine.split('=');
result.append(QString("#define %1 %2").arg(items[0],items[1])); result.append(QString("#define %1 %2").arg(QString(items[0]),QString(items[1])));
} else { } else {
result.append("#define "+trimmedLine); result.append("#define "+trimmedLine);
} }

View File

@ -60,6 +60,8 @@
#define LLDB_MI_PROGRAM "lldb-mi" #define LLDB_MI_PROGRAM "lldb-mi"
#define LLDB_SERVER_PROGRAM "lldb-server" #define LLDB_SERVER_PROGRAM "lldb-server"
#define SDCC_PROGRAM "sdcc" #define SDCC_PROGRAM "sdcc"
#define PACKIHX_PROGRAM "packihx"
#define MAKEBIN_PROGRAM "makebin"
#elif defined(Q_OS_MACOS) #elif defined(Q_OS_MACOS)
#define CONSOLE_PAUSER "consolepauser" #define CONSOLE_PAUSER "consolepauser"
#define ASSEMBLER "nasm" #define ASSEMBLER "nasm"