src/corelib/global/qglobal.h
changeset 30 5dc02b23752f
parent 29 b72c6db6890b
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    42 #ifndef QGLOBAL_H
    42 #ifndef QGLOBAL_H
    43 #define QGLOBAL_H
    43 #define QGLOBAL_H
    44 
    44 
    45 #include <stddef.h>
    45 #include <stddef.h>
    46 
    46 
    47 #define QT_VERSION_STR   "4.6.3"
    47 #define QT_VERSION_STR   "4.7.0"
    48 /*
    48 /*
    49    QT_VERSION is (major << 16) + (minor << 8) + patch.
    49    QT_VERSION is (major << 16) + (minor << 8) + patch.
    50 */
    50 */
    51 #define QT_VERSION 0x040603
    51 #define QT_VERSION 0x040700
    52 /*
    52 /*
    53    can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
    53    can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
    54 */
    54 */
    55 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
    55 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
    56 
    56 
   273 #  elif defined(Q_OS_DARWIN32)
   273 #  elif defined(Q_OS_DARWIN32)
   274 #     define Q_OS_MAC32
   274 #     define Q_OS_MAC32
   275 #  endif
   275 #  endif
   276 #endif
   276 #endif
   277 
   277 
   278 #ifdef AUTODETECT_COCOA
   278 #ifdef QT_AUTODETECT_COCOA
   279 #  ifdef Q_OS_MAC64
   279 #  ifdef Q_OS_MAC64
   280 #    define QT_MAC_USE_COCOA 1
   280 #    define QT_MAC_USE_COCOA 1
   281 #    define QT_BUILD_KEY QT_BUILD_KEY_COCOA
   281 #    define QT_BUILD_KEY QT_BUILD_KEY_COCOA
   282 #  else
   282 #  else
   283 #    define QT_BUILD_KEY QT_BUILD_KEY_CARBON
   283 #    define QT_BUILD_KEY QT_BUILD_KEY_CARBON
   670    /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
   670    /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
   671 #    if __SUNPRO_CC >= 0x590
   671 #    if __SUNPRO_CC >= 0x590
   672 #      define Q_ALIGNOF(type)   __alignof__(type)
   672 #      define Q_ALIGNOF(type)   __alignof__(type)
   673 #      define Q_TYPEOF(expr)    __typeof__(expr)
   673 #      define Q_TYPEOF(expr)    __typeof__(expr)
   674 #      define Q_DECL_ALIGN(n)   __attribute__((__aligned__(n)))
   674 #      define Q_DECL_ALIGN(n)   __attribute__((__aligned__(n)))
   675 // using CC 5.9: Warning: attribute visibility is unsupported and will be skipped..
   675 #    endif
   676 //#      define Q_DECL_EXPORT     __attribute__((__visibility__("default")))
   676 #    if __SUNPRO_CC >= 0x550
       
   677 #      define Q_DECL_EXPORT     __global
   677 #    endif
   678 #    endif
   678 #    if __SUNPRO_CC < 0x5a0
   679 #    if __SUNPRO_CC < 0x5a0
   679 #      define Q_NO_TEMPLATE_FRIENDS
   680 #      define Q_NO_TEMPLATE_FRIENDS
   680 #    endif
   681 #    endif
   681 #    if !defined(_BOOL)
   682 #    if !defined(_BOOL)
   860 #   define QT_POINTER_SIZE 8
   861 #   define QT_POINTER_SIZE 8
   861 #  elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
   862 #  elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
   862 #   define QT_POINTER_SIZE 4
   863 #   define QT_POINTER_SIZE 4
   863 #  endif
   864 #  endif
   864 #endif
   865 #endif
       
   866 
       
   867 #define Q_INIT_RESOURCE_EXTERN(name) \
       
   868     extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();
   865 
   869 
   866 #define Q_INIT_RESOURCE(name) \
   870 #define Q_INIT_RESOURCE(name) \
   867     do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();       \
   871     do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();       \
   868         QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0)
   872         QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0)
   869 #define Q_CLEANUP_RESOURCE(name) \
   873 #define Q_CLEANUP_RESOURCE(name) \
  1056 #  else
  1060 #  else
  1057 #     define QT_FASTCALL
  1061 #     define QT_FASTCALL
  1058 #  endif
  1062 #  endif
  1059 #else
  1063 #else
  1060 #  define QT_FASTCALL
  1064 #  define QT_FASTCALL
       
  1065 #endif
       
  1066 
       
  1067 //defines the type for the WNDPROC on windows
       
  1068 //the alignment needs to be forced for sse2 to not crash with mingw
       
  1069 #if defined(Q_WS_WIN)
       
  1070 #  if defined(Q_CC_MINGW)
       
  1071 #    define QT_WIN_CALLBACK CALLBACK __attribute__ ((force_align_arg_pointer))
       
  1072 #  else
       
  1073 #    define QT_WIN_CALLBACK CALLBACK
       
  1074 #  endif
  1061 #endif
  1075 #endif
  1062 
  1076 
  1063 typedef int QNoImplicitBoolCast;
  1077 typedef int QNoImplicitBoolCast;
  1064 
  1078 
  1065 #if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A)
  1079 #if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A)
  1538 #if defined(QT3_SUPPORT)
  1552 #if defined(QT3_SUPPORT)
  1539 inline QT3_SUPPORT bool qt_winUnicode() { return true; }
  1553 inline QT3_SUPPORT bool qt_winUnicode() { return true; }
  1540 inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
  1554 inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
  1541 #endif
  1555 #endif
  1542 
  1556 
       
  1557 // ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE.
  1543 #define QT_WA(unicode, ansi) unicode
  1558 #define QT_WA(unicode, ansi) unicode
  1544 #define QT_WA_INLINE(unicode, ansi) (unicode)
  1559 #define QT_WA_INLINE(unicode, ansi) (unicode)
  1545 
  1560 
  1546 #endif /* Q_WS_WIN */
  1561 #endif /* Q_WS_WIN */
  1547 
  1562