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