author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 01:19:32 +0300 | |
changeset 37 | 758a864f9613 |
parent 33 | 3e2da88830cd |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtCore module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QGLOBAL_H |
|
43 |
#define QGLOBAL_H |
|
44 |
||
45 |
#include <stddef.h> |
|
46 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
47 |
#define QT_VERSION_STR "4.7.0" |
0 | 48 |
/* |
49 |
QT_VERSION is (major << 16) + (minor << 8) + patch. |
|
50 |
*/ |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
51 |
#define QT_VERSION 0x040700 |
0 | 52 |
/* |
53 |
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) |
|
54 |
*/ |
|
55 |
#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) |
|
56 |
||
57 |
#define QT_PACKAGEDATE_STR "YYYY-MM-DD" |
|
58 |
||
59 |
#define QT_PACKAGE_TAG "" |
|
60 |
||
61 |
#if !defined(QT_BUILD_MOC) |
|
62 |
#include <QtCore/qconfig.h> |
|
63 |
#endif |
|
64 |
||
65 |
#ifdef __cplusplus |
|
66 |
||
67 |
#ifndef QT_NAMESPACE /* user namespace */ |
|
68 |
||
69 |
# define QT_PREPEND_NAMESPACE(name) ::name |
|
70 |
# define QT_USE_NAMESPACE |
|
71 |
# define QT_BEGIN_NAMESPACE |
|
72 |
# define QT_END_NAMESPACE |
|
73 |
# define QT_BEGIN_INCLUDE_NAMESPACE |
|
74 |
# define QT_END_INCLUDE_NAMESPACE |
|
75 |
# define QT_BEGIN_MOC_NAMESPACE |
|
76 |
# define QT_END_MOC_NAMESPACE |
|
77 |
# define QT_FORWARD_DECLARE_CLASS(name) class name; |
|
78 |
# define QT_FORWARD_DECLARE_STRUCT(name) struct name; |
|
79 |
# define QT_MANGLE_NAMESPACE(name) name |
|
80 |
||
81 |
#else /* user namespace */ |
|
82 |
||
83 |
# define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name |
|
84 |
# define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE; |
|
85 |
# define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE { |
|
86 |
# define QT_END_NAMESPACE } |
|
87 |
# define QT_BEGIN_INCLUDE_NAMESPACE } |
|
88 |
# define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE { |
|
89 |
# define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE |
|
90 |
# define QT_END_MOC_NAMESPACE |
|
91 |
# define QT_FORWARD_DECLARE_CLASS(name) \ |
|
92 |
QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \ |
|
93 |
using QT_PREPEND_NAMESPACE(name); |
|
94 |
||
95 |
# define QT_FORWARD_DECLARE_STRUCT(name) \ |
|
96 |
QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \ |
|
97 |
using QT_PREPEND_NAMESPACE(name); |
|
98 |
||
99 |
# define QT_MANGLE_NAMESPACE0(x) x |
|
100 |
# define QT_MANGLE_NAMESPACE1(a, b) a##_##b |
|
101 |
# define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b) |
|
102 |
# define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \ |
|
103 |
QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE)) |
|
104 |
||
105 |
namespace QT_NAMESPACE {} |
|
106 |
||
107 |
# ifndef QT_BOOTSTRAPPED |
|
108 |
# ifndef QT_NO_USING_NAMESPACE |
|
109 |
/* |
|
110 |
This expands to a "using QT_NAMESPACE" also in _header files_. |
|
111 |
It is the only way the feature can be used without too much |
|
112 |
pain, but if people _really_ do not want it they can add |
|
113 |
DEFINES += QT_NO_USING_NAMESPACE to their .pro files. |
|
114 |
*/ |
|
115 |
QT_USE_NAMESPACE |
|
116 |
# endif |
|
117 |
# endif |
|
118 |
||
119 |
#endif /* user namespace */ |
|
120 |
||
121 |
#else /* __cplusplus */ |
|
122 |
||
123 |
# define QT_BEGIN_NAMESPACE |
|
124 |
# define QT_END_NAMESPACE |
|
125 |
# define QT_USE_NAMESPACE |
|
126 |
# define QT_BEGIN_INCLUDE_NAMESPACE |
|
127 |
# define QT_END_INCLUDE_NAMESPACE |
|
128 |
||
129 |
#endif /* __cplusplus */ |
|
130 |
||
131 |
#if defined(Q_OS_MAC) && !defined(Q_CC_INTEL) |
|
132 |
#define QT_BEGIN_HEADER extern "C++" { |
|
133 |
#define QT_END_HEADER } |
|
134 |
#define QT_BEGIN_INCLUDE_HEADER } |
|
135 |
#define QT_END_INCLUDE_HEADER extern "C++" { |
|
136 |
#else |
|
137 |
#define QT_BEGIN_HEADER |
|
138 |
#define QT_END_HEADER |
|
139 |
#define QT_BEGIN_INCLUDE_HEADER |
|
140 |
#define QT_END_INCLUDE_HEADER extern "C++" |
|
141 |
#endif |
|
142 |
||
143 |
/* |
|
144 |
The operating system, must be one of: (Q_OS_x) |
|
145 |
||
146 |
DARWIN - Darwin OS (synonym for Q_OS_MAC) |
|
147 |
SYMBIAN - Symbian |
|
148 |
MSDOS - MS-DOS and Windows |
|
149 |
OS2 - OS/2 |
|
150 |
OS2EMX - XFree86 on OS/2 (not PM) |
|
151 |
WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008) |
|
152 |
WINCE - WinCE (Windows CE 5.0) |
|
153 |
CYGWIN - Cygwin |
|
154 |
SOLARIS - Sun Solaris |
|
155 |
HPUX - HP-UX |
|
156 |
ULTRIX - DEC Ultrix |
|
157 |
LINUX - Linux |
|
158 |
FREEBSD - FreeBSD |
|
159 |
NETBSD - NetBSD |
|
160 |
OPENBSD - OpenBSD |
|
161 |
BSDI - BSD/OS |
|
162 |
IRIX - SGI Irix |
|
163 |
OSF - HP Tru64 UNIX |
|
164 |
SCO - SCO OpenServer 5 |
|
165 |
UNIXWARE - UnixWare 7, Open UNIX 8 |
|
166 |
AIX - AIX |
|
167 |
HURD - GNU Hurd |
|
168 |
DGUX - DG/UX |
|
169 |
RELIANT - Reliant UNIX |
|
170 |
DYNIX - DYNIX/ptx |
|
171 |
QNX - QNX |
|
172 |
QNX6 - QNX RTP 6.1 |
|
173 |
LYNX - LynxOS |
|
174 |
BSD4 - Any BSD 4.4 system |
|
175 |
UNIX - Any UNIX BSD/SYSV system |
|
176 |
*/ |
|
177 |
||
178 |
#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__)) |
|
179 |
# define Q_OS_DARWIN |
|
180 |
# define Q_OS_BSD4 |
|
181 |
# ifdef __LP64__ |
|
182 |
# define Q_OS_DARWIN64 |
|
183 |
# else |
|
184 |
# define Q_OS_DARWIN32 |
|
185 |
# endif |
|
186 |
#elif defined(__SYMBIAN32__) || defined(SYMBIAN) |
|
187 |
# define Q_OS_SYMBIAN |
|
188 |
# define Q_NO_POSIX_SIGNALS |
|
189 |
# define QT_NO_GETIFADDRS |
|
190 |
#elif defined(__CYGWIN__) |
|
191 |
# define Q_OS_CYGWIN |
|
192 |
#elif defined(MSDOS) || defined(_MSDOS) |
|
193 |
# define Q_OS_MSDOS |
|
194 |
#elif defined(__OS2__) |
|
195 |
# if defined(__EMX__) |
|
196 |
# define Q_OS_OS2EMX |
|
197 |
# else |
|
198 |
# define Q_OS_OS2 |
|
199 |
# endif |
|
200 |
#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) |
|
201 |
# define Q_OS_WIN32 |
|
202 |
# define Q_OS_WIN64 |
|
203 |
#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) |
|
204 |
# if defined(WINCE) || defined(_WIN32_WCE) |
|
205 |
# define Q_OS_WINCE |
|
206 |
# else |
|
207 |
# define Q_OS_WIN32 |
|
208 |
# endif |
|
209 |
#elif defined(__MWERKS__) && defined(__INTEL__) |
|
210 |
# define Q_OS_WIN32 |
|
211 |
#elif defined(__sun) || defined(sun) |
|
212 |
# define Q_OS_SOLARIS |
|
213 |
#elif defined(hpux) || defined(__hpux) |
|
214 |
# define Q_OS_HPUX |
|
215 |
#elif defined(__ultrix) || defined(ultrix) |
|
216 |
# define Q_OS_ULTRIX |
|
217 |
#elif defined(sinix) |
|
218 |
# define Q_OS_RELIANT |
|
219 |
#elif defined(__linux__) || defined(__linux) |
|
220 |
# define Q_OS_LINUX |
|
221 |
#elif defined(__FreeBSD__) || defined(__DragonFly__) |
|
222 |
# define Q_OS_FREEBSD |
|
223 |
# define Q_OS_BSD4 |
|
224 |
#elif defined(__NetBSD__) |
|
225 |
# define Q_OS_NETBSD |
|
226 |
# define Q_OS_BSD4 |
|
227 |
#elif defined(__OpenBSD__) |
|
228 |
# define Q_OS_OPENBSD |
|
229 |
# define Q_OS_BSD4 |
|
230 |
#elif defined(__bsdi__) |
|
231 |
# define Q_OS_BSDI |
|
232 |
# define Q_OS_BSD4 |
|
233 |
#elif defined(__sgi) |
|
234 |
# define Q_OS_IRIX |
|
235 |
#elif defined(__osf__) |
|
236 |
# define Q_OS_OSF |
|
237 |
#elif defined(_AIX) |
|
238 |
# define Q_OS_AIX |
|
239 |
#elif defined(__Lynx__) |
|
240 |
# define Q_OS_LYNX |
|
241 |
#elif defined(__GNU__) |
|
242 |
# define Q_OS_HURD |
|
243 |
#elif defined(__DGUX__) |
|
244 |
# define Q_OS_DGUX |
|
245 |
#elif defined(__QNXNTO__) |
|
246 |
# define Q_OS_QNX |
|
247 |
#elif defined(_SEQUENT_) |
|
248 |
# define Q_OS_DYNIX |
|
249 |
#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */ |
|
250 |
# define Q_OS_SCO |
|
251 |
#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */ |
|
252 |
# define Q_OS_UNIXWARE |
|
253 |
#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */ |
|
254 |
# define Q_OS_UNIXWARE |
|
255 |
#elif defined(__INTEGRITY) |
|
256 |
# define Q_OS_INTEGRITY |
|
257 |
#elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */ |
|
258 |
# define Q_OS_VXWORKS |
|
259 |
#elif defined(__MAKEDEPEND__) |
|
260 |
#else |
|
261 |
# error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com" |
|
262 |
#endif |
|
263 |
||
264 |
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE) |
|
265 |
# define Q_OS_WIN |
|
266 |
#endif |
|
267 |
||
268 |
#if defined(Q_OS_DARWIN) |
|
269 |
# define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */ |
|
270 |
# define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/ |
|
271 |
# if defined(Q_OS_DARWIN64) |
|
272 |
# define Q_OS_MAC64 |
|
273 |
# elif defined(Q_OS_DARWIN32) |
|
274 |
# define Q_OS_MAC32 |
|
275 |
# endif |
|
276 |
#endif |
|
277 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
278 |
#ifdef QT_AUTODETECT_COCOA |
0 | 279 |
# ifdef Q_OS_MAC64 |
280 |
# define QT_MAC_USE_COCOA 1 |
|
281 |
# define QT_BUILD_KEY QT_BUILD_KEY_COCOA |
|
282 |
# else |
|
283 |
# define QT_BUILD_KEY QT_BUILD_KEY_CARBON |
|
284 |
# endif |
|
285 |
#endif |
|
286 |
||
287 |
#if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) |
|
288 |
#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration." |
|
289 |
#endif |
|
290 |
||
291 |
#if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) |
|
292 |
# undef Q_OS_UNIX |
|
293 |
#elif !defined(Q_OS_UNIX) |
|
294 |
# define Q_OS_UNIX |
|
295 |
#endif |
|
296 |
||
297 |
#if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT) |
|
298 |
# define QT_LARGEFILE_SUPPORT 64 |
|
299 |
#endif |
|
300 |
||
301 |
#ifdef Q_OS_DARWIN |
|
302 |
# ifdef MAC_OS_X_VERSION_MIN_REQUIRED |
|
303 |
# undef MAC_OS_X_VERSION_MIN_REQUIRED |
|
304 |
# endif |
|
305 |
# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 |
|
306 |
# include <AvailabilityMacros.h> |
|
307 |
# if !defined(MAC_OS_X_VERSION_10_3) |
|
308 |
# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1 |
|
309 |
# endif |
|
310 |
# if !defined(MAC_OS_X_VERSION_10_4) |
|
311 |
# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1 |
|
312 |
# endif |
|
313 |
# if !defined(MAC_OS_X_VERSION_10_5) |
|
314 |
# define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1 |
|
315 |
# endif |
|
316 |
# if !defined(MAC_OS_X_VERSION_10_6) |
|
317 |
# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1 |
|
318 |
# endif |
|
319 |
# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6) |
|
320 |
# warning "This version of Mac OS X is unsupported" |
|
321 |
# endif |
|
322 |
#endif |
|
323 |
||
324 |
#ifdef __LSB_VERSION__ |
|
325 |
# if __LSB_VERSION__ < 40 |
|
326 |
# error "This version of the Linux Standard Base is unsupported" |
|
327 |
# endif |
|
328 |
#ifndef QT_LINUXBASE |
|
329 |
# define QT_LINUXBASE |
|
330 |
#endif |
|
331 |
#endif |
|
332 |
||
333 |
/* |
|
334 |
The compiler, must be one of: (Q_CC_x) |
|
335 |
||
336 |
SYM - Digital Mars C/C++ (used to be Symantec C++) |
|
337 |
MWERKS - Metrowerks CodeWarrior |
|
338 |
MSVC - Microsoft Visual C/C++, Intel C++ for Windows |
|
339 |
BOR - Borland/Turbo C++ |
|
340 |
WAT - Watcom C++ |
|
341 |
GNU - GNU C++ |
|
342 |
COMEAU - Comeau C++ |
|
343 |
EDG - Edison Design Group C++ |
|
344 |
OC - CenterLine C++ |
|
345 |
SUN - Forte Developer, or Sun Studio C++ |
|
346 |
MIPS - MIPSpro C++ |
|
347 |
DEC - DEC C++ |
|
348 |
HPACC - HP aC++ |
|
349 |
USLC - SCO OUDK and UDK |
|
350 |
CDS - Reliant C++ |
|
351 |
KAI - KAI C++ |
|
352 |
INTEL - Intel C++ for Linux, Intel C++ for Windows |
|
353 |
HIGHC - MetaWare High C/C++ |
|
354 |
PGI - Portland Group C++ |
|
355 |
GHS - Green Hills Optimizing C++ Compilers |
|
356 |
GCCE - GCCE (Symbian GCCE builds) |
|
357 |
RVCT - ARM Realview Compiler Suite |
|
358 |
NOKIAX86 - Nokia x86 (Symbian WINSCW builds) |
|
359 |
||
360 |
||
361 |
Should be sorted most to least authoritative. |
|
362 |
*/ |
|
363 |
||
364 |
#if defined(__ghs) |
|
365 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
366 |
#endif |
|
367 |
||
368 |
/* Symantec C++ is now Digital Mars */ |
|
369 |
#if defined(__DMC__) || defined(__SC__) |
|
370 |
# define Q_CC_SYM |
|
371 |
/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */ |
|
372 |
# if defined(__SC__) && __SC__ < 0x750 |
|
373 |
# define Q_NO_EXPLICIT_KEYWORD |
|
374 |
# endif |
|
375 |
# define Q_NO_USING_KEYWORD |
|
376 |
||
377 |
#elif defined(__MWERKS__) |
|
378 |
# define Q_CC_MWERKS |
|
379 |
# if defined(__EMU_SYMBIAN_OS__) |
|
380 |
# define Q_CC_NOKIAX86 |
|
381 |
# endif |
|
382 |
/* "explicit" recognized since 4.0d1 */ |
|
383 |
||
384 |
#elif defined(_MSC_VER) |
|
385 |
# define Q_CC_MSVC |
|
386 |
/* proper support of bool for _MSC_VER >= 1100 */ |
|
387 |
# define Q_CANNOT_DELETE_CONSTANT |
|
388 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
389 |
# define Q_NO_TEMPLATE_FRIENDS |
|
390 |
# define QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION |
|
391 |
# define Q_ALIGNOF(type) __alignof(type) |
|
392 |
# define Q_DECL_ALIGN(n) __declspec(align(n)) |
|
393 |
||
394 |
/* Visual C++.Net issues for _MSC_VER >= 1300 */ |
|
395 |
# if _MSC_VER >= 1300 |
|
396 |
# define Q_CC_MSVC_NET |
|
397 |
# if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64)) |
|
398 |
# define Q_TYPENAME |
|
399 |
# else |
|
400 |
# undef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION |
|
401 |
# endif |
|
402 |
# else |
|
403 |
# define Q_NO_USING_KEYWORD |
|
404 |
# define QT_NO_MEMBER_TEMPLATES |
|
405 |
# endif |
|
406 |
# if _MSC_VER < 1310 |
|
407 |
# define QT_NO_QOBJECT_CHECK |
|
408 |
# define Q_TYPENAME |
|
409 |
# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS |
|
410 |
# endif |
|
411 |
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ |
|
412 |
# if defined(__INTEL_COMPILER) |
|
413 |
# define Q_CC_INTEL |
|
414 |
# endif |
|
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
415 |
/* MSVC does not support SSE/MMX on x64 */ |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
416 |
# if (defined(Q_CC_MSVC) && defined(_M_X64)) |
0 | 417 |
# undef QT_HAVE_SSE |
418 |
# undef QT_HAVE_MMX |
|
419 |
# undef QT_HAVE_3DNOW |
|
420 |
# endif |
|
421 |
||
422 |
#elif defined(__BORLANDC__) || defined(__TURBOC__) |
|
423 |
# define Q_CC_BOR |
|
424 |
# define Q_INLINE_TEMPLATE |
|
425 |
# if __BORLANDC__ < 0x502 |
|
426 |
# define Q_NO_BOOL_TYPE |
|
427 |
# define Q_NO_EXPLICIT_KEYWORD |
|
428 |
# endif |
|
429 |
# define Q_NO_USING_KEYWORD |
|
430 |
||
431 |
#elif defined(__WATCOMC__) |
|
432 |
# define Q_CC_WAT |
|
433 |
||
434 |
/* Symbian GCCE */ |
|
435 |
#elif defined(__GCCE__) |
|
436 |
# define Q_CC_GCCE |
|
437 |
# define QT_VISIBILITY_AVAILABLE |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
438 |
# if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
439 |
# define QT_HAVE_ARMV6 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
# endif |
0 | 441 |
|
442 |
/* ARM Realview Compiler Suite |
|
443 |
RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given), |
|
444 |
so check for it before that */ |
|
445 |
#elif defined(__ARMCC__) || defined(__CC_ARM) |
|
446 |
# define Q_CC_RVCT |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
447 |
# if __TARGET_ARCH_ARM >= 6 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
448 |
# define QT_HAVE_ARMV6 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
449 |
# endif |
0 | 450 |
#elif defined(__GNUC__) |
451 |
# define Q_CC_GNU |
|
452 |
# define Q_C_CALLBACKS |
|
453 |
# if defined(__MINGW32__) |
|
454 |
# define Q_CC_MINGW |
|
455 |
# endif |
|
456 |
# if defined(__INTEL_COMPILER) |
|
457 |
/* Intel C++ also masquerades as GCC 3.2.0 */ |
|
458 |
# define Q_CC_INTEL |
|
459 |
# define Q_NO_TEMPLATE_FRIENDS |
|
460 |
# endif |
|
461 |
# ifdef __APPLE__ |
|
462 |
# define Q_NO_DEPRECATED_CONSTRUCTORS |
|
463 |
# endif |
|
464 |
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 |
|
465 |
# define Q_FULL_TEMPLATE_INSTANTIATION |
|
466 |
# endif |
|
467 |
/* GCC 2.95 knows "using" but does not support it correctly */ |
|
468 |
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 |
|
469 |
# define Q_NO_USING_KEYWORD |
|
470 |
# define QT_NO_STL_WCHAR |
|
471 |
# endif |
|
472 |
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) |
|
473 |
# define Q_ALIGNOF(type) __alignof__(type) |
|
474 |
# define Q_TYPEOF(expr) __typeof__(expr) |
|
475 |
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) |
|
476 |
# endif |
|
477 |
/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ |
|
478 |
# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 |
|
479 |
# define Q_WRONG_SB_CTYPE_MACROS |
|
480 |
# endif |
|
481 |
/* GCC <= 3.3 cannot handle template friends */ |
|
482 |
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) |
|
483 |
# define Q_NO_TEMPLATE_FRIENDS |
|
484 |
# endif |
|
485 |
/* Apple's GCC 3.1 chokes on our streaming qDebug() */ |
|
486 |
# if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3) |
|
487 |
# define Q_BROKEN_DEBUG_STREAM |
|
488 |
# endif |
|
489 |
# if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP) |
|
490 |
# define Q_PACKED __attribute__ ((__packed__)) |
|
491 |
# define Q_NO_PACKED_REFERENCE |
|
492 |
# ifndef __ARM_EABI__ |
|
493 |
# define QT_NO_ARM_EABI |
|
494 |
# endif |
|
495 |
# endif |
|
496 |
||
497 |
/* IBM compiler versions are a bit messy. There are actually two products: |
|
498 |
the C product, and the C++ product. The C++ compiler is always packaged |
|
499 |
with the latest version of the C compiler. Version numbers do not always |
|
500 |
match. This little table (I'm not sure it's accurate) should be helpful: |
|
501 |
||
502 |
C++ product C product |
|
503 |
||
504 |
C Set 3.1 C Compiler 3.0 |
|
505 |
... ... |
|
506 |
C++ Compiler 3.6.6 C Compiler 4.3 |
|
507 |
... ... |
|
508 |
Visual Age C++ 4.0 ... |
|
509 |
... ... |
|
510 |
Visual Age C++ 5.0 C Compiler 5.0 |
|
511 |
... ... |
|
512 |
Visual Age C++ 6.0 C Compiler 6.0 |
|
513 |
||
514 |
Now: |
|
515 |
__xlC__ is the version of the C compiler in hexadecimal notation |
|
516 |
is only an approximation of the C++ compiler version |
|
517 |
__IBMCPP__ is the version of the C++ compiler in decimal notation |
|
518 |
but it is not defined on older compilers like C Set 3.1 */ |
|
519 |
#elif defined(__xlC__) |
|
520 |
# define Q_CC_XLC |
|
521 |
# define Q_FULL_TEMPLATE_INSTANTIATION |
|
522 |
# if __xlC__ < 0x400 |
|
523 |
# define Q_NO_BOOL_TYPE |
|
524 |
# define Q_NO_EXPLICIT_KEYWORD |
|
525 |
# define Q_NO_USING_KEYWORD |
|
526 |
# define Q_TYPENAME |
|
527 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
528 |
# define Q_BROKEN_TEMPLATE_SPECIALIZATION |
|
529 |
# define Q_CANNOT_DELETE_CONSTANT |
|
530 |
# elif __xlC__ >= 0x0600 |
|
531 |
# define Q_ALIGNOF(type) __alignof__(type) |
|
532 |
# define Q_TYPEOF(expr) __typeof__(expr) |
|
533 |
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) |
|
534 |
# define Q_PACKED __attribute__((__packed__)) |
|
535 |
# endif |
|
536 |
||
537 |
/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed |
|
538 |
on DEC C++ V5.5-004. New versions do define __EDG__ - observed on |
|
539 |
Compaq C++ V6.3-002. |
|
540 |
This compiler is different enough from other EDG compilers to handle |
|
541 |
it separately anyway. */ |
|
542 |
#elif defined(__DECCXX) || defined(__DECC) |
|
543 |
# define Q_CC_DEC |
|
544 |
/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older |
|
545 |
DEC C++ V5 compilers. */ |
|
546 |
# if defined(__EDG__) |
|
547 |
# define Q_CC_EDG |
|
548 |
# endif |
|
549 |
/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead |
|
550 |
- observed on Compaq C++ V6.3-002. |
|
551 |
In any case versions prior to Compaq C++ V6.0-005 do not have bool. */ |
|
552 |
# if !defined(_BOOL_EXISTS) |
|
553 |
# define Q_NO_BOOL_TYPE |
|
554 |
# endif |
|
555 |
/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */ |
|
556 |
# define Q_NO_USING_KEYWORD |
|
557 |
/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on |
|
558 |
DEC C++ V5.5-004. */ |
|
559 |
# if __DECCXX_VER < 60060000 |
|
560 |
# define Q_TYPENAME |
|
561 |
# define Q_BROKEN_TEMPLATE_SPECIALIZATION |
|
562 |
# define Q_CANNOT_DELETE_CONSTANT |
|
563 |
# endif |
|
564 |
/* avoid undefined symbol problems with out-of-line template members */ |
|
565 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
566 |
||
567 |
/* The Portland Group C++ compiler is based on EDG and does define __EDG__ |
|
568 |
but the C compiler does not */ |
|
569 |
#elif defined(__PGI) |
|
570 |
# define Q_CC_PGI |
|
571 |
# if defined(__EDG__) |
|
572 |
# define Q_CC_EDG |
|
573 |
# endif |
|
574 |
||
575 |
/* Compilers with EDG front end are similar. To detect them we test: |
|
576 |
__EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b |
|
577 |
__EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 |
|
578 |
and PGI C++ 5.2-4 */ |
|
579 |
#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__)) |
|
580 |
# define Q_CC_EDG |
|
581 |
/* From the EDG documentation (does not seem to apply to Compaq C++): |
|
582 |
_BOOL |
|
583 |
Defined in C++ mode when bool is a keyword. The name of this |
|
584 |
predefined macro is specified by a configuration flag. _BOOL |
|
585 |
is the default. |
|
586 |
__BOOL_DEFINED |
|
587 |
Defined in Microsoft C++ mode when bool is a keyword. */ |
|
588 |
# if !defined(_BOOL) && !defined(__BOOL_DEFINED) |
|
589 |
# define Q_NO_BOOL_TYPE |
|
590 |
# endif |
|
591 |
||
592 |
/* The Comeau compiler is based on EDG and does define __EDG__ */ |
|
593 |
# if defined(__COMO__) |
|
594 |
# define Q_CC_COMEAU |
|
595 |
# define Q_C_CALLBACKS |
|
596 |
||
597 |
/* The `using' keyword was introduced to avoid KAI C++ warnings |
|
598 |
but it's now causing KAI C++ errors instead. The standard is |
|
599 |
unclear about the use of this keyword, and in practice every |
|
600 |
compiler is using its own set of rules. Forget it. */ |
|
601 |
# elif defined(__KCC) |
|
602 |
# define Q_CC_KAI |
|
603 |
# define Q_NO_USING_KEYWORD |
|
604 |
||
605 |
/* Using the `using' keyword avoids Intel C++ for Linux warnings */ |
|
606 |
# elif defined(__INTEL_COMPILER) |
|
607 |
# define Q_CC_INTEL |
|
608 |
||
609 |
/* Uses CFront, make sure to read the manual how to tweak templates. */ |
|
610 |
# elif defined(__ghs) |
|
611 |
# define Q_CC_GHS |
|
612 |
||
613 |
# elif defined(__DCC__) |
|
614 |
# define Q_CC_DIAB |
|
615 |
# undef Q_NO_BOOL_TYPE |
|
616 |
# if !defined(__bool) |
|
617 |
# define Q_NO_BOOL_TYPE |
|
618 |
# endif |
|
619 |
||
620 |
/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */ |
|
621 |
# elif defined(__USLC__) && defined(__SCO_VERSION__) |
|
622 |
# define Q_CC_USLC |
|
623 |
/* The latest UDK 7.1.1b does not need this, but previous versions do */ |
|
624 |
# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010) |
|
625 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
626 |
# endif |
|
627 |
# define Q_NO_USING_KEYWORD /* ### check "using" status */ |
|
628 |
||
629 |
/* Never tested! */ |
|
630 |
# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER) |
|
631 |
# define Q_CC_OC |
|
632 |
# define Q_NO_USING_KEYWORD |
|
633 |
||
634 |
/* CDS++ defines __EDG__ although this is not documented in the Reliant |
|
635 |
documentation. It also follows conventions like _BOOL and this documented */ |
|
636 |
# elif defined(sinix) |
|
637 |
# define Q_CC_CDS |
|
638 |
# define Q_NO_USING_KEYWORD |
|
639 |
||
640 |
/* The MIPSpro compiler defines __EDG */ |
|
641 |
# elif defined(__sgi) |
|
642 |
# define Q_CC_MIPS |
|
643 |
# define Q_NO_USING_KEYWORD /* ### check "using" status */ |
|
644 |
# define Q_NO_TEMPLATE_FRIENDS |
|
645 |
# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) |
|
646 |
# define Q_OUTOFLINE_TEMPLATE inline |
|
647 |
# pragma set woff 3624,3625,3649 /* turn off some harmless warnings */ |
|
648 |
# endif |
|
649 |
# endif |
|
650 |
||
651 |
/* VxWorks' DIAB toolchain has an additional EDG type C++ compiler |
|
652 |
(see __DCC__ above). This one is for C mode files (__EDG is not defined) */ |
|
653 |
#elif defined(_DIAB_TOOL) |
|
654 |
# define Q_CC_DIAB |
|
655 |
||
656 |
/* Never tested! */ |
|
657 |
#elif defined(__HIGHC__) |
|
658 |
# define Q_CC_HIGHC |
|
659 |
||
660 |
#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) |
|
661 |
# define Q_CC_SUN |
|
662 |
/* 5.0 compiler or better |
|
663 |
'bool' is enabled by default but can be disabled using -features=nobool |
|
664 |
in which case _BOOL is not defined |
|
665 |
this is the default in 4.2 compatibility mode triggered by -compat=4 */ |
|
666 |
# if __SUNPRO_CC >= 0x500 |
|
667 |
# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS |
|
668 |
/* see http://developers.sun.com/sunstudio/support/Ccompare.html */ |
|
669 |
# if __SUNPRO_CC >= 0x590 |
|
670 |
# define Q_ALIGNOF(type) __alignof__(type) |
|
671 |
# define Q_TYPEOF(expr) __typeof__(expr) |
|
672 |
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
673 |
# endif |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
674 |
# if __SUNPRO_CC >= 0x550 |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
675 |
# define Q_DECL_EXPORT __global |
0 | 676 |
# endif |
677 |
# if __SUNPRO_CC < 0x5a0 |
|
678 |
# define Q_NO_TEMPLATE_FRIENDS |
|
679 |
# endif |
|
680 |
# if !defined(_BOOL) |
|
681 |
# define Q_NO_BOOL_TYPE |
|
682 |
# endif |
|
683 |
# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4) |
|
684 |
# define Q_NO_USING_KEYWORD |
|
685 |
# endif |
|
686 |
# define Q_C_CALLBACKS |
|
687 |
/* 4.2 compiler or older */ |
|
688 |
# else |
|
689 |
# define Q_NO_BOOL_TYPE |
|
690 |
# define Q_NO_EXPLICIT_KEYWORD |
|
691 |
# define Q_NO_USING_KEYWORD |
|
692 |
# endif |
|
693 |
||
694 |
/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant |
|
695 |
documentation but nevertheless uses EDG conventions like _BOOL */ |
|
696 |
#elif defined(sinix) |
|
697 |
# define Q_CC_EDG |
|
698 |
# define Q_CC_CDS |
|
699 |
# if !defined(_BOOL) |
|
700 |
# define Q_NO_BOOL_TYPE |
|
701 |
# endif |
|
702 |
# define Q_BROKEN_TEMPLATE_SPECIALIZATION |
|
703 |
||
704 |
#elif defined(Q_OS_HPUX) |
|
705 |
/* __HP_aCC was not defined in first aCC releases */ |
|
706 |
# if defined(__HP_aCC) || __cplusplus >= 199707L |
|
707 |
# define Q_NO_TEMPLATE_FRIENDS |
|
708 |
# define Q_CC_HPACC |
|
709 |
# if __HP_aCC-0 < 060000 |
|
710 |
# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS |
|
711 |
# define Q_DECL_EXPORT __declspec(dllexport) |
|
712 |
# define Q_DECL_IMPORT __declspec(dllimport) |
|
713 |
# endif |
|
714 |
# if __HP_aCC-0 >= 061200 |
|
715 |
# define Q_DECL_ALIGNED(n) __attribute__((aligned(n))) |
|
716 |
# endif |
|
717 |
# if __HP_aCC-0 >= 062000 |
|
718 |
# define Q_DECL_EXPORT __attribute__((visibility("default"))) |
|
719 |
# define Q_DECL_IMPORT Q_DECL_EXPORT |
|
720 |
# endif |
|
721 |
# else |
|
722 |
# define Q_CC_HP |
|
723 |
# define Q_NO_BOOL_TYPE |
|
724 |
# define Q_FULL_TEMPLATE_INSTANTIATION |
|
725 |
# define Q_BROKEN_TEMPLATE_SPECIALIZATION |
|
726 |
# define Q_NO_EXPLICIT_KEYWORD |
|
727 |
# endif |
|
728 |
# define Q_NO_USING_KEYWORD /* ### check "using" status */ |
|
729 |
||
730 |
#elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86) |
|
731 |
# define Q_CC_NOKIAX86 |
|
732 |
||
733 |
||
734 |
#else |
|
735 |
# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" |
|
736 |
#endif |
|
737 |
||
738 |
#ifndef Q_PACKED |
|
739 |
# define Q_PACKED |
|
740 |
# undef Q_NO_PACKED_REFERENCE |
|
741 |
#endif |
|
742 |
||
743 |
#ifndef Q_CONSTRUCTOR_FUNCTION |
|
744 |
# define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \ |
|
745 |
static const int AFUNC ## __init_variable__ = AFUNC(); |
|
746 |
# define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC) |
|
747 |
#endif |
|
748 |
||
749 |
#ifndef Q_DESTRUCTOR_FUNCTION |
|
750 |
# define Q_DESTRUCTOR_FUNCTION0(AFUNC) \ |
|
751 |
class AFUNC ## __dest_class__ { \ |
|
752 |
public: \ |
|
753 |
inline AFUNC ## __dest_class__() { } \ |
|
754 |
inline ~ AFUNC ## __dest_class__() { AFUNC(); } \ |
|
755 |
} AFUNC ## __dest_instance__; |
|
756 |
# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC) |
|
757 |
#endif |
|
758 |
||
759 |
#ifndef Q_REQUIRED_RESULT |
|
760 |
# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) |
|
761 |
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) |
|
762 |
# else |
|
763 |
# define Q_REQUIRED_RESULT |
|
764 |
# endif |
|
765 |
#endif |
|
766 |
||
767 |
#ifndef Q_COMPILER_MANGLES_RETURN_TYPE |
|
768 |
# if defined(Q_CC_MSVC) |
|
769 |
# define Q_COMPILER_MANGLES_RETURN_TYPE |
|
770 |
# endif |
|
771 |
#endif |
|
772 |
||
773 |
/* |
|
774 |
The window system, must be one of: (Q_WS_x) |
|
775 |
||
776 |
MACX - Mac OS X |
|
777 |
MAC9 - Mac OS 9 |
|
778 |
QWS - Qt for Embedded Linux |
|
779 |
WIN32 - Windows |
|
780 |
X11 - X Window System |
|
781 |
S60 - Symbian S60 |
|
782 |
PM - unsupported |
|
783 |
WIN16 - unsupported |
|
784 |
*/ |
|
785 |
||
786 |
#if defined(Q_OS_MSDOS) |
|
787 |
# define Q_WS_WIN16 |
|
788 |
# error "Qt requires Win32 and does not work with Windows 3.x" |
|
789 |
#elif defined(_WIN32_X11_) |
|
790 |
# define Q_WS_X11 |
|
791 |
#elif defined(Q_OS_WIN32) |
|
792 |
# define Q_WS_WIN32 |
|
793 |
# if defined(Q_OS_WIN64) |
|
794 |
# define Q_WS_WIN64 |
|
795 |
# endif |
|
796 |
#elif defined(Q_OS_WINCE) |
|
797 |
# define Q_WS_WIN32 |
|
798 |
# define Q_WS_WINCE |
|
799 |
# if defined(Q_OS_WINCE_WM) |
|
800 |
# define Q_WS_WINCE_WM |
|
801 |
# endif |
|
802 |
#elif defined(Q_OS_OS2) |
|
803 |
# define Q_WS_PM |
|
804 |
# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell" |
|
805 |
#elif defined(Q_OS_UNIX) |
|
806 |
# if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS) |
|
807 |
# define Q_WS_MAC |
|
808 |
# define Q_WS_MACX |
|
809 |
# if defined(Q_OS_MAC64) |
|
810 |
# define Q_WS_MAC64 |
|
811 |
# elif defined(Q_OS_MAC32) |
|
812 |
# define Q_WS_MAC32 |
|
813 |
# endif |
|
814 |
# elif defined(Q_OS_SYMBIAN) |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
815 |
# if !defined(QT_NO_S60) |
0 | 816 |
# define Q_WS_S60 |
817 |
# endif |
|
818 |
# elif !defined(Q_WS_QWS) |
|
819 |
# define Q_WS_X11 |
|
820 |
# endif |
|
821 |
#endif |
|
822 |
||
823 |
#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE) |
|
824 |
# define Q_WS_WIN |
|
825 |
#endif |
|
826 |
||
827 |
QT_BEGIN_HEADER |
|
828 |
QT_BEGIN_NAMESPACE |
|
829 |
||
830 |
/* |
|
831 |
Size-dependent types (architechture-dependent byte order) |
|
832 |
||
833 |
Make sure to update QMetaType when changing these typedefs |
|
834 |
*/ |
|
835 |
||
836 |
typedef signed char qint8; /* 8 bit signed */ |
|
837 |
typedef unsigned char quint8; /* 8 bit unsigned */ |
|
838 |
typedef short qint16; /* 16 bit signed */ |
|
839 |
typedef unsigned short quint16; /* 16 bit unsigned */ |
|
840 |
typedef int qint32; /* 32 bit signed */ |
|
841 |
typedef unsigned int quint32; /* 32 bit unsigned */ |
|
842 |
#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS) |
|
843 |
# define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */ |
|
844 |
# define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */ |
|
845 |
typedef __int64 qint64; /* 64 bit signed */ |
|
846 |
typedef unsigned __int64 quint64; /* 64 bit unsigned */ |
|
847 |
#else |
|
848 |
# define Q_INT64_C(c) static_cast<long long>(c ## LL) /* signed 64 bit constant */ |
|
849 |
# define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */ |
|
850 |
typedef long long qint64; /* 64 bit signed */ |
|
851 |
typedef unsigned long long quint64; /* 64 bit unsigned */ |
|
852 |
#endif |
|
853 |
||
854 |
typedef qint64 qlonglong; |
|
855 |
typedef quint64 qulonglong; |
|
856 |
||
857 |
#ifndef QT_POINTER_SIZE |
|
858 |
# if defined(Q_OS_WIN64) |
|
859 |
# define QT_POINTER_SIZE 8 |
|
860 |
# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) |
|
861 |
# define QT_POINTER_SIZE 4 |
|
862 |
# endif |
|
863 |
#endif |
|
864 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
865 |
#define Q_INIT_RESOURCE_EXTERN(name) \ |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
866 |
extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
867 |
|
0 | 868 |
#define Q_INIT_RESOURCE(name) \ |
869 |
do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \ |
|
870 |
QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0) |
|
871 |
#define Q_CLEANUP_RESOURCE(name) \ |
|
872 |
do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \ |
|
873 |
QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0) |
|
874 |
||
875 |
#if defined(__cplusplus) |
|
876 |
||
877 |
/* |
|
878 |
quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e. |
|
879 |
||
880 |
sizeof(void *) == sizeof(quintptr) |
|
881 |
&& sizeof(void *) == sizeof(qptrdiff) |
|
882 |
*/ |
|
883 |
template <int> struct QIntegerForSize; |
|
884 |
template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; }; |
|
885 |
template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; }; |
|
886 |
template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; }; |
|
887 |
template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; }; |
|
888 |
template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { }; |
|
889 |
typedef QIntegerForSizeof<void*>::Unsigned quintptr; |
|
890 |
typedef QIntegerForSizeof<void*>::Signed qptrdiff; |
|
891 |
||
892 |
/* |
|
893 |
Useful type definitions for Qt |
|
894 |
*/ |
|
895 |
||
896 |
QT_BEGIN_INCLUDE_NAMESPACE |
|
897 |
typedef unsigned char uchar; |
|
898 |
typedef unsigned short ushort; |
|
899 |
typedef unsigned int uint; |
|
900 |
typedef unsigned long ulong; |
|
901 |
QT_END_INCLUDE_NAMESPACE |
|
902 |
||
903 |
#if defined(Q_NO_BOOL_TYPE) |
|
904 |
#error "Compiler doesn't support the bool type" |
|
905 |
#endif |
|
906 |
||
907 |
/* |
|
908 |
Constant bool values |
|
909 |
*/ |
|
910 |
||
911 |
#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */ |
|
912 |
/* Symbian OS defines TRUE = 1 and FALSE = 0, |
|
913 |
redefine to built-in booleans to make autotests work properly */ |
|
914 |
#ifdef Q_OS_SYMBIAN |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
915 |
#include <e32def.h> /* Symbian OS defines */ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
916 |
|
0 | 917 |
#undef TRUE |
918 |
#undef FALSE |
|
919 |
#endif |
|
920 |
# ifndef TRUE |
|
921 |
# define TRUE true |
|
922 |
# define FALSE false |
|
923 |
# endif |
|
924 |
#endif |
|
925 |
||
926 |
/* |
|
927 |
Proper for-scoping in VC++6 and MIPSpro CC |
|
928 |
*/ |
|
929 |
#ifndef QT_NO_KEYWORDS |
|
930 |
# if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64)) |
|
931 |
# define for if(0){}else for |
|
932 |
# endif |
|
933 |
#endif |
|
934 |
||
935 |
/* |
|
936 |
Workaround for static const members on MSVC++. |
|
937 |
*/ |
|
938 |
||
939 |
#if defined(Q_CC_MSVC) |
|
940 |
# define QT_STATIC_CONST static |
|
941 |
# define QT_STATIC_CONST_IMPL |
|
942 |
#else |
|
943 |
# define QT_STATIC_CONST static const |
|
944 |
# define QT_STATIC_CONST_IMPL const |
|
945 |
#endif |
|
946 |
||
947 |
/* |
|
948 |
Warnings and errors when using deprecated methods |
|
949 |
*/ |
|
950 |
#if defined(Q_MOC_RUN) |
|
951 |
# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED |
|
952 |
#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) |
|
953 |
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__)) |
|
954 |
#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300) |
|
955 |
# define Q_DECL_DEPRECATED __declspec(deprecated) |
|
956 |
# if defined (Q_CC_INTEL) |
|
957 |
# define Q_DECL_VARIABLE_DEPRECATED |
|
958 |
# else |
|
959 |
# endif |
|
960 |
#else |
|
961 |
# define Q_DECL_DEPRECATED |
|
962 |
#endif |
|
963 |
#ifndef Q_DECL_VARIABLE_DEPRECATED |
|
964 |
# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED |
|
965 |
#endif |
|
966 |
#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED |
|
967 |
# if defined(Q_MOC_RUN) |
|
968 |
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED |
|
969 |
# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS) |
|
970 |
# define Q_DECL_CONSTRUCTOR_DEPRECATED |
|
971 |
# else |
|
972 |
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED |
|
973 |
# endif |
|
974 |
#endif |
|
975 |
||
976 |
#if defined(QT_NO_DEPRECATED) |
|
977 |
/* disable Qt3 support as well */ |
|
978 |
# undef QT3_SUPPORT_WARNINGS |
|
979 |
# undef QT3_SUPPORT |
|
980 |
# undef QT_DEPRECATED |
|
981 |
# undef QT_DEPRECATED_VARIABLE |
|
982 |
# undef QT_DEPRECATED_CONSTRUCTOR |
|
983 |
#elif defined(QT_DEPRECATED_WARNINGS) |
|
37
758a864f9613
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
984 |
# ifdef QT3_SUPPORT |
0 | 985 |
/* enable Qt3 support warnings as well */ |
37
758a864f9613
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
986 |
# undef QT3_SUPPORT_WARNINGS |
758a864f9613
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
987 |
# define QT3_SUPPORT_WARNINGS |
758a864f9613
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
988 |
# endif |
0 | 989 |
# undef QT_DEPRECATED |
990 |
# define QT_DEPRECATED Q_DECL_DEPRECATED |
|
991 |
# undef QT_DEPRECATED_VARIABLE |
|
992 |
# define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED |
|
993 |
# undef QT_DEPRECATED_CONSTRUCTOR |
|
994 |
# define QT_DEPRECATED_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED |
|
995 |
#else |
|
996 |
# undef QT_DEPRECATED |
|
997 |
# define QT_DEPRECATED |
|
998 |
# undef QT_DEPRECATED_VARIABLE |
|
999 |
# define QT_DEPRECATED_VARIABLE |
|
1000 |
# undef QT_DEPRECATED_CONSTRUCTOR |
|
1001 |
# define QT_DEPRECATED_CONSTRUCTOR |
|
1002 |
#endif |
|
1003 |
||
1004 |
#if defined(QT3_SUPPORT_WARNINGS) |
|
1005 |
# if !defined(QT_COMPAT_WARNINGS) /* also enable compat */ |
|
1006 |
# define QT_COMPAT_WARNINGS |
|
1007 |
# endif |
|
1008 |
# undef QT3_SUPPORT |
|
1009 |
# define QT3_SUPPORT Q_DECL_DEPRECATED |
|
1010 |
# undef QT3_SUPPORT_VARIABLE |
|
1011 |
# define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED |
|
1012 |
# undef QT3_SUPPORT_CONSTRUCTOR |
|
1013 |
# define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED |
|
1014 |
#elif defined(QT3_SUPPORT) /* define back to nothing */ |
|
1015 |
# if !defined(QT_COMPAT) /* also enable qt3 support */ |
|
1016 |
# define QT_COMPAT |
|
1017 |
# endif |
|
1018 |
# undef QT3_SUPPORT |
|
1019 |
# define QT3_SUPPORT |
|
1020 |
# undef QT3_SUPPORT_VARIABLE |
|
1021 |
# define QT3_SUPPORT_VARIABLE |
|
1022 |
# undef QT3_SUPPORT_CONSTRUCTOR |
|
1023 |
# define QT3_SUPPORT_CONSTRUCTOR explicit |
|
1024 |
#endif |
|
1025 |
||
1026 |
/* moc compats (signals/slots) */ |
|
1027 |
#ifndef QT_MOC_COMPAT |
|
1028 |
# if defined(QT3_SUPPORT) |
|
1029 |
# define QT_MOC_COMPAT QT3_SUPPORT |
|
1030 |
# else |
|
1031 |
# define QT_MOC_COMPAT |
|
1032 |
# endif |
|
1033 |
#else |
|
1034 |
# undef QT_MOC_COMPAT |
|
1035 |
# define QT_MOC_COMPAT |
|
1036 |
#endif |
|
1037 |
||
1038 |
#ifdef QT_ASCII_CAST_WARNINGS |
|
1039 |
# define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED |
|
1040 |
# if defined(Q_CC_GNU) && __GNUC__ < 4 |
|
1041 |
/* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */ |
|
1042 |
# define QT_ASCII_CAST_WARN_CONSTRUCTOR |
|
1043 |
# else |
|
1044 |
# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED |
|
1045 |
# endif |
|
1046 |
#else |
|
1047 |
# define QT_ASCII_CAST_WARN |
|
1048 |
# define QT_ASCII_CAST_WARN_CONSTRUCTOR |
|
1049 |
#endif |
|
1050 |
||
1051 |
#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE) |
|
1052 |
# if defined(Q_CC_GNU) |
|
1053 |
#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332) |
|
1054 |
# define QT_FASTCALL __attribute__((regparm(3))) |
|
1055 |
#else |
|
1056 |
# define QT_FASTCALL |
|
1057 |
#endif |
|
1058 |
# elif defined(Q_CC_MSVC) && (_MSC_VER > 1300 || defined(Q_CC_INTEL)) |
|
1059 |
# define QT_FASTCALL __fastcall |
|
1060 |
# else |
|
1061 |
# define QT_FASTCALL |
|
1062 |
# endif |
|
1063 |
#else |
|
1064 |
# define QT_FASTCALL |
|
1065 |
#endif |
|
1066 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1067 |
//defines the type for the WNDPROC on windows |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1068 |
//the alignment needs to be forced for sse2 to not crash with mingw |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1069 |
#if defined(Q_WS_WIN) |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1070 |
# if defined(Q_CC_MINGW) |
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1071 |
# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer)) |
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1072 |
# else |
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1073 |
# define QT_ENSURE_STACK_ALIGNED_FOR_SSE |
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1074 |
# endif |
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1075 |
# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE |
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1076 |
#endif |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1077 |
|
0 | 1078 |
typedef int QNoImplicitBoolCast; |
1079 |
||
1080 |
#if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A) |
|
1081 |
#define QT_NO_FPU |
|
1082 |
#endif |
|
1083 |
||
1084 |
// This logic must match the one in qmetatype.h |
|
1085 |
#if defined(QT_COORD_TYPE) |
|
1086 |
typedef QT_COORD_TYPE qreal; |
|
1087 |
#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) |
|
1088 |
typedef float qreal; |
|
1089 |
#else |
|
1090 |
typedef double qreal; |
|
1091 |
#endif |
|
1092 |
||
1093 |
/* |
|
1094 |
Utility macros and inline functions |
|
1095 |
*/ |
|
1096 |
||
1097 |
template <typename T> |
|
1098 |
inline T qAbs(const T &t) { return t >= 0 ? t : -t; } |
|
1099 |
||
1100 |
inline int qRound(qreal d) |
|
1101 |
{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); } |
|
1102 |
||
1103 |
#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) |
|
1104 |
inline qint64 qRound64(double d) |
|
1105 |
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); } |
|
1106 |
#else |
|
1107 |
inline qint64 qRound64(qreal d) |
|
1108 |
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); } |
|
1109 |
#endif |
|
1110 |
||
1111 |
template <typename T> |
|
1112 |
inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; } |
|
1113 |
template <typename T> |
|
1114 |
inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; } |
|
1115 |
template <typename T> |
|
1116 |
inline const T &qBound(const T &min, const T &val, const T &max) |
|
1117 |
{ return qMax(min, qMin(max, val)); } |
|
1118 |
||
1119 |
#ifdef QT3_SUPPORT |
|
1120 |
typedef qint8 Q_INT8; |
|
1121 |
typedef quint8 Q_UINT8; |
|
1122 |
typedef qint16 Q_INT16; |
|
1123 |
typedef quint16 Q_UINT16; |
|
1124 |
typedef qint32 Q_INT32; |
|
1125 |
typedef quint32 Q_UINT32; |
|
1126 |
typedef qint64 Q_INT64; |
|
1127 |
typedef quint64 Q_UINT64; |
|
1128 |
||
1129 |
typedef qint64 Q_LLONG; |
|
1130 |
typedef quint64 Q_ULLONG; |
|
1131 |
#if defined(Q_OS_WIN64) |
|
1132 |
typedef __int64 Q_LONG; /* word up to 64 bit signed */ |
|
1133 |
typedef unsigned __int64 Q_ULONG; /* word up to 64 bit unsigned */ |
|
1134 |
#else |
|
1135 |
typedef long Q_LONG; /* word up to 64 bit signed */ |
|
1136 |
typedef unsigned long Q_ULONG; /* word up to 64 bit unsigned */ |
|
1137 |
#endif |
|
1138 |
||
1139 |
# define QABS(a) qAbs(a) |
|
1140 |
# define QMAX(a, b) qMax((a), (b)) |
|
1141 |
# define QMIN(a, b) qMin((a), (b)) |
|
1142 |
#endif |
|
1143 |
||
1144 |
/* |
|
1145 |
Data stream functions are provided by many classes (defined in qdatastream.h) |
|
1146 |
*/ |
|
1147 |
||
1148 |
class QDataStream; |
|
1149 |
||
1150 |
#ifndef QT_BUILD_KEY |
|
1151 |
#define QT_BUILD_KEY "unspecified" |
|
1152 |
#endif |
|
1153 |
||
1154 |
#if defined(Q_WS_MAC) |
|
1155 |
# ifndef QMAC_QMENUBAR_NO_EVENT |
|
1156 |
# define QMAC_QMENUBAR_NO_EVENT |
|
1157 |
# endif |
|
1158 |
#endif |
|
1159 |
||
1160 |
#if !defined(Q_WS_QWS) && !defined(QT_NO_COP) |
|
1161 |
# define QT_NO_COP |
|
1162 |
#endif |
|
1163 |
||
1164 |
#if defined(Q_OS_VXWORKS) |
|
1165 |
# define QT_NO_CRASHHANDLER // no popen |
|
1166 |
# define QT_NO_PROCESS // no exec*, no fork |
|
1167 |
# define QT_NO_LPR |
|
1168 |
# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end... |
|
1169 |
# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space |
|
1170 |
# define QT_NO_QWS_MULTIPROCESS // no processes |
|
1171 |
#endif |
|
1172 |
||
1173 |
# include <QtCore/qfeatures.h> |
|
1174 |
||
1175 |
#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) |
|
1176 |
||
1177 |
#ifndef Q_DECL_EXPORT |
|
1178 |
# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) |
|
1179 |
# define Q_DECL_EXPORT __declspec(dllexport) |
|
1180 |
# elif defined(QT_VISIBILITY_AVAILABLE) |
|
1181 |
# define Q_DECL_EXPORT __attribute__((visibility("default"))) |
|
1182 |
# endif |
|
1183 |
# ifndef Q_DECL_EXPORT |
|
1184 |
# define Q_DECL_EXPORT |
|
1185 |
# endif |
|
1186 |
#endif |
|
1187 |
#ifndef Q_DECL_IMPORT |
|
1188 |
# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) |
|
1189 |
# define Q_DECL_IMPORT __declspec(dllimport) |
|
1190 |
# else |
|
1191 |
# define Q_DECL_IMPORT |
|
1192 |
# endif |
|
1193 |
#endif |
|
1194 |
||
1195 |
/* |
|
1196 |
Create Qt DLL if QT_DLL is defined (Windows and Symbian only) |
|
1197 |
*/ |
|
1198 |
||
1199 |
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) |
|
1200 |
# if defined(QT_NODLL) |
|
1201 |
# undef QT_MAKEDLL |
|
1202 |
# undef QT_DLL |
|
1203 |
# elif defined(QT_MAKEDLL) /* create a Qt DLL library */ |
|
1204 |
# if defined(QT_DLL) |
|
1205 |
# undef QT_DLL |
|
1206 |
# endif |
|
1207 |
# if defined(QT_BUILD_CORE_LIB) |
|
1208 |
# define Q_CORE_EXPORT Q_DECL_EXPORT |
|
1209 |
# else |
|
1210 |
# define Q_CORE_EXPORT Q_DECL_IMPORT |
|
1211 |
# endif |
|
1212 |
# if defined(QT_BUILD_GUI_LIB) |
|
1213 |
# define Q_GUI_EXPORT Q_DECL_EXPORT |
|
1214 |
# else |
|
1215 |
# define Q_GUI_EXPORT Q_DECL_IMPORT |
|
1216 |
# endif |
|
1217 |
# if defined(QT_BUILD_SQL_LIB) |
|
1218 |
# define Q_SQL_EXPORT Q_DECL_EXPORT |
|
1219 |
# else |
|
1220 |
# define Q_SQL_EXPORT Q_DECL_IMPORT |
|
1221 |
# endif |
|
1222 |
# if defined(QT_BUILD_NETWORK_LIB) |
|
1223 |
# define Q_NETWORK_EXPORT Q_DECL_EXPORT |
|
1224 |
# else |
|
1225 |
# define Q_NETWORK_EXPORT Q_DECL_IMPORT |
|
1226 |
# endif |
|
1227 |
# if defined(QT_BUILD_SVG_LIB) |
|
1228 |
# define Q_SVG_EXPORT Q_DECL_EXPORT |
|
1229 |
# else |
|
1230 |
# define Q_SVG_EXPORT Q_DECL_IMPORT |
|
1231 |
# endif |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1232 |
# if defined(QT_BUILD_DECLARATIVE_LIB) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1233 |
# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1234 |
# else |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1235 |
# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1236 |
# endif |
0 | 1237 |
# if defined(QT_BUILD_OPENGL_LIB) |
1238 |
# define Q_OPENGL_EXPORT Q_DECL_EXPORT |
|
1239 |
# else |
|
1240 |
# define Q_OPENGL_EXPORT Q_DECL_IMPORT |
|
1241 |
# endif |
|
1242 |
# if defined(QT_BUILD_MULTIMEDIA_LIB) |
|
1243 |
# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT |
|
1244 |
# else |
|
1245 |
# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT |
|
1246 |
# endif |
|
1247 |
# if defined(QT_BUILD_OPENVG_LIB) |
|
1248 |
# define Q_OPENVG_EXPORT Q_DECL_EXPORT |
|
1249 |
# else |
|
1250 |
# define Q_OPENVG_EXPORT Q_DECL_IMPORT |
|
1251 |
# endif |
|
1252 |
# if defined(QT_BUILD_XML_LIB) |
|
1253 |
# define Q_XML_EXPORT Q_DECL_EXPORT |
|
1254 |
# else |
|
1255 |
# define Q_XML_EXPORT Q_DECL_IMPORT |
|
1256 |
# endif |
|
1257 |
# if defined(QT_BUILD_XMLPATTERNS_LIB) |
|
1258 |
# define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT |
|
1259 |
# else |
|
1260 |
# define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT |
|
1261 |
# endif |
|
1262 |
# if defined(QT_BUILD_SCRIPT_LIB) |
|
1263 |
# define Q_SCRIPT_EXPORT Q_DECL_EXPORT |
|
1264 |
# else |
|
1265 |
# define Q_SCRIPT_EXPORT Q_DECL_IMPORT |
|
1266 |
# endif |
|
1267 |
# if defined(QT_BUILD_SCRIPTTOOLS_LIB) |
|
1268 |
# define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT |
|
1269 |
# else |
|
1270 |
# define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT |
|
1271 |
# endif |
|
1272 |
# if defined(QT_BUILD_CANVAS_LIB) |
|
1273 |
# define Q_CANVAS_EXPORT Q_DECL_EXPORT |
|
1274 |
# else |
|
1275 |
# define Q_CANVAS_EXPORT Q_DECL_IMPORT |
|
1276 |
# endif |
|
1277 |
# if defined(QT_BUILD_COMPAT_LIB) |
|
1278 |
# define Q_COMPAT_EXPORT Q_DECL_EXPORT |
|
1279 |
# else |
|
1280 |
# define Q_COMPAT_EXPORT Q_DECL_IMPORT |
|
1281 |
# endif |
|
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1282 |
# if defined(QT_BUILD_DBUS_LIB) |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1283 |
# define Q_DBUS_EXPORT Q_DECL_EXPORT |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1284 |
# else |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1285 |
# define Q_DBUS_EXPORT Q_DECL_IMPORT |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1286 |
# endif |
0 | 1287 |
# define Q_TEMPLATEDLL |
1288 |
# elif defined(QT_DLL) /* use a Qt DLL library */ |
|
1289 |
# define Q_CORE_EXPORT Q_DECL_IMPORT |
|
1290 |
# define Q_GUI_EXPORT Q_DECL_IMPORT |
|
1291 |
# define Q_SQL_EXPORT Q_DECL_IMPORT |
|
1292 |
# define Q_NETWORK_EXPORT Q_DECL_IMPORT |
|
1293 |
# define Q_SVG_EXPORT Q_DECL_IMPORT |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1294 |
# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT |
0 | 1295 |
# define Q_CANVAS_EXPORT Q_DECL_IMPORT |
1296 |
# define Q_OPENGL_EXPORT Q_DECL_IMPORT |
|
1297 |
# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT |
|
1298 |
# define Q_OPENVG_EXPORT Q_DECL_IMPORT |
|
1299 |
# define Q_XML_EXPORT Q_DECL_IMPORT |
|
1300 |
# define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT |
|
1301 |
# define Q_SCRIPT_EXPORT Q_DECL_IMPORT |
|
1302 |
# define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT |
|
1303 |
# define Q_COMPAT_EXPORT Q_DECL_IMPORT |
|
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1304 |
# define Q_DBUS_EXPORT Q_DECL_IMPORT |
0 | 1305 |
# define Q_TEMPLATEDLL |
1306 |
# endif |
|
1307 |
# define Q_NO_DECLARED_NOT_DEFINED |
|
1308 |
#else |
|
1309 |
# if defined(Q_OS_LINUX) && defined(Q_CC_BOR) |
|
1310 |
# define Q_TEMPLATEDLL |
|
1311 |
# define Q_NO_DECLARED_NOT_DEFINED |
|
1312 |
# endif |
|
1313 |
# undef QT_MAKEDLL /* ignore these for other platforms */ |
|
1314 |
# undef QT_DLL |
|
1315 |
#endif |
|
1316 |
||
1317 |
#if !defined(Q_CORE_EXPORT) |
|
1318 |
# if defined(QT_SHARED) |
|
1319 |
# define Q_CORE_EXPORT Q_DECL_EXPORT |
|
1320 |
# define Q_GUI_EXPORT Q_DECL_EXPORT |
|
1321 |
# define Q_SQL_EXPORT Q_DECL_EXPORT |
|
1322 |
# define Q_NETWORK_EXPORT Q_DECL_EXPORT |
|
1323 |
# define Q_SVG_EXPORT Q_DECL_EXPORT |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1324 |
# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT |
0 | 1325 |
# define Q_OPENGL_EXPORT Q_DECL_EXPORT |
1326 |
# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT |
|
1327 |
# define Q_OPENVG_EXPORT Q_DECL_EXPORT |
|
1328 |
# define Q_XML_EXPORT Q_DECL_EXPORT |
|
1329 |
# define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT |
|
1330 |
# define Q_SCRIPT_EXPORT Q_DECL_EXPORT |
|
1331 |
# define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT |
|
1332 |
# define Q_COMPAT_EXPORT Q_DECL_EXPORT |
|
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1333 |
# define Q_DBUS_EXPORT Q_DECL_EXPORT |
0 | 1334 |
# else |
1335 |
# define Q_CORE_EXPORT |
|
1336 |
# define Q_GUI_EXPORT |
|
1337 |
# define Q_SQL_EXPORT |
|
1338 |
# define Q_NETWORK_EXPORT |
|
1339 |
# define Q_SVG_EXPORT |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1340 |
# define Q_DECLARATIVE_EXPORT |
0 | 1341 |
# define Q_OPENGL_EXPORT |
1342 |
# define Q_MULTIMEDIA_EXPORT |
|
1343 |
# define Q_XML_EXPORT |
|
1344 |
# define Q_XMLPATTERNS_EXPORT |
|
1345 |
# define Q_SCRIPT_EXPORT |
|
1346 |
# define Q_SCRIPTTOOLS_EXPORT |
|
1347 |
# define Q_COMPAT_EXPORT |
|
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1348 |
# define Q_DBUS_EXPORT |
0 | 1349 |
# endif |
1350 |
#endif |
|
1351 |
||
1352 |
// Functions marked as Q_GUI_EXPORT_INLINE were exported and inlined by mistake. |
|
1353 |
// Compilers like MinGW complain that the import attribute is ignored. |
|
1354 |
#if defined(Q_CC_MINGW) |
|
1355 |
# if defined(QT_BUILD_CORE_LIB) |
|
1356 |
# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline |
|
1357 |
# else |
|
1358 |
# define Q_CORE_EXPORT_INLINE inline |
|
1359 |
# endif |
|
1360 |
# if defined(QT_BUILD_GUI_LIB) |
|
1361 |
# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline |
|
1362 |
# else |
|
1363 |
# define Q_GUI_EXPORT_INLINE inline |
|
1364 |
# endif |
|
1365 |
#elif defined(Q_CC_RVCT) |
|
1366 |
// we force RVCT not to export inlines by passing --visibility_inlines_hidden |
|
1367 |
// so we need to just inline it, rather than exporting and inlining |
|
1368 |
// note: this affects the contents of the DEF files (ie. these functions do not appear) |
|
1369 |
# define Q_CORE_EXPORT_INLINE inline |
|
1370 |
# define Q_GUI_EXPORT_INLINE inline |
|
1371 |
#else |
|
1372 |
# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline |
|
1373 |
# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline |
|
1374 |
#endif |
|
1375 |
||
1376 |
/* |
|
1377 |
No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols |
|
1378 |
for Qt's internal unit tests. If you want slower loading times and more |
|
1379 |
symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL. |
|
1380 |
*/ |
|
1381 |
#if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL) |
|
1382 |
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT |
|
1383 |
#elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL) |
|
1384 |
# define Q_AUTOTEST_EXPORT Q_DECL_IMPORT |
|
1385 |
#elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED) |
|
1386 |
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT |
|
1387 |
#else |
|
1388 |
# define Q_AUTOTEST_EXPORT |
|
1389 |
#endif |
|
1390 |
||
1391 |
inline void qt_noop() {} |
|
1392 |
||
1393 |
/* These wrap try/catch so we can switch off exceptions later. |
|
1394 |
||
1395 |
Beware - do not use more than one QT_CATCH per QT_TRY, and do not use |
|
1396 |
the exception instance in the catch block. |
|
1397 |
If you can't live with those constraints, don't use these macros. |
|
1398 |
Use the QT_NO_EXCEPTIONS macro to protect your code instead. |
|
1399 |
*/ |
|
1400 |
||
1401 |
#ifdef QT_BOOTSTRAPPED |
|
1402 |
# define QT_NO_EXCEPTIONS |
|
1403 |
#endif |
|
1404 |
#if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN) |
|
1405 |
# define QT_NO_EXCEPTIONS |
|
1406 |
#endif |
|
1407 |
||
1408 |
#ifdef QT_NO_EXCEPTIONS |
|
1409 |
# define QT_TRY if (true) |
|
1410 |
# define QT_CATCH(A) else |
|
1411 |
# define QT_THROW(A) qt_noop() |
|
1412 |
# define QT_RETHROW qt_noop() |
|
1413 |
#else |
|
1414 |
# define QT_TRY try |
|
1415 |
# define QT_CATCH(A) catch (A) |
|
1416 |
# define QT_THROW(A) throw A |
|
1417 |
# define QT_RETHROW throw |
|
1418 |
#endif |
|
1419 |
||
1420 |
/* |
|
1421 |
System information |
|
1422 |
*/ |
|
1423 |
||
1424 |
class QString; |
|
1425 |
class Q_CORE_EXPORT QSysInfo { |
|
1426 |
public: |
|
1427 |
enum Sizes { |
|
1428 |
WordSize = (sizeof(void *)<<3) |
|
1429 |
}; |
|
1430 |
||
1431 |
#if defined(QT_BUILD_QMAKE) |
|
1432 |
enum Endian { |
|
1433 |
BigEndian, |
|
1434 |
LittleEndian |
|
1435 |
}; |
|
1436 |
/* needed to bootstrap qmake */ |
|
1437 |
static const int ByteOrder; |
|
1438 |
#elif defined(Q_BYTE_ORDER) |
|
1439 |
enum Endian { |
|
1440 |
BigEndian, |
|
1441 |
LittleEndian |
|
1442 |
||
1443 |
# ifdef qdoc |
|
1444 |
, ByteOrder = <platform-dependent> |
|
1445 |
# elif Q_BYTE_ORDER == Q_BIG_ENDIAN |
|
1446 |
, ByteOrder = BigEndian |
|
1447 |
# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN |
|
1448 |
, ByteOrder = LittleEndian |
|
1449 |
# else |
|
1450 |
# error "Undefined byte order" |
|
1451 |
# endif |
|
1452 |
}; |
|
1453 |
#else |
|
1454 |
# error "Qt not configured correctly, please run configure" |
|
1455 |
#endif |
|
1456 |
#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN) |
|
1457 |
enum WinVersion { |
|
1458 |
WV_32s = 0x0001, |
|
1459 |
WV_95 = 0x0002, |
|
1460 |
WV_98 = 0x0003, |
|
1461 |
WV_Me = 0x0004, |
|
1462 |
WV_DOS_based= 0x000f, |
|
1463 |
||
1464 |
/* codenames */ |
|
1465 |
WV_NT = 0x0010, |
|
1466 |
WV_2000 = 0x0020, |
|
1467 |
WV_XP = 0x0030, |
|
1468 |
WV_2003 = 0x0040, |
|
1469 |
WV_VISTA = 0x0080, |
|
1470 |
WV_WINDOWS7 = 0x0090, |
|
1471 |
WV_NT_based = 0x00f0, |
|
1472 |
||
1473 |
/* version numbers */ |
|
1474 |
WV_4_0 = WV_NT, |
|
1475 |
WV_5_0 = WV_2000, |
|
1476 |
WV_5_1 = WV_XP, |
|
1477 |
WV_5_2 = WV_2003, |
|
1478 |
WV_6_0 = WV_VISTA, |
|
1479 |
WV_6_1 = WV_WINDOWS7, |
|
1480 |
||
1481 |
WV_CE = 0x0100, |
|
1482 |
WV_CENET = 0x0200, |
|
1483 |
WV_CE_5 = 0x0300, |
|
1484 |
WV_CE_6 = 0x0400, |
|
1485 |
WV_CE_based = 0x0f00 |
|
1486 |
}; |
|
1487 |
static const WinVersion WindowsVersion; |
|
1488 |
static WinVersion windowsVersion(); |
|
1489 |
||
1490 |
#endif |
|
1491 |
#ifdef Q_OS_MAC |
|
1492 |
enum MacVersion { |
|
1493 |
MV_Unknown = 0x0000, |
|
1494 |
||
1495 |
/* version */ |
|
1496 |
MV_9 = 0x0001, |
|
1497 |
MV_10_0 = 0x0002, |
|
1498 |
MV_10_1 = 0x0003, |
|
1499 |
MV_10_2 = 0x0004, |
|
1500 |
MV_10_3 = 0x0005, |
|
1501 |
MV_10_4 = 0x0006, |
|
1502 |
MV_10_5 = 0x0007, |
|
1503 |
MV_10_6 = 0x0008, |
|
1504 |
||
1505 |
/* codenames */ |
|
1506 |
MV_CHEETAH = MV_10_0, |
|
1507 |
MV_PUMA = MV_10_1, |
|
1508 |
MV_JAGUAR = MV_10_2, |
|
1509 |
MV_PANTHER = MV_10_3, |
|
1510 |
MV_TIGER = MV_10_4, |
|
1511 |
MV_LEOPARD = MV_10_5, |
|
1512 |
MV_SNOWLEOPARD = MV_10_6 |
|
1513 |
}; |
|
1514 |
static const MacVersion MacintoshVersion; |
|
1515 |
#endif |
|
1516 |
#ifdef Q_OS_SYMBIAN |
|
1517 |
enum SymbianVersion { |
|
1518 |
SV_Unknown = 0x0000, |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1519 |
//These are the Symbian Ltd versions 9.2-9.4 |
0 | 1520 |
SV_9_2 = 10, |
1521 |
SV_9_3 = 20, |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1522 |
SV_9_4 = 30, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1523 |
//Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1524 |
SV_SF_1 = SV_9_4, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1525 |
SV_SF_2 = 40, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1526 |
SV_SF_3 = 50, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1527 |
SV_SF_4 = 60 |
0 | 1528 |
}; |
1529 |
static SymbianVersion symbianVersion(); |
|
1530 |
enum S60Version { |
|
1531 |
SV_S60_None = 0, |
|
1532 |
SV_S60_Unknown = 1, |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1533 |
SV_S60_3_1 = SV_9_2, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1534 |
SV_S60_3_2 = SV_9_3, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1535 |
SV_S60_5_0 = SV_9_4, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1536 |
//versions beyond 5.0 are to be confirmed - it is better to use symbian version |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1537 |
SV_S60_5_1 = SV_SF_2, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1538 |
SV_S60_5_2 = SV_SF_3 |
0 | 1539 |
}; |
1540 |
static S60Version s60Version(); |
|
1541 |
#endif |
|
1542 |
}; |
|
1543 |
||
1544 |
Q_CORE_EXPORT const char *qVersion(); |
|
1545 |
Q_CORE_EXPORT bool qSharedBuild(); |
|
1546 |
||
1547 |
#if defined(Q_OS_MAC) |
|
1548 |
inline int qMacVersion() { return QSysInfo::MacintoshVersion; } |
|
1549 |
#endif |
|
1550 |
||
1551 |
#ifdef QT3_SUPPORT |
|
1552 |
inline QT3_SUPPORT bool qSysInfo(int *wordSize, bool *bigEndian) |
|
1553 |
{ |
|
1554 |
*wordSize = QSysInfo::WordSize; |
|
1555 |
*bigEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian); |
|
1556 |
return true; |
|
1557 |
} |
|
1558 |
#endif |
|
1559 |
||
1560 |
#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN) |
|
1561 |
#if defined(QT3_SUPPORT) |
|
1562 |
inline QT3_SUPPORT bool qt_winUnicode() { return true; } |
|
1563 |
inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } |
|
1564 |
#endif |
|
1565 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
1566 |
// ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE. |
0 | 1567 |
#define QT_WA(unicode, ansi) unicode |
1568 |
#define QT_WA_INLINE(unicode, ansi) (unicode) |
|
1569 |
||
1570 |
#endif /* Q_WS_WIN */ |
|
1571 |
||
1572 |
#ifndef Q_OUTOFLINE_TEMPLATE |
|
1573 |
# define Q_OUTOFLINE_TEMPLATE |
|
1574 |
#endif |
|
1575 |
#ifndef Q_INLINE_TEMPLATE |
|
1576 |
# define Q_INLINE_TEMPLATE inline |
|
1577 |
#endif |
|
1578 |
||
1579 |
#ifndef Q_TYPENAME |
|
1580 |
# define Q_TYPENAME typename |
|
1581 |
#endif |
|
1582 |
||
1583 |
/* |
|
1584 |
Avoid "unused parameter" warnings |
|
1585 |
*/ |
|
1586 |
||
1587 |
#if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT) |
|
1588 |
template <typename T> |
|
1589 |
inline void qUnused(T &x) { (void)x; } |
|
1590 |
# define Q_UNUSED(x) qUnused(x); |
|
1591 |
#else |
|
1592 |
# define Q_UNUSED(x) (void)x; |
|
1593 |
#endif |
|
1594 |
||
1595 |
/* |
|
1596 |
Debugging and error handling |
|
1597 |
*/ |
|
1598 |
||
1599 |
/* |
|
1600 |
On Symbian we do not know beforehand whether we are compiling in |
|
1601 |
release or debug mode, so check the Symbian build define here, |
|
1602 |
and set the QT_NO_DEBUG define appropriately. |
|
1603 |
*/ |
|
1604 |
#if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG) |
|
1605 |
# define QT_NO_DEBUG |
|
1606 |
#endif |
|
1607 |
||
1608 |
#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) |
|
1609 |
# define QT_DEBUG |
|
1610 |
#endif |
|
1611 |
||
1612 |
#ifndef qPrintable |
|
1613 |
# define qPrintable(string) (string).toLocal8Bit().constData() |
|
1614 |
#endif |
|
1615 |
||
1616 |
Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */ |
|
1617 |
#if defined(Q_CC_GNU) && !defined(__INSURE__) |
|
1618 |
__attribute__ ((format (printf, 1, 2))) |
|
1619 |
#endif |
|
1620 |
; |
|
1621 |
||
1622 |
Q_CORE_EXPORT void qWarning(const char *, ...) /* print warning message */ |
|
1623 |
#if defined(Q_CC_GNU) && !defined(__INSURE__) |
|
1624 |
__attribute__ ((format (printf, 1, 2))) |
|
1625 |
#endif |
|
1626 |
; |
|
1627 |
||
1628 |
class QString; |
|
1629 |
Q_CORE_EXPORT QString qt_error_string(int errorCode = -1); |
|
1630 |
Q_CORE_EXPORT void qCritical(const char *, ...) /* print critical message */ |
|
1631 |
#if defined(Q_CC_GNU) && !defined(__INSURE__) |
|
1632 |
__attribute__ ((format (printf, 1, 2))) |
|
1633 |
#endif |
|
1634 |
; |
|
1635 |
Q_CORE_EXPORT void qFatal(const char *, ...) /* print fatal message and exit */ |
|
1636 |
#if defined(Q_CC_GNU) && !defined(__INSURE__) |
|
1637 |
__attribute__ ((format (printf, 1, 2))) |
|
1638 |
#endif |
|
1639 |
; |
|
1640 |
||
1641 |
#ifdef QT3_SUPPORT |
|
1642 |
Q_CORE_EXPORT QT3_SUPPORT void qSystemWarning(const char *msg, int code = -1); |
|
1643 |
#endif /* QT3_SUPPORT */ |
|
1644 |
Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...); |
|
1645 |
Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...); |
|
1646 |
||
1647 |
#if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM) |
|
1648 |
#define QT_NO_DEBUG_STREAM |
|
1649 |
#endif |
|
1650 |
||
1651 |
/* |
|
1652 |
Forward declarations only. |
|
1653 |
||
1654 |
In order to use the qDebug() stream, you must #include<QDebug> |
|
1655 |
*/ |
|
1656 |
class QDebug; |
|
1657 |
class QNoDebug; |
|
1658 |
#ifndef QT_NO_DEBUG_STREAM |
|
1659 |
Q_CORE_EXPORT_INLINE QDebug qDebug(); |
|
1660 |
Q_CORE_EXPORT_INLINE QDebug qWarning(); |
|
1661 |
Q_CORE_EXPORT_INLINE QDebug qCritical(); |
|
1662 |
#else |
|
1663 |
inline QNoDebug qDebug(); |
|
1664 |
#endif |
|
1665 |
||
1666 |
#define QT_NO_QDEBUG_MACRO while (false) qDebug |
|
1667 |
#ifdef QT_NO_DEBUG_OUTPUT |
|
1668 |
# define qDebug QT_NO_QDEBUG_MACRO |
|
1669 |
#endif |
|
1670 |
#define QT_NO_QWARNING_MACRO while (false) qWarning |
|
1671 |
#ifdef QT_NO_WARNING_OUTPUT |
|
1672 |
# define qWarning QT_NO_QWARNING_MACRO |
|
1673 |
#endif |
|
1674 |
||
1675 |
||
1676 |
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line); |
|
1677 |
||
1678 |
#if !defined(Q_ASSERT) |
|
1679 |
# ifndef QT_NO_DEBUG |
|
1680 |
# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop()) |
|
1681 |
# else |
|
1682 |
# define Q_ASSERT(cond) qt_noop() |
|
1683 |
# endif |
|
1684 |
#endif |
|
1685 |
||
1686 |
#if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG) |
|
1687 |
#define QT_NO_PAINT_DEBUG |
|
1688 |
#endif |
|
1689 |
||
1690 |
Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line); |
|
1691 |
||
1692 |
#if !defined(Q_ASSERT_X) |
|
1693 |
# ifndef QT_NO_DEBUG |
|
1694 |
# define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop()) |
|
1695 |
# else |
|
1696 |
# define Q_ASSERT_X(cond, where, what) qt_noop() |
|
1697 |
# endif |
|
1698 |
#endif |
|
1699 |
||
1700 |
Q_CORE_EXPORT void qt_check_pointer(const char *, int); |
|
1701 |
Q_CORE_EXPORT void qBadAlloc(); |
|
1702 |
||
1703 |
#ifdef QT_NO_EXCEPTIONS |
|
1704 |
# if defined(QT_NO_DEBUG) |
|
1705 |
# define Q_CHECK_PTR(p) qt_noop(); |
|
1706 |
# else |
|
1707 |
# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) |
|
1708 |
# endif |
|
1709 |
#else |
|
1710 |
# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0) |
|
1711 |
#endif |
|
1712 |
||
1713 |
template <typename T> |
|
1714 |
inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } |
|
1715 |
||
1716 |
#if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB) |
|
1717 |
# define Q_FUNC_INFO __PRETTY_FUNCTION__ |
|
1718 |
#elif defined(_MSC_VER) |
|
1719 |
/* MSVC 2002 doesn't have __FUNCSIG__ nor can it handle QT_STRINGIFY. */ |
|
1720 |
# if _MSC_VER <= 1300 |
|
1721 |
# define Q_FUNC_INFO __FILE__ "(line number unavailable)" |
|
1722 |
# else |
|
1723 |
# define Q_FUNC_INFO __FUNCSIG__ |
|
1724 |
# endif |
|
1725 |
#else |
|
1726 |
# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) |
|
1727 |
# define Q_FUNC_INFO __FILE__ "(line number unavailable)" |
|
1728 |
# else |
|
1729 |
/* These two macros makes it possible to turn the builtin line expander into a |
|
1730 |
* string literal. */ |
|
1731 |
# define QT_STRINGIFY2(x) #x |
|
1732 |
# define QT_STRINGIFY(x) QT_STRINGIFY2(x) |
|
1733 |
# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__) |
|
1734 |
# endif |
|
1735 |
/* The MIPSpro and RVCT compilers postpones macro expansion, |
|
1736 |
and therefore macros must be in scope when being used. */ |
|
1737 |
# if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86) |
|
1738 |
# undef QT_STRINGIFY2 |
|
1739 |
# undef QT_STRINGIFY |
|
1740 |
# endif |
|
1741 |
#endif |
|
1742 |
||
1743 |
enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg }; |
|
1744 |
||
1745 |
Q_CORE_EXPORT void qt_message_output(QtMsgType, const char *buf); |
|
1746 |
||
1747 |
typedef void (*QtMsgHandler)(QtMsgType, const char *); |
|
1748 |
Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler); |
|
1749 |
||
1750 |
#ifdef QT3_SUPPORT |
|
1751 |
inline QT3_SUPPORT void qSuppressObsoleteWarnings(bool = true) {} |
|
1752 |
inline QT3_SUPPORT void qObsolete(const char *, const char * = 0, const char * = 0) {} |
|
1753 |
#endif |
|
1754 |
||
1755 |
#if defined(QT_NO_THREAD) |
|
1756 |
||
1757 |
template <typename T> |
|
1758 |
class QGlobalStatic |
|
1759 |
{ |
|
1760 |
public: |
|
1761 |
T *pointer; |
|
1762 |
inline QGlobalStatic(T *p) : pointer(p) { } |
|
1763 |
inline ~QGlobalStatic() { pointer = 0; } |
|
1764 |
}; |
|
1765 |
||
1766 |
#define Q_GLOBAL_STATIC(TYPE, NAME) \ |
|
1767 |
static TYPE *NAME() \ |
|
1768 |
{ \ |
|
1769 |
static TYPE this_##NAME; \ |
|
1770 |
static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \ |
|
1771 |
return global_##NAME.pointer; \ |
|
1772 |
} |
|
1773 |
||
1774 |
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ |
|
1775 |
static TYPE *NAME() \ |
|
1776 |
{ \ |
|
1777 |
static TYPE this_##NAME ARGS; \ |
|
1778 |
static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \ |
|
1779 |
return global_##NAME.pointer; \ |
|
1780 |
} |
|
1781 |
||
1782 |
#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ |
|
1783 |
static TYPE *NAME() \ |
|
1784 |
{ \ |
|
1785 |
static TYPE this_##NAME; \ |
|
1786 |
static QGlobalStatic<TYPE > global_##NAME(0); \ |
|
1787 |
if (!global_##NAME.pointer) { \ |
|
1788 |
TYPE *x = global_##NAME.pointer = &this_##NAME; \ |
|
1789 |
INITIALIZER; \ |
|
1790 |
} \ |
|
1791 |
return global_##NAME.pointer; \ |
|
1792 |
} |
|
1793 |
||
1794 |
#else |
|
1795 |
||
1796 |
// forward declaration, since qatomic.h needs qglobal.h |
|
1797 |
template <typename T> class QBasicAtomicPointer; |
|
1798 |
||
1799 |
// POD for Q_GLOBAL_STATIC |
|
1800 |
template <typename T> |
|
1801 |
class QGlobalStatic |
|
1802 |
{ |
|
1803 |
public: |
|
1804 |
QBasicAtomicPointer<T> pointer; |
|
1805 |
bool destroyed; |
|
1806 |
}; |
|
1807 |
||
1808 |
// Created as a function-local static to delete a QGlobalStatic<T> |
|
1809 |
template <typename T> |
|
1810 |
class QGlobalStaticDeleter |
|
1811 |
{ |
|
1812 |
public: |
|
1813 |
QGlobalStatic<T> &globalStatic; |
|
1814 |
QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic) |
|
1815 |
: globalStatic(_globalStatic) |
|
1816 |
{ } |
|
1817 |
||
1818 |
inline ~QGlobalStaticDeleter() |
|
1819 |
{ |
|
1820 |
delete globalStatic.pointer; |
|
1821 |
globalStatic.pointer = 0; |
|
1822 |
globalStatic.destroyed = true; |
|
1823 |
} |
|
1824 |
}; |
|
1825 |
||
1826 |
#define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \ |
|
1827 |
static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false } |
|
1828 |
||
1829 |
#define Q_GLOBAL_STATIC(TYPE, NAME) \ |
|
1830 |
Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ |
|
1831 |
static TYPE *NAME() \ |
|
1832 |
{ \ |
|
1833 |
if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ |
|
1834 |
TYPE *x = new TYPE; \ |
|
1835 |
if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ |
|
1836 |
delete x; \ |
|
1837 |
else \ |
|
1838 |
static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ |
|
1839 |
} \ |
|
1840 |
return this_##NAME.pointer; \ |
|
1841 |
} |
|
1842 |
||
1843 |
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ |
|
1844 |
Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ |
|
1845 |
static TYPE *NAME() \ |
|
1846 |
{ \ |
|
1847 |
if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ |
|
1848 |
TYPE *x = new TYPE ARGS; \ |
|
1849 |
if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ |
|
1850 |
delete x; \ |
|
1851 |
else \ |
|
1852 |
static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ |
|
1853 |
} \ |
|
1854 |
return this_##NAME.pointer; \ |
|
1855 |
} |
|
1856 |
||
1857 |
#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ |
|
1858 |
Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ |
|
1859 |
static TYPE *NAME() \ |
|
1860 |
{ \ |
|
1861 |
if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ |
|
1862 |
QScopedPointer<TYPE > x(new TYPE); \ |
|
1863 |
INITIALIZER; \ |
|
1864 |
if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \ |
|
1865 |
static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ |
|
1866 |
x.take(); \ |
|
1867 |
} \ |
|
1868 |
} \ |
|
1869 |
return this_##NAME.pointer; \ |
|
1870 |
} |
|
1871 |
||
1872 |
#endif |
|
1873 |
||
1874 |
class QBool |
|
1875 |
{ |
|
1876 |
bool b; |
|
1877 |
||
1878 |
public: |
|
1879 |
inline explicit QBool(bool B) : b(B) {} |
|
1880 |
inline operator const void *() const |
|
1881 |
{ return b ? static_cast<const void *>(this) : static_cast<const void *>(0); } |
|
1882 |
}; |
|
1883 |
||
1884 |
inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; } |
|
1885 |
inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; } |
|
1886 |
inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; } |
|
1887 |
inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; } |
|
1888 |
inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; } |
|
1889 |
inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; } |
|
1890 |
||
1891 |
static inline bool qFuzzyCompare(double p1, double p2) |
|
1892 |
{ |
|
1893 |
return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2))); |
|
1894 |
} |
|
1895 |
||
1896 |
static inline bool qFuzzyCompare(float p1, float p2) |
|
1897 |
{ |
|
1898 |
return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); |
|
1899 |
} |
|
1900 |
||
1901 |
/*! |
|
1902 |
\internal |
|
1903 |
*/ |
|
1904 |
static inline bool qFuzzyIsNull(double d) |
|
1905 |
{ |
|
1906 |
return qAbs(d) <= 0.000000000001; |
|
1907 |
} |
|
1908 |
||
1909 |
/*! |
|
1910 |
\internal |
|
1911 |
*/ |
|
1912 |
static inline bool qFuzzyIsNull(float f) |
|
1913 |
{ |
|
1914 |
return qAbs(f) <= 0.00001f; |
|
1915 |
} |
|
1916 |
||
1917 |
/* |
|
1918 |
This function tests a double for a null value. It doesn't |
|
1919 |
check whether the actual value is 0 or close to 0, but whether |
|
1920 |
it is binary 0. |
|
1921 |
*/ |
|
1922 |
static inline bool qIsNull(double d) |
|
1923 |
{ |
|
1924 |
union U { |
|
1925 |
double d; |
|
1926 |
quint64 u; |
|
1927 |
}; |
|
1928 |
U val; |
|
1929 |
val.d = d; |
|
1930 |
return val.u == quint64(0); |
|
1931 |
} |
|
1932 |
||
1933 |
/* |
|
1934 |
This function tests a float for a null value. It doesn't |
|
1935 |
check whether the actual value is 0 or close to 0, but whether |
|
1936 |
it is binary 0. |
|
1937 |
*/ |
|
1938 |
static inline bool qIsNull(float f) |
|
1939 |
{ |
|
1940 |
union U { |
|
1941 |
float f; |
|
1942 |
quint32 u; |
|
1943 |
}; |
|
1944 |
U val; |
|
1945 |
val.f = f; |
|
1946 |
return val.u == 0u; |
|
1947 |
} |
|
1948 |
||
1949 |
/* |
|
1950 |
Compilers which follow outdated template instantiation rules |
|
1951 |
require a class to have a comparison operator to exist when |
|
1952 |
a QList of this type is instantiated. It's not actually |
|
1953 |
used in the list, though. Hence the dummy implementation. |
|
1954 |
Just in case other code relies on it we better trigger a warning |
|
1955 |
mandating a real implementation. |
|
1956 |
*/ |
|
1957 |
||
1958 |
#ifdef Q_FULL_TEMPLATE_INSTANTIATION |
|
1959 |
# define Q_DUMMY_COMPARISON_OPERATOR(C) \ |
|
1960 |
bool operator==(const C&) const { \ |
|
1961 |
qWarning(#C"::operator==(const "#C"&) was called"); \ |
|
1962 |
return false; \ |
|
1963 |
} |
|
1964 |
#else |
|
1965 |
# define Q_DUMMY_COMPARISON_OPERATOR(C) |
|
1966 |
#endif |
|
1967 |
||
1968 |
||
1969 |
/* |
|
1970 |
QTypeInfo - type trait functionality |
|
1971 |
qIsDetached - data sharing functionality |
|
1972 |
*/ |
|
1973 |
||
1974 |
#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION |
|
1975 |
||
1976 |
/* |
|
1977 |
The catch-all template. |
|
1978 |
*/ |
|
1979 |
||
1980 |
template <typename T> inline bool qIsDetached(T &) { return true; } |
|
1981 |
||
1982 |
template <typename T> |
|
1983 |
class QTypeInfo |
|
1984 |
{ |
|
1985 |
public: |
|
1986 |
enum { |
|
1987 |
isPointer = false, |
|
1988 |
isComplex = true, |
|
1989 |
isStatic = true, |
|
1990 |
isLarge = (sizeof(T)>sizeof(void*)), |
|
1991 |
isDummy = false |
|
1992 |
}; |
|
1993 |
}; |
|
1994 |
||
1995 |
template <typename T> |
|
1996 |
class QTypeInfo<T*> |
|
1997 |
{ |
|
1998 |
public: |
|
1999 |
enum { |
|
2000 |
isPointer = true, |
|
2001 |
isComplex = false, |
|
2002 |
isStatic = false, |
|
2003 |
isLarge = false, |
|
2004 |
isDummy = false |
|
2005 |
}; |
|
2006 |
}; |
|
2007 |
||
2008 |
#else |
|
2009 |
||
2010 |
template <typename T> char QTypeInfoHelper(T*(*)()); |
|
2011 |
void* QTypeInfoHelper(...); |
|
2012 |
||
2013 |
template <typename T> inline bool qIsDetached(T &) { return true; } |
|
2014 |
||
2015 |
template <typename T> |
|
2016 |
class QTypeInfo |
|
2017 |
{ |
|
2018 |
public: |
|
2019 |
enum { |
|
2020 |
isPointer = (1 == sizeof(QTypeInfoHelper((T(*)())0))), |
|
2021 |
isComplex = !isPointer, |
|
2022 |
isStatic = !isPointer, |
|
2023 |
isLarge = (sizeof(T)>sizeof(void*)), |
|
2024 |
isDummy = false |
|
2025 |
}; |
|
2026 |
}; |
|
2027 |
||
2028 |
#endif /* QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION */ |
|
2029 |
||
2030 |
/* |
|
2031 |
Specialize a specific type with: |
|
2032 |
||
2033 |
Q_DECLARE_TYPEINFO(type, flags); |
|
2034 |
||
2035 |
where 'type' is the name of the type to specialize and 'flags' is |
|
2036 |
logically-OR'ed combination of the flags below. |
|
2037 |
*/ |
|
2038 |
enum { /* TYPEINFO flags */ |
|
2039 |
Q_COMPLEX_TYPE = 0, |
|
2040 |
Q_PRIMITIVE_TYPE = 0x1, |
|
2041 |
Q_STATIC_TYPE = 0, |
|
2042 |
Q_MOVABLE_TYPE = 0x2, |
|
2043 |
Q_DUMMY_TYPE = 0x4 |
|
2044 |
}; |
|
2045 |
||
2046 |
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \ |
|
2047 |
template <> \ |
|
2048 |
class QTypeInfo<TYPE > \ |
|
2049 |
{ \ |
|
2050 |
public: \ |
|
2051 |
enum { \ |
|
2052 |
isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \ |
|
2053 |
isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \ |
|
2054 |
isLarge = (sizeof(TYPE)>sizeof(void*)), \ |
|
2055 |
isPointer = false, \ |
|
2056 |
isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0) \ |
|
2057 |
}; \ |
|
2058 |
static inline const char *name() { return #TYPE; } \ |
|
2059 |
} |
|
2060 |
||
2061 |
template <typename T> |
|
2062 |
inline void qSwap(T &value1, T &value2) |
|
2063 |
{ |
|
2064 |
const T t = value1; |
|
2065 |
value1 = value2; |
|
2066 |
value2 = t; |
|
2067 |
} |
|
2068 |
||
2069 |
/* |
|
2070 |
Specialize a shared type with: |
|
2071 |
||
2072 |
Q_DECLARE_SHARED(type); |
|
2073 |
||
2074 |
where 'type' is the name of the type to specialize. NOTE: shared |
|
2075 |
types must declare a 'bool isDetached(void) const;' member for this |
|
2076 |
to work. |
|
2077 |
*/ |
|
2078 |
#define Q_DECLARE_SHARED(TYPE) \ |
|
2079 |
template <> inline bool qIsDetached<TYPE>(TYPE &t) { return t.isDetached(); } \ |
|
2080 |
template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \ |
|
2081 |
{ \ |
|
2082 |
qSwap(value1.data_ptr(), value2.data_ptr()); \ |
|
2083 |
} |
|
2084 |
||
2085 |
/* |
|
2086 |
QTypeInfo primitive specializations |
|
2087 |
*/ |
|
2088 |
Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); |
|
2089 |
Q_DECLARE_TYPEINFO(char, Q_PRIMITIVE_TYPE); |
|
2090 |
Q_DECLARE_TYPEINFO(signed char, Q_PRIMITIVE_TYPE); |
|
2091 |
Q_DECLARE_TYPEINFO(uchar, Q_PRIMITIVE_TYPE); |
|
2092 |
Q_DECLARE_TYPEINFO(short, Q_PRIMITIVE_TYPE); |
|
2093 |
Q_DECLARE_TYPEINFO(ushort, Q_PRIMITIVE_TYPE); |
|
2094 |
Q_DECLARE_TYPEINFO(int, Q_PRIMITIVE_TYPE); |
|
2095 |
Q_DECLARE_TYPEINFO(uint, Q_PRIMITIVE_TYPE); |
|
2096 |
Q_DECLARE_TYPEINFO(long, Q_PRIMITIVE_TYPE); |
|
2097 |
Q_DECLARE_TYPEINFO(ulong, Q_PRIMITIVE_TYPE); |
|
2098 |
Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE); |
|
2099 |
Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE); |
|
2100 |
Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE); |
|
2101 |
Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE); |
|
2102 |
#ifndef Q_OS_DARWIN |
|
2103 |
Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); |
|
2104 |
#endif |
|
2105 |
||
2106 |
/* |
|
2107 |
These functions make it possible to use standard C++ functions with |
|
2108 |
a similar name from Qt header files (especially template classes). |
|
2109 |
*/ |
|
2110 |
Q_CORE_EXPORT void *qMalloc(size_t size); |
|
2111 |
Q_CORE_EXPORT void qFree(void *ptr); |
|
2112 |
Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2113 |
Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2114 |
Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2115 |
Q_CORE_EXPORT void qFreeAligned(void *ptr); |
0 | 2116 |
Q_CORE_EXPORT void *qMemCopy(void *dest, const void *src, size_t n); |
2117 |
Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); |
|
2118 |
||
2119 |
||
2120 |
/* |
|
2121 |
Avoid some particularly useless warnings from some stupid compilers. |
|
2122 |
To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out |
|
2123 |
the line "#define QT_NO_WARNINGS". |
|
2124 |
*/ |
|
2125 |
#if !defined(QT_CC_WARNINGS) |
|
2126 |
# define QT_NO_WARNINGS |
|
2127 |
#endif |
|
2128 |
#if defined(QT_NO_WARNINGS) |
|
2129 |
# if defined(Q_CC_MSVC) |
|
2130 |
# pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */ |
|
2131 |
# pragma warning(disable: 4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */ |
|
2132 |
# pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */ |
|
2133 |
# pragma warning(disable: 4514) /* unreferenced inline/local function has been removed */ |
|
2134 |
# pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */ |
|
2135 |
# pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */ |
|
2136 |
# pragma warning(disable: 4706) /* assignment within conditional expression */ |
|
2137 |
# pragma warning(disable: 4786) /* truncating debug info after 255 characters */ |
|
2138 |
# pragma warning(disable: 4660) /* template-class specialization 'identifier' is already instantiated */ |
|
2139 |
# pragma warning(disable: 4355) /* 'this' : used in base member initializer list */ |
|
2140 |
# pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */ |
|
2141 |
# pragma warning(disable: 4710) /* function not inlined */ |
|
2142 |
# pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify -GX */ |
|
2143 |
# if _MSC_VER < 1300 |
|
2144 |
# pragma warning(disable: 4284) /* return type for 'type1::operator ->' is 'type2 *' */ |
|
2145 |
/* (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) */ |
|
2146 |
# endif |
|
2147 |
# elif defined(Q_CC_BOR) |
|
2148 |
# pragma option -w-inl |
|
2149 |
# pragma option -w-aus |
|
2150 |
# pragma warn -inl |
|
2151 |
# pragma warn -pia |
|
2152 |
# pragma warn -ccc |
|
2153 |
# pragma warn -rch |
|
2154 |
# pragma warn -sig |
|
2155 |
# endif |
|
2156 |
#endif |
|
2157 |
||
2158 |
class Q_CORE_EXPORT QFlag |
|
2159 |
{ |
|
2160 |
int i; |
|
2161 |
public: |
|
2162 |
inline QFlag(int i); |
|
2163 |
inline operator int() const { return i; } |
|
2164 |
}; |
|
2165 |
||
2166 |
inline QFlag::QFlag(int ai) : i(ai) {} |
|
2167 |
||
2168 |
class Q_CORE_EXPORT QIncompatibleFlag |
|
2169 |
{ |
|
2170 |
int i; |
|
2171 |
public: |
|
2172 |
inline explicit QIncompatibleFlag(int i); |
|
2173 |
inline operator int() const { return i; } |
|
2174 |
}; |
|
2175 |
||
2176 |
inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} |
|
2177 |
||
2178 |
||
2179 |
#ifndef Q_NO_TYPESAFE_FLAGS |
|
2180 |
||
2181 |
template<typename Enum> |
|
2182 |
class QFlags |
|
2183 |
{ |
|
2184 |
typedef void **Zero; |
|
2185 |
int i; |
|
2186 |
public: |
|
2187 |
typedef Enum enum_type; |
|
2188 |
inline QFlags(const QFlags &f) : i(f.i) {} |
|
2189 |
inline QFlags(Enum f) : i(f) {} |
|
2190 |
inline QFlags(Zero = 0) : i(0) {} |
|
2191 |
inline QFlags(QFlag f) : i(f) {} |
|
2192 |
||
2193 |
inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; } |
|
2194 |
inline QFlags &operator&=(int mask) { i &= mask; return *this; } |
|
2195 |
inline QFlags &operator&=(uint mask) { i &= mask; return *this; } |
|
2196 |
inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } |
|
2197 |
inline QFlags &operator|=(Enum f) { i |= f; return *this; } |
|
2198 |
inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } |
|
2199 |
inline QFlags &operator^=(Enum f) { i ^= f; return *this; } |
|
2200 |
||
2201 |
inline operator int() const { return i; } |
|
2202 |
||
2203 |
inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; } |
|
2204 |
inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; } |
|
2205 |
inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; } |
|
2206 |
inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; } |
|
2207 |
inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; } |
|
2208 |
inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; } |
|
2209 |
inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; } |
|
2210 |
inline QFlags operator~() const { QFlags g; g.i = ~i; return g; } |
|
2211 |
||
2212 |
inline bool operator!() const { return !i; } |
|
2213 |
||
2214 |
inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } |
|
2215 |
}; |
|
2216 |
||
2217 |
#define Q_DECLARE_FLAGS(Flags, Enum)\ |
|
2218 |
typedef QFlags<Enum> Flags; |
|
2219 |
||
2220 |
#if defined Q_CC_MSVC && _MSC_VER < 1300 |
|
2221 |
# define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) |
|
2222 |
#else |
|
2223 |
# define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ |
|
2224 |
inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ |
|
2225 |
{ return QIncompatibleFlag(int(f1) | f2); } |
|
2226 |
#endif |
|
2227 |
||
2228 |
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ |
|
2229 |
inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \ |
|
2230 |
{ return QFlags<Flags::enum_type>(f1) | f2; } \ |
|
2231 |
inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \ |
|
2232 |
{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) |
|
2233 |
||
2234 |
||
2235 |
#else /* Q_NO_TYPESAFE_FLAGS */ |
|
2236 |
||
2237 |
#define Q_DECLARE_FLAGS(Flags, Enum)\ |
|
2238 |
typedef uint Flags; |
|
2239 |
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) |
|
2240 |
||
2241 |
#endif /* Q_NO_TYPESAFE_FLAGS */ |
|
2242 |
||
2243 |
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) |
|
2244 |
/* make use of typeof-extension */ |
|
2245 |
template <typename T> |
|
2246 |
class QForeachContainer { |
|
2247 |
public: |
|
2248 |
inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { } |
|
2249 |
const T c; |
|
2250 |
int brk; |
|
2251 |
typename T::const_iterator i, e; |
|
2252 |
}; |
|
2253 |
||
2254 |
#define Q_FOREACH(variable, container) \ |
|
2255 |
for (QForeachContainer<__typeof__(container)> _container_(container); \ |
|
2256 |
!_container_.brk && _container_.i != _container_.e; \ |
|
2257 |
__extension__ ({ ++_container_.brk; ++_container_.i; })) \ |
|
2258 |
for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;})) |
|
2259 |
||
2260 |
#else |
|
2261 |
||
2262 |
struct QForeachContainerBase {}; |
|
2263 |
||
2264 |
template <typename T> |
|
2265 |
class QForeachContainer : public QForeachContainerBase { |
|
2266 |
public: |
|
2267 |
inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){}; |
|
2268 |
const T c; |
|
2269 |
mutable int brk; |
|
2270 |
mutable typename T::const_iterator i, e; |
|
2271 |
inline bool condition() const { return (!brk++ && i != e); } |
|
2272 |
}; |
|
2273 |
||
2274 |
template <typename T> inline T *qForeachPointer(const T &) { return 0; } |
|
2275 |
||
2276 |
template <typename T> inline QForeachContainer<T> qForeachContainerNew(const T& t) |
|
2277 |
{ return QForeachContainer<T>(t); } |
|
2278 |
||
2279 |
template <typename T> |
|
2280 |
inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase *base, const T *) |
|
2281 |
{ return static_cast<const QForeachContainer<T> *>(base); } |
|
2282 |
||
2283 |
#if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) |
|
2284 |
/* |
|
2285 |
Proper for-scoping in VC++6 and MIPSpro CC |
|
2286 |
*/ |
|
2287 |
# define Q_FOREACH(variable,container) \ |
|
2288 |
if(0){}else \ |
|
2289 |
for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ |
|
2290 |
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \ |
|
2291 |
++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \ |
|
2292 |
for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \ |
|
2293 |
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \ |
|
2294 |
--qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk) |
|
2295 |
||
2296 |
#elif defined(Q_CC_DIAB) |
|
2297 |
// VxWorks DIAB generates unresolvable symbols, if container is a function call |
|
2298 |
# define Q_FOREACH(variable,container) \ |
|
2299 |
if(0){}else \ |
|
2300 |
for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ |
|
2301 |
qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition(); \ |
|
2302 |
++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i) \ |
|
2303 |
for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \ |
|
2304 |
qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk; \ |
|
2305 |
--qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk) |
|
2306 |
||
2307 |
#else |
|
2308 |
# define Q_FOREACH(variable, container) \ |
|
2309 |
for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ |
|
2310 |
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \ |
|
2311 |
++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \ |
|
2312 |
for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \ |
|
2313 |
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \ |
|
2314 |
--qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk) |
|
2315 |
#endif // MSVC6 || MIPSpro |
|
2316 |
||
2317 |
#endif |
|
2318 |
||
2319 |
#define Q_FOREVER for(;;) |
|
2320 |
#ifndef QT_NO_KEYWORDS |
|
2321 |
# ifndef foreach |
|
2322 |
# define foreach Q_FOREACH |
|
2323 |
# endif |
|
2324 |
# ifndef forever |
|
2325 |
# define forever Q_FOREVER |
|
2326 |
# endif |
|
2327 |
#endif |
|
2328 |
||
2329 |
#if 0 |
|
2330 |
/* tell gcc to use its built-in methods for some common functions */ |
|
2331 |
#if defined(QT_NO_DEBUG) && defined(Q_CC_GNU) |
|
2332 |
# define qMemCopy __builtin_memcpy |
|
2333 |
# define qMemSet __builtin_memset |
|
2334 |
#endif |
|
2335 |
#endif |
|
2336 |
||
2337 |
template <typename T> static inline T *qGetPtrHelper(T *ptr) { return ptr; } |
|
2338 |
template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); } |
|
2339 |
||
2340 |
#define Q_DECLARE_PRIVATE(Class) \ |
|
2341 |
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \ |
|
2342 |
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \ |
|
2343 |
friend class Class##Private; |
|
2344 |
||
2345 |
#define Q_DECLARE_PRIVATE_D(Dptr, Class) \ |
|
2346 |
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \ |
|
2347 |
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \ |
|
2348 |
friend class Class##Private; |
|
2349 |
||
2350 |
#define Q_DECLARE_PUBLIC(Class) \ |
|
2351 |
inline Class* q_func() { return static_cast<Class *>(q_ptr); } \ |
|
2352 |
inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \ |
|
2353 |
friend class Class; |
|
2354 |
||
2355 |
#define Q_D(Class) Class##Private * const d = d_func() |
|
2356 |
#define Q_Q(Class) Class * const q = q_func() |
|
2357 |
||
2358 |
#define QT_TR_NOOP(x) (x) |
|
2359 |
#define QT_TR_NOOP_UTF8(x) (x) |
|
2360 |
#define QT_TRANSLATE_NOOP(scope, x) (x) |
|
2361 |
#define QT_TRANSLATE_NOOP_UTF8(scope, x) (x) |
|
2362 |
#define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment} |
|
2363 |
#define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment} |
|
2364 |
||
2365 |
#ifndef QT_NO_TRANSLATION // ### This should enclose the NOOPs above |
|
2366 |
||
2367 |
// Defined in qcoreapplication.cpp |
|
2368 |
// The better name qTrId() is reserved for an upcoming function which would |
|
2369 |
// return a much more powerful QStringFormatter instead of a QString. |
|
2370 |
Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); |
|
2371 |
||
2372 |
#define QT_TRID_NOOP(id) id |
|
2373 |
||
2374 |
#endif // QT_NO_TRANSLATION |
|
2375 |
||
2376 |
#define QDOC_PROPERTY(text) |
|
2377 |
||
2378 |
/* |
|
2379 |
When RTTI is not available, define this macro to force any uses of |
|
2380 |
dynamic_cast to cause a compile failure. |
|
2381 |
*/ |
|
2382 |
||
2383 |
#ifdef QT_NO_DYNAMIC_CAST |
|
2384 |
# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check) |
|
2385 |
||
2386 |
template<typename T, typename X> |
|
2387 |
T qt_dynamic_cast_check(X, T* = 0) |
|
2388 |
{ return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; } |
|
2389 |
#endif |
|
2390 |
||
2391 |
/* |
|
2392 |
Some classes do not permit copies to be made of an object. These |
|
2393 |
classes contains a private copy constructor and assignment |
|
2394 |
operator to disable copying (the compiler gives an error message). |
|
2395 |
*/ |
|
2396 |
#define Q_DISABLE_COPY(Class) \ |
|
2397 |
Class(const Class &); \ |
|
2398 |
Class &operator=(const Class &); |
|
2399 |
||
2400 |
class QByteArray; |
|
2401 |
Q_CORE_EXPORT QByteArray qgetenv(const char *varName); |
|
2402 |
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value); |
|
2403 |
||
2404 |
inline int qIntCast(double f) { return int(f); } |
|
2405 |
inline int qIntCast(float f) { return int(f); } |
|
2406 |
||
2407 |
/* |
|
2408 |
Reentrant versions of basic rand() functions for random number generation |
|
2409 |
*/ |
|
2410 |
Q_CORE_EXPORT void qsrand(uint seed); |
|
2411 |
Q_CORE_EXPORT int qrand(); |
|
2412 |
||
2413 |
/* |
|
2414 |
Compat functions that were generated by configure |
|
2415 |
*/ |
|
2416 |
#ifdef QT3_SUPPORT |
|
2417 |
#ifndef QT_PRODUCT_LICENSEE |
|
2418 |
# define QT_PRODUCT_LICENSEE QLibraryInfo::licensee() |
|
2419 |
#endif |
|
2420 |
#ifndef QT_PRODUCT_LICENSE |
|
2421 |
# define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts() |
|
2422 |
#endif |
|
2423 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPath(); |
|
2424 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathDocs(); |
|
2425 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathHeaders(); |
|
2426 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathLibs(); |
|
2427 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathBins(); |
|
2428 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathPlugins(); |
|
2429 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathData(); |
|
2430 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations(); |
|
2431 |
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); |
|
2432 |
#endif |
|
2433 |
||
2434 |
#if defined(Q_OS_SYMBIAN) |
|
2435 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2436 |
#ifdef SYMBIAN_BUILD_GCE |
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
2437 |
#define Q_SYMBIAN_SUPPORTS_SURFACES |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
2438 |
//RWsPointerCursor is fixed, so don't use low performance sprites |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
2439 |
#define Q_SYMBIAN_FIXED_POINTER_CURSORS |
0 | 2440 |
#define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2441 |
#define Q_SYMBIAN_WINDOW_SIZE_CACHE |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2442 |
#define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2443 |
|
0 | 2444 |
//enabling new graphics resources |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2445 |
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2446 |
# define QT_SYMBIAN_SUPPORTS_SGIMAGE |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2447 |
#endif |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2448 |
|
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2449 |
#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2450 |
# define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2451 |
#endif |
0 | 2452 |
#endif |
2453 |
||
2454 |
||
2455 |
//Symbian does not support data imports from a DLL |
|
2456 |
#define Q_NO_DATA_RELOCATION |
|
2457 |
||
2458 |
QT_END_NAMESPACE |
|
2459 |
// forward declare std::exception |
|
2460 |
#ifdef __cplusplus |
|
2461 |
namespace std { class exception; } |
|
2462 |
#endif |
|
2463 |
QT_BEGIN_NAMESPACE |
|
2464 |
Q_CORE_EXPORT void qt_symbian_throwIfError(int error); |
|
2465 |
Q_CORE_EXPORT void qt_symbian_exception2LeaveL(const std::exception& ex); |
|
2466 |
Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex); |
|
2467 |
||
2468 |
#define QT_TRAP_THROWING(_f) \ |
|
2469 |
{ \ |
|
2470 |
TInt ____error; \ |
|
2471 |
TRAP(____error, _f); \ |
|
2472 |
qt_symbian_throwIfError(____error); \ |
|
2473 |
} |
|
2474 |
||
2475 |
#define QT_TRYCATCH_ERROR(_err, _f) \ |
|
2476 |
{ \ |
|
2477 |
_err = KErrNone; \ |
|
2478 |
try { \ |
|
2479 |
_f; \ |
|
2480 |
} catch (const std::exception &____ex) { \ |
|
2481 |
_err = qt_symbian_exception2Error(____ex); \ |
|
2482 |
} \ |
|
2483 |
} |
|
2484 |
||
2485 |
#define QT_TRYCATCH_LEAVING(_f) \ |
|
2486 |
{ \ |
|
2487 |
TInt ____err; \ |
|
2488 |
QT_TRYCATCH_ERROR(____err, _f) \ |
|
2489 |
User::LeaveIfError(____err); \ |
|
2490 |
} |
|
2491 |
#endif |
|
2492 |
||
2493 |
||
2494 |
/* |
|
2495 |
This gives us the possibility to check which modules the user can |
|
2496 |
use. These are purely compile time checks and will generate no code. |
|
2497 |
*/ |
|
2498 |
||
2499 |
/* Qt modules */ |
|
2500 |
#define QT_MODULE_CORE 0x00001 |
|
2501 |
#define QT_MODULE_GUI 0x00002 |
|
2502 |
#define QT_MODULE_NETWORK 0x00004 |
|
2503 |
#define QT_MODULE_OPENGL 0x00008 |
|
2504 |
#define QT_MODULE_SQL 0x00010 |
|
2505 |
#define QT_MODULE_XML 0x00020 |
|
2506 |
#define QT_MODULE_QT3SUPPORTLIGHT 0x00040 |
|
2507 |
#define QT_MODULE_QT3SUPPORT 0x00080 |
|
2508 |
#define QT_MODULE_SVG 0x00100 |
|
2509 |
#define QT_MODULE_ACTIVEQT 0x00200 |
|
2510 |
#define QT_MODULE_GRAPHICSVIEW 0x00400 |
|
2511 |
#define QT_MODULE_SCRIPT 0x00800 |
|
2512 |
#define QT_MODULE_XMLPATTERNS 0x01000 |
|
2513 |
#define QT_MODULE_HELP 0x02000 |
|
2514 |
#define QT_MODULE_TEST 0x04000 |
|
2515 |
#define QT_MODULE_DBUS 0x08000 |
|
2516 |
#define QT_MODULE_SCRIPTTOOLS 0x10000 |
|
2517 |
#define QT_MODULE_OPENVG 0x20000 |
|
2518 |
#define QT_MODULE_MULTIMEDIA 0x40000 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2519 |
#define QT_MODULE_DECLARATIVE 0x80000 |
0 | 2520 |
|
2521 |
/* Qt editions */ |
|
2522 |
#define QT_EDITION_CONSOLE (QT_MODULE_CORE \ |
|
2523 |
| QT_MODULE_NETWORK \ |
|
2524 |
| QT_MODULE_SQL \ |
|
2525 |
| QT_MODULE_SCRIPT \ |
|
2526 |
| QT_MODULE_MULTIMEDIA \ |
|
2527 |
| QT_MODULE_XML \ |
|
2528 |
| QT_MODULE_XMLPATTERNS \ |
|
2529 |
| QT_MODULE_TEST \ |
|
2530 |
| QT_MODULE_DBUS) |
|
2531 |
#define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \ |
|
2532 |
| QT_MODULE_GUI \ |
|
2533 |
| QT_MODULE_QT3SUPPORTLIGHT \ |
|
2534 |
| QT_MODULE_TEST \ |
|
2535 |
| QT_MODULE_DBUS) |
|
2536 |
#define QT_EDITION_OPENSOURCE (QT_MODULE_CORE \ |
|
2537 |
| QT_MODULE_GUI \ |
|
2538 |
| QT_MODULE_NETWORK \ |
|
2539 |
| QT_MODULE_OPENGL \ |
|
2540 |
| QT_MODULE_OPENVG \ |
|
2541 |
| QT_MODULE_SQL \ |
|
2542 |
| QT_MODULE_MULTIMEDIA \ |
|
2543 |
| QT_MODULE_XML \ |
|
2544 |
| QT_MODULE_XMLPATTERNS \ |
|
2545 |
| QT_MODULE_SCRIPT \ |
|
2546 |
| QT_MODULE_SCRIPTTOOLS \ |
|
2547 |
| QT_MODULE_QT3SUPPORTLIGHT \ |
|
2548 |
| QT_MODULE_QT3SUPPORT \ |
|
2549 |
| QT_MODULE_SVG \ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2550 |
| QT_MODULE_DECLARATIVE \ |
0 | 2551 |
| QT_MODULE_GRAPHICSVIEW \ |
2552 |
| QT_MODULE_HELP \ |
|
2553 |
| QT_MODULE_TEST \ |
|
2554 |
| QT_MODULE_DBUS \ |
|
2555 |
| QT_MODULE_ACTIVEQT) |
|
2556 |
#define QT_EDITION_DESKTOP (QT_EDITION_OPENSOURCE) |
|
2557 |
#define QT_EDITION_UNIVERSAL QT_EDITION_DESKTOP |
|
2558 |
#define QT_EDITION_ACADEMIC QT_EDITION_DESKTOP |
|
2559 |
#define QT_EDITION_EDUCATIONAL QT_EDITION_DESKTOP |
|
2560 |
#define QT_EDITION_EVALUATION QT_EDITION_DESKTOP |
|
2561 |
||
2562 |
/* Determine which modules can be used */ |
|
2563 |
#ifndef QT_EDITION |
|
2564 |
# ifdef QT_BUILD_QMAKE |
|
2565 |
# define QT_EDITION QT_EDITION_DESKTOP |
|
2566 |
# else |
|
2567 |
# error "Qt not configured correctly, please run configure" |
|
2568 |
# endif |
|
2569 |
#endif |
|
2570 |
||
2571 |
#define QT_LICENSED_MODULE(x) \ |
|
2572 |
enum QtValidLicenseFor##x##Module { Licensed##x = true }; |
|
2573 |
||
2574 |
/* qdoc is really unhappy with the following block of preprocessor checks, |
|
2575 |
making it difficult to document classes properly after this point. */ |
|
2576 |
||
2577 |
#if (QT_EDITION & QT_MODULE_CORE) |
|
2578 |
QT_LICENSED_MODULE(Core) |
|
2579 |
#endif |
|
2580 |
#if (QT_EDITION & QT_MODULE_GUI) |
|
2581 |
QT_LICENSED_MODULE(Gui) |
|
2582 |
#endif |
|
2583 |
#if (QT_EDITION & QT_MODULE_NETWORK) |
|
2584 |
QT_LICENSED_MODULE(Network) |
|
2585 |
#endif |
|
2586 |
#if (QT_EDITION & QT_MODULE_OPENGL) |
|
2587 |
QT_LICENSED_MODULE(OpenGL) |
|
2588 |
#endif |
|
2589 |
#if (QT_EDITION & QT_MODULE_OPENVG) |
|
2590 |
QT_LICENSED_MODULE(OpenVG) |
|
2591 |
#endif |
|
2592 |
#if (QT_EDITION & QT_MODULE_SQL) |
|
2593 |
QT_LICENSED_MODULE(Sql) |
|
2594 |
#endif |
|
2595 |
#if (QT_EDITION & QT_MODULE_MULTIMEDIA) |
|
2596 |
QT_LICENSED_MODULE(Multimedia) |
|
2597 |
#endif |
|
2598 |
#if (QT_EDITION & QT_MODULE_XML) |
|
2599 |
QT_LICENSED_MODULE(Xml) |
|
2600 |
#endif |
|
2601 |
#if (QT_EDITION & QT_MODULE_XMLPATTERNS) |
|
2602 |
QT_LICENSED_MODULE(XmlPatterns) |
|
2603 |
#endif |
|
2604 |
#if (QT_EDITION & QT_MODULE_HELP) |
|
2605 |
QT_LICENSED_MODULE(Help) |
|
2606 |
#endif |
|
2607 |
#if (QT_EDITION & QT_MODULE_SCRIPT) || defined(QT_BUILD_QMAKE) |
|
2608 |
QT_LICENSED_MODULE(Script) |
|
2609 |
#endif |
|
2610 |
#if (QT_EDITION & QT_MODULE_SCRIPTTOOLS) |
|
2611 |
QT_LICENSED_MODULE(ScriptTools) |
|
2612 |
#endif |
|
2613 |
#if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT) |
|
2614 |
QT_LICENSED_MODULE(Qt3SupportLight) |
|
2615 |
#endif |
|
2616 |
#if (QT_EDITION & QT_MODULE_QT3SUPPORT) |
|
2617 |
QT_LICENSED_MODULE(Qt3Support) |
|
2618 |
#endif |
|
2619 |
#if (QT_EDITION & QT_MODULE_SVG) |
|
2620 |
QT_LICENSED_MODULE(Svg) |
|
2621 |
#endif |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2622 |
#if (QT_EDITION & QT_MODULE_DECLARATIVE) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2623 |
QT_LICENSED_MODULE(Declarative) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2624 |
#endif |
0 | 2625 |
#if (QT_EDITION & QT_MODULE_ACTIVEQT) |
2626 |
QT_LICENSED_MODULE(ActiveQt) |
|
2627 |
#endif |
|
2628 |
#if (QT_EDITION & QT_MODULE_TEST) |
|
2629 |
QT_LICENSED_MODULE(Test) |
|
2630 |
#endif |
|
2631 |
#if (QT_EDITION & QT_MODULE_DBUS) |
|
2632 |
QT_LICENSED_MODULE(DBus) |
|
2633 |
#endif |
|
2634 |
||
2635 |
#define QT_MODULE(x) \ |
|
2636 |
typedef QtValidLicenseFor##x##Module Qt##x##Module; |
|
2637 |
||
2638 |
#ifdef QT_NO_CONCURRENT |
|
2639 |
# define QT_NO_QFUTURE |
|
2640 |
#endif |
|
2641 |
||
2642 |
// MSVC 6.0 and MSVC .NET 2002, can`t handle the map(), etc templates, |
|
2643 |
// but the QFuture class compiles. |
|
2644 |
#if (defined(Q_CC_MSVC) && _MSC_VER <= 1300) |
|
2645 |
# define QT_NO_CONCURRENT |
|
2646 |
#endif |
|
2647 |
||
2648 |
// gcc 3 version has problems with some of the |
|
2649 |
// map/filter overloads. |
|
2650 |
#if defined(Q_CC_GNU) && (__GNUC__ < 4) |
|
2651 |
# define QT_NO_CONCURRENT_MAP |
|
2652 |
# define QT_NO_CONCURRENT_FILTER |
|
2653 |
#endif |
|
2654 |
||
2655 |
#ifdef Q_OS_QNX |
|
2656 |
// QNX doesn't have SYSV style shared memory. Multiprocess QWS apps, |
|
2657 |
// shared fonts and QSystemSemaphore + QSharedMemory are not available |
|
2658 |
# define QT_NO_QWS_MULTIPROCESS |
|
2659 |
# define QT_NO_QWS_SHARE_FONTS |
|
2660 |
# define QT_NO_SYSTEMSEMAPHORE |
|
2661 |
# define QT_NO_SHAREDMEMORY |
|
2662 |
// QNX currently doesn't support forking in a thread, so disable QProcess |
|
2663 |
# define QT_NO_PROCESS |
|
2664 |
#endif |
|
2665 |
||
2666 |
QT_END_NAMESPACE |
|
2667 |
QT_END_HEADER |
|
2668 |
||
2669 |
#endif /* __cplusplus */ |
|
2670 |
||
2671 |
#endif /* QGLOBAL_H */ |