QtCore/qglobal.h Source File

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