msvc compatibility

This commit is contained in:
Roy Qu 2022-10-28 16:34:26 +08:00
parent e987959551
commit 054a99b690
9 changed files with 26 additions and 4 deletions

View File

@ -7,6 +7,7 @@ Red Panda C++ Version 2.1
- enhancement: add "goto block start"/"goto block end" in "Code" menu - enhancement: add "goto block start"/"goto block end" in "Code" menu
- add fmtlib to the gcc compiler's lib distributed with RedPanda IDE windows version - add fmtlib to the gcc compiler's lib distributed with RedPanda IDE windows version
- add default autolink for fmtlib in Windows - add default autolink for fmtlib in Windows
- reduce size of the executable of win-git-askpass tool
Red Panda C++ Version 2.0 Red Panda C++ Version 2.0

View File

@ -68,6 +68,11 @@ gcc | clang {
LIBS += $$OUT_PWD/../libs/qsynedit/$${OBJ_OUT_PWD}libqsynedit.a \ LIBS += $$OUT_PWD/../libs/qsynedit/$${OBJ_OUT_PWD}libqsynedit.a \
$$OUT_PWD/../libs/redpanda_qt_utils/$${OBJ_OUT_PWD}libredpanda_qt_utils.a $$OUT_PWD/../libs/redpanda_qt_utils/$${OBJ_OUT_PWD}libredpanda_qt_utils.a
} }
msvc {
LIBS += $$OUT_PWD/../libs/qsynedit/$${OBJ_OUT_PWD}qsynedit.lib \
$$OUT_PWD/../libs/redpanda_qt_utils/$${OBJ_OUT_PWD}redpanda_qt_utils.lib
LIBS += advapi32.lib user32.lib
}
SOURCES += \ SOURCES += \
HighlighterManager.cpp \ HighlighterManager.cpp \

View File

@ -67,7 +67,7 @@ class CPUDialog;
class QPlainTextEdit; class QPlainTextEdit;
class SearchDialog; class SearchDialog;
class Project; class Project;
class ProjectModelNode; struct ProjectModelNode;
class ProjectUnit; class ProjectUnit;
class ColorSchemeItem; class ColorSchemeItem;
class VisitHistoryManager; class VisitHistoryManager;

View File

@ -35,6 +35,10 @@ AboutDialog::AboutDialog(QWidget *parent) :
.arg(QString("GCC %1.%2") .arg(QString("GCC %1.%2")
.arg(__GNUC__) .arg(__GNUC__)
.arg(__GNUC_MINOR__))); .arg(__GNUC_MINOR__)));
#elif defined(_MSC_VER)
ui->lblQt->setText(ui->lblQt->text()
.arg(qVersion())
.arg(tr("Microsoft Visual C++")));
#else #else
ui->lblQt->setText(ui->lblQt->text() ui->lblQt->setText(ui->lblQt->text()
.arg(qVersion()) .arg(qVersion())

View File

@ -688,7 +688,7 @@ void Document::saveToFile(QFile &file, const QByteArray& encoding,
if (allAscii) { if (allAscii) {
realEncoding = ENCODING_ASCII; realEncoding = ENCODING_ASCII;
} else if (encoding == ENCODING_AUTO_DETECT) { } else if (encoding == ENCODING_AUTO_DETECT) {
if (codec->name() == "System") { if (codec->name().compare("System",Qt::CaseInsensitive)) {
realEncoding = pCharsetInfoManager->getDefaultSystemEncoding(); realEncoding = pCharsetInfoManager->getDefaultSystemEncoding();
} else { } else {
realEncoding = codec->name(); realEncoding = codec->name();

View File

@ -250,8 +250,8 @@ protected:
QVector<PUndoItem> mItems; QVector<PUndoItem> mItems;
int mMaxUndoActions; int mMaxUndoActions;
int mMaxMemoryUsage; int mMaxMemoryUsage;
size_t mNextChangeNumber; unsigned int mNextChangeNumber;
size_t mInitialChangeNumber; unsigned int mInitialChangeNumber;
bool mInsideRedo; bool mInsideRedo;
}; };

View File

@ -7,6 +7,10 @@ isEmpty(APP_NAME) {
CONFIG += c++11 console CONFIG += c++11 console
CONFIG -= app_bundle CONFIG -= app_bundle
msvc {
CONFIG += windows
}
# You can make your code fail to compile if it uses deprecated APIs. # You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line. # In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

View File

@ -3,6 +3,10 @@ QT -= gui
CONFIG += c++11 console CONFIG += c++11 console
CONFIG -= app_bundle CONFIG -= app_bundle
msvc {
CONFIG += windows
}
isEmpty(APP_NAME) { isEmpty(APP_NAME) {
APP_NAME = RedPandaCPP APP_NAME = RedPandaCPP
} }

View File

@ -3,6 +3,10 @@ CONFIG -= qt
CONFIG += c++11 CONFIG += c++11
CONFIG -= app_bundle CONFIG -= app_bundle
msvc {
LIBS += advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
}
DEFINES -= UNICODE DEFINES -= UNICODE
isEmpty(APP_NAME) { isEmpty(APP_NAME) {