forked from mxe/mxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtservice-1-fixes.patch
145 lines (128 loc) · 4.88 KB
/
qtservice-1-fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
This file is part of MXE. See LICENSE.md for licensing information.
Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 21 Jan 2022 01:43:14 +0100
Subject: [PATCH 1/2] adjust build for MXE
diff --git a/qtservice/buildlib/buildlib.pro b/qtservice/buildlib/buildlib.pro
index 1111111..2222222 100644
--- a/qtservice/buildlib/buildlib.pro
+++ b/qtservice/buildlib/buildlib.pro
@@ -11,3 +11,16 @@ win32 {
}
target.path = $$DESTDIR
INSTALLS += target
+
+CONFIG -= dll debug_and_release build_all
+CONFIG += create_prl create_pc
+QMAKE_PKGCONFIG_DESTDIR = pkgconfig
+DESTDIR =
+DLLDESTDIR =
+headers.path = $$[QT_INSTALL_HEADERS]
+headers.files += ../src/qtservice.h
+win32:dlltarget.path = $$[QT_INSTALL_BINS]
+target.path = $$[QT_INSTALL_LIBS]
+!static:win32:target.CONFIG = no_dll
+win32:INSTALLS += dlltarget
+INSTALLS += target headers
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 20 Jan 2022 22:48:22 +0100
Subject: [PATCH 2/2] qt6 build fixes
diff --git a/qtservice/src/qtservice.cpp b/qtservice/src/qtservice.cpp
index 1111111..2222222 100644
--- a/qtservice/src/qtservice.cpp
+++ b/qtservice/src/qtservice.cpp
@@ -436,7 +436,7 @@ private:
QtServiceBase *QtServiceBasePrivate::instance = 0;
QtServiceBasePrivate::QtServiceBasePrivate(const QString &name)
- : startupType(QtServiceController::ManualStartup), serviceFlags(0), controller(name)
+ : startupType(QtServiceController::ManualStartup), controller(name)
{
}
@@ -663,7 +663,6 @@ QtServiceBase::QtServiceBase(int argc, char **argv, const QString &name)
d_ptr = new QtServiceBasePrivate(nm);
d_ptr->q_ptr = this;
- d_ptr->serviceFlags = 0;
d_ptr->sysd = 0;
for (int i = 0; i < argc; ++i)
d_ptr->args.append(QString::fromLocal8Bit(argv[i]));
diff --git a/qtservice/src/qtservice.h b/qtservice/src/qtservice.h
index 1111111..2222222 100644
--- a/qtservice/src/qtservice.h
+++ b/qtservice/src/qtservice.h
@@ -59,7 +59,6 @@
# define QT_QTSERVICE_EXPORT
#endif
-class QStringList;
class QtServiceControllerPrivate;
class QT_QTSERVICE_EXPORT QtServiceController
diff --git a/qtservice/src/qtservice_unix.cpp b/qtservice/src/qtservice_unix.cpp
index 1111111..2222222 100644
--- a/qtservice/src/qtservice_unix.cpp
+++ b/qtservice/src/qtservice_unix.cpp
@@ -297,7 +297,7 @@ private:
};
QtServiceSysPrivate::QtServiceSysPrivate()
- : QtUnixServerSocket(), ident(0), serviceFlags(0)
+ : QtUnixServerSocket(), ident(0)
{
}
diff --git a/qtservice/src/qtservice_win.cpp b/qtservice/src/qtservice_win.cpp
index 1111111..2222222 100644
--- a/qtservice/src/qtservice_win.cpp
+++ b/qtservice/src/qtservice_win.cpp
@@ -737,11 +737,20 @@ class QtServiceAppEventFilter : public QAbstractNativeEventFilter
{
public:
QtServiceAppEventFilter() {}
+#if QT_VERSION >= 0x060000
+ bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
+#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
+#endif
};
-bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result)
+#if QT_VERSION >= 0x060000
+bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
+#else
+bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
+#endif
{
+ Q_UNUSED(eventType);
MSG *winMessage = (MSG*)message;
if (winMessage->message == WM_ENDSESSION && (winMessage->lParam & ENDSESSION_LOGOFF)) {
*result = TRUE;
diff --git a/qtwinmigrate/src/qmfcapp.cpp b/qtwinmigrate/src/qmfcapp.cpp
index 1111111..2222222 100644
--- a/qtwinmigrate/src/qmfcapp.cpp
+++ b/qtwinmigrate/src/qmfcapp.cpp
@@ -73,8 +73,13 @@ QMfcAppEventFilter::QMfcAppEventFilter() : QAbstractNativeEventFilter()
{
}
-bool QMfcAppEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result)
+#if QT_VERSION >= 0x060000
+bool QMfcAppEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
+#else
+bool QMfcAppEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
+#endif
{
+ Q_UNUSED(eventType);
return static_cast<QMfcApp*>(qApp)->winEventFilter((MSG*)message, result);
}
#endif
diff --git a/qtwinmigrate/src/qmfcapp.h b/qtwinmigrate/src/qmfcapp.h
index 1111111..2222222 100644
--- a/qtwinmigrate/src/qmfcapp.h
+++ b/qtwinmigrate/src/qmfcapp.h
@@ -74,7 +74,11 @@ class QT_QTWINMIGRATE_EXPORT QMfcAppEventFilter : public QAbstractNativeEventFil
{
public:
QMfcAppEventFilter();
+#if QT_VERSION >= 0x060000
+ bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
+#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
+#endif
};
#endif