forked from dgiunchi/fervor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fvplatform.cpp
210 lines (177 loc) · 3.31 KB
/
fvplatform.cpp
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#include "fvplatform.h"
#include <QtGlobal>
#include <QDebug>
FvPlatform::FvPlatform(QObject *parent) :
QObject(parent)
{
// noop
}
bool FvPlatform::CurrentlyRunningOnPlatform(QString platform)
{
platform = platform.toUpper().trimmed();
if (platform.isEmpty()) {
return false;
}
// Defined on AIX.
#ifdef Q_OS_AIX
if (platform == "Q_OS_AIX") {
return true;
}
#endif
// Q_OS_BSD4 ("Defined on Any BSD 4.4 system") intentionally skipped.
// Defined on BSD/OS.
#ifdef Q_OS_BSDI
if (platform == "Q_OS_BSDI") {
return true;
}
#endif
// Defined on Cygwin.
#ifdef Q_OS_CYGWIN
if (platform == "Q_OS_CYGWIN") {
return true;
}
#endif
// Q_OS_DARWIN ("Defined on Darwin OS (synonym for Q_OS_MAC)") intentionally skipped.
// Defined on DG/UX.
#ifdef Q_OS_DGUX
if (platform == "Q_OS_DGUX") {
return true;
}
#endif
// Defined on DYNIX/ptx.
#ifdef Q_OS_DYNIX
if (platform == "Q_OS_DYNIX") {
return true;
}
#endif
// Defined on FreeBSD.
#ifdef Q_OS_FREEBSD
if (platform == "Q_OS_FREEBSD") {
return true;
}
#endif
// Defined on HP-UX.
#ifdef Q_OS_HPUX
if (platform == "Q_OS_HPUX") {
return true;
}
#endif
// Defined on GNU Hurd.
#ifdef Q_OS_HURD
if (platform == "Q_OS_HURD") {
return true;
}
#endif
// Defined on SGI Irix.
#ifdef Q_OS_IRIX
if (platform == "Q_OS_IRIX") {
return true;
}
#endif
// Defined on Linux.
#ifdef Q_OS_LINUX
if (platform == "Q_OS_LINUX") {
return true;
}
#endif
// Defined on LynxOS.
#ifdef Q_OS_LYNX
if (platform == "Q_OS_LYNX") {
return true;
}
#endif
// Defined on MAC OS (synonym for Darwin).
#ifdef Q_OS_MAC
if (platform == "Q_OS_MAC") {
return true;
}
#endif
// Q_OS_MSDOS ("Defined on MS-DOS and Windows") intentionally skipped.
// Defined on NetBSD.
#ifdef Q_OS_NETBSD
if (platform == "Q_OS_NETBSD") {
return true;
}
#endif
// Defined on OS/2.
#ifdef Q_OS_OS2
if (platform == "Q_OS_OS2") {
return true;
}
#endif
// Defined on OpenBSD.
#ifdef Q_OS_OPENBSD
if (platform == "Q_OS_OPENBSD") {
return true;
}
#endif
// Defined on XFree86 on OS/2 (not PM).
#ifdef Q_OS_OS2EMX
if (platform == "Q_OS_OS2EMX") {
return true;
}
#endif
// Defined on HP Tru64 UNIX.
#ifdef Q_OS_OSF
if (platform == "Q_OS_OSF") {
return true;
}
#endif
// Defined on QNX Neutrino.
#ifdef Q_OS_QNX
if (platform == "Q_OS_QNX") {
return true;
}
#endif
// Defined on Reliant UNIX.
#ifdef Q_OS_RELIANT
if (platform == "Q_OS_RELIANT") {
return true;
}
#endif
// Defined on SCO OpenServer 5.
#ifdef Q_OS_SCO
if (platform == "Q_OS_SCO") {
return true;
}
#endif
// Defined on Sun Solaris.
#ifdef Q_OS_SOLARIS
if (platform == "Q_OS_SOLARIS") {
return true;
}
#endif
// Defined on Symbian.
#ifdef Q_OS_SYMBIAN
if (platform == "Q_OS_SYMBIAN") {
return true;
}
#endif
// Defined on DEC Ultrix.
#ifdef Q_OS_ULTRIX
if (platform == "Q_OS_ULTRIX") {
return true;
}
#endif
// Q_OS_UNIX ("Defined on Any UNIX BSD/SYSV system") intentionally skipped.
// Defined on UnixWare 7, Open UNIX 8.
#ifdef Q_OS_UNIXWARE
if (platform == "Q_OS_UNIXWARE") {
return true;
}
#endif
// Defined on Windows CE (note: goes before Q_OS_WIN32)
#ifdef Q_OS_WINCE
if (platform == "Q_OS_WINCE") {
return true;
}
#endif
// Defined on all supported versions of Windows.
#ifdef Q_OS_WIN32
if (platform == "Q_OS_WIN32") {
return true;
}
#endif
// Fallback
return false;
}