diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-17 10:35:59 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-17 10:35:59 (GMT) |
commit | eceeb831ea81f944210c039abdb8db146675e673 (patch) | |
tree | 2469801b461ed7a2f918a502ec2cb5a7ff05f891 /src/corelib/global/qglobal.h | |
parent | f3ec9966ab23d1c4e56e17e593b99165364612ab (diff) | |
parent | cbf6c5b810316efba3ccfb27f05576b8dbfe3890 (diff) | |
download | Qt-eceeb831ea81f944210c039abdb8db146675e673.zip Qt-eceeb831ea81f944210c039abdb8db146675e673.tar.gz Qt-eceeb831ea81f944210c039abdb8db146675e673.tar.bz2 |
Merge remote-tracking branch 'origin/master' into lighthouse-master
Conflicts:
mkspecs/qws/macx-nacl-g++/qplatformdefs.h
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 138 |
1 files changed, 73 insertions, 65 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0bcaeb5..06e19dc 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -322,7 +322,10 @@ namespace QT_NAMESPACE {} # if !defined(MAC_OS_X_VERSION_10_6) # define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1 # endif -# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6) +# if !defined(MAC_OS_X_VERSION_10_7) +# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1 +# endif +# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7) # warning "This version of Mac OS X is unsupported" # endif #endif @@ -1571,6 +1574,7 @@ public: MV_10_4 = 0x0006, MV_10_5 = 0x0007, MV_10_6 = 0x0008, + MV_10_7 = 0x0009, /* codenames */ MV_CHEETAH = MV_10_0, @@ -1579,7 +1583,8 @@ public: MV_PANTHER = MV_10_3, MV_TIGER = MV_10_4, MV_LEOPARD = MV_10_5, - MV_SNOWLEOPARD = MV_10_6 + MV_SNOWLEOPARD = MV_10_6, + MV_LION = MV_10_7 }; static const MacVersion MacintoshVersion; #endif @@ -1680,7 +1685,7 @@ inline void qUnused(T &x) { (void)x; } #endif #ifndef qPrintable -# define qPrintable(string) (string).toLocal8Bit().constData() +# define qPrintable(string) QString(string).toLocal8Bit().constData() #endif Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */ @@ -1828,32 +1833,32 @@ public: inline ~QGlobalStatic() { pointer = 0; } }; -#define Q_GLOBAL_STATIC(TYPE, NAME) \ - static TYPE *NAME() \ - { \ - static TYPE this_##NAME; \ - static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \ - return global_##NAME.pointer; \ +#define Q_GLOBAL_STATIC(TYPE, NAME) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable; \ + static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \ + return thisGlobalStatic.pointer; \ } -#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ - static TYPE *NAME() \ - { \ - static TYPE this_##NAME ARGS; \ - static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \ - return global_##NAME.pointer; \ +#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable ARGS; \ + static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \ + return thisGlobalStatic.pointer; \ } -#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ - static TYPE *NAME() \ - { \ - static TYPE this_##NAME; \ - static QGlobalStatic<TYPE > global_##NAME(0); \ - if (!global_##NAME.pointer) { \ - TYPE *x = global_##NAME.pointer = &this_##NAME; \ - INITIALIZER; \ - } \ - return global_##NAME.pointer; \ +#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable; \ + static QGlobalStatic<TYPE > thisGlobalStatic(0); \ + if (!thisGlobalStatic.pointer) { \ + TYPE *x = thisGlobalStatic.pointer = &thisVariable; \ + INITIALIZER; \ + } \ + return thisGlobalStatic.pointer; \ } #else @@ -1888,50 +1893,50 @@ public: } }; -#define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \ - static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false } - -#define Q_GLOBAL_STATIC(TYPE, NAME) \ - Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ - static TYPE *NAME() \ - { \ - if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ - TYPE *x = new TYPE; \ - if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ - delete x; \ - else \ - static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ - } \ - return this_##NAME.pointer; \ +#define Q_GLOBAL_STATIC(TYPE, NAME) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic<TYPE > thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + TYPE *x = new TYPE; \ + if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \ + delete x; \ + else \ + static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \ + } \ + return thisGlobalStatic.pointer; \ } -#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ - Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ - static TYPE *NAME() \ - { \ - if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ - TYPE *x = new TYPE ARGS; \ - if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ - delete x; \ - else \ - static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ - } \ - return this_##NAME.pointer; \ +#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic<TYPE > thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + TYPE *x = new TYPE ARGS; \ + if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \ + delete x; \ + else \ + static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \ + } \ + return thisGlobalStatic.pointer; \ } -#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ - Q_GLOBAL_STATIC_INIT(TYPE, NAME); \ - static TYPE *NAME() \ - { \ - if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ - QScopedPointer<TYPE > x(new TYPE); \ - INITIALIZER; \ - if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \ - static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ - x.take(); \ - } \ - } \ - return this_##NAME.pointer; \ +#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic<TYPE > thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + QScopedPointer<TYPE > x(new TYPE); \ + INITIALIZER; \ + if (thisGlobalStatic.pointer.testAndSetOrdered(0, x.data())) { \ + static QGlobalStaticDeleter<TYPE > cleanup(thisGlobalStatic); \ + x.take(); \ + } \ + } \ + return thisGlobalStatic.pointer; \ } #endif @@ -2506,7 +2511,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE # define Q_SYMBIAN_TRANSITION_EFFECTS #endif +#endif +#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS +#define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS #endif //Symbian does not support data imports from a DLL |