msvc compatibility

This commit is contained in:
Roy Qu 2022-03-29 09:43:24 +08:00
parent a40c818e54
commit facdb59c66
10 changed files with 31 additions and 10 deletions

View File

@ -13,6 +13,8 @@ isEmpty(APP_VERSION) {
APP_VERSION=1.0.2 APP_VERSION=1.0.2
} }
win32: VERSION = $${APP_VERSION}.0 win32: VERSION = $${APP_VERSION}.0
else: VERSION = $${APP_VERSION} else: VERSION = $${APP_VERSION}
@ -29,6 +31,10 @@ gcc {
QMAKE_CXXFLAGS_DEBUG += -Werror=return-type QMAKE_CXXFLAGS_DEBUG += -Werror=return-type
} }
msvc {
DEFINES += NOMINMAX
}
# 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

@ -25,7 +25,7 @@
class Runner; class Runner;
class Compiler; class Compiler;
class Project; class Project;
class OJProblemCase; struct OJProblemCase;
using POJProblemCase = std::shared_ptr<OJProblemCase>; using POJProblemCase = std::shared_ptr<OJProblemCase>;
class CompilerManager : public QObject class CompilerManager : public QObject
{ {

View File

@ -23,7 +23,7 @@
#include "parser/cppparser.h" #include "parser/cppparser.h"
class Editor; class Editor;
class BufferCoord; struct BufferCoord;
class Project; class Project;
class CppRefacter : public QObject class CppRefacter : public QObject
{ {

View File

@ -149,8 +149,10 @@ MainWindow::MainWindow(QWidget *parent)
ui->tblStackTrace->setModel(mDebugger->backtraceModel()); ui->tblStackTrace->setModel(mDebugger->backtraceModel());
ui->watchView->setModel(mDebugger->watchModel()); ui->watchView->setModel(mDebugger->watchModel());
ui->tblMemoryView->setModel(mDebugger->memoryModel()); ui->tblMemoryView->setModel(mDebugger->memoryModel());
ui->tblMemoryView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); ui->tblMemoryView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
try { try {
mDebugger->breakpointModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config()) mDebugger->breakpointModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_BREAKPOINTS_FILE); +DEV_BREAKPOINTS_FILE);

View File

@ -16,7 +16,7 @@
*/ */
#include "projectversioninfowidget.h" #include "projectversioninfowidget.h"
#include "ui_projectversioninfowidget.h" #include "ui_projectversioninfowidget.h"
#include <winnls.h> #include <windows.h>
#include "../mainwindow.h" #include "../mainwindow.h"
#include "../project.h" #include "../project.h"

View File

@ -38,7 +38,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
#else #else
ui->lblQt->setText(ui->lblQt->text() ui->lblQt->setText(ui->lblQt->text()
.arg(qVersion()) .arg(qVersion())
.arg(tr("Non-GCC Compiler")); .arg(tr("Non-GCC Compiler")));
#endif #endif
ui->lblCompileTime->setText(ui->lblCompileTime->text() ui->lblCompileTime->setText(ui->lblCompileTime->text()
.arg(__DATE__, __TIME__)); .arg(__DATE__, __TIME__));

View File

@ -29,6 +29,11 @@ win32: {
} }
} }
win32-msvc {
QMAKE_CFLAGS += /source-charset:utf-8
QMAKE_CXXFLAGS += /source-charset:utf-8
}
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} qnx: target.path = $${PREFIX}/libexec/$${APP_NAME}
else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME}

View File

@ -22,6 +22,9 @@ using std::string;
#include <windows.h> #include <windows.h>
#include <conio.h> #include <conio.h>
#ifndef WINBOOL
#define WINBOOL BOOL
#endif
#define MAX_COMMAND_LENGTH 32768 #define MAX_COMMAND_LENGTH 32768
#define MAX_ERROR_LENGTH 2048 #define MAX_ERROR_LENGTH 2048

View File

@ -1,9 +1,14 @@
win32-msvc{
CONFIG += c++11
CONFIG -= app_bundle
DEFINES -= UNICODE
} else {
TEMPLATE = app TEMPLATE = app
CONFIG += windows CONFIG += windows
CONFIG -= app_bundle CONFIG -= app_bundle
CONFIG -= qt CONFIG -= qt
DEFINES -= UNICODE }
isEmpty(APP_NAME) { isEmpty(APP_NAME) {
APP_NAME = RedPandaCPP APP_NAME = RedPandaCPP
} }