summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-23 21:27:07 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-23 21:27:07 +0200
commitd3a8bc803cd7c4ce106038bfc4b37cdd6bb8e177 (patch)
tree3b6db0d4869f334d0eb4559c5ae457995cbe913e /src/corelib/global
parentd934ddc297f6db94dbc548fe01da64350f13577d (diff)
parent47a7628023610904c6ac52e23fa289f75f349b4e (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/corelib/json/qjsonwriter.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbkeyboard.cpp Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qflags.h15
-rw-r--r--src/corelib/global/qglobal.cpp44
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp1
-rw-r--r--src/corelib/global/qlibraryinfo.h1
-rw-r--r--src/corelib/global/qlogging.h20
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qsysinfo.h2
-rw-r--r--src/corelib/global/qsystemdetection.h8
11 files changed, 85 insertions, 25 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index ada69d081d..fb96ad2732 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -618,7 +618,6 @@
# endif
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
/* C++11 features supported in GCC 4.4: */
-# define Q_COMPILER_ATOMICS
# define Q_COMPILER_AUTO_FUNCTION
# define Q_COMPILER_AUTO_TYPE
# define Q_COMPILER_CLASS_ENUM
@@ -642,6 +641,11 @@
# define Q_COMPILER_RANGE_FOR
# endif
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
+ /* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
+ * However, the implementation is incomplete for most platforms until GCC 4.7:
+ * instead, std::atomic would use an external lock. Since we need an std::atomic
+ * that is behavior-compatible with QBasicAtomic, we only enable it here */
+# define Q_COMPILER_ATOMICS
/* GCC 4.6.x has problems dealing with noexcept expressions,
* so turn the feature on for 4.7 and above, only */
# define Q_COMPILER_NOEXCEPT
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index 6332e2d761..5b7edbafa6 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -97,31 +97,32 @@ public:
inline QFlags(const QFlags &other);
inline QFlags &operator=(const QFlags &other);
#endif
- Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {}
+ Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(Int(f)) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(QFlag f) : i(f) {}
inline QFlags &operator&=(int mask) { i &= mask; return *this; }
inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
+ inline QFlags &operator&=(Enum mask) { i &= Int(mask); return *this; }
inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
- inline QFlags &operator|=(Enum f) { i |= f; return *this; }
+ inline QFlags &operator|=(Enum f) { i |= Int(f); return *this; }
inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
- inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
+ inline QFlags &operator^=(Enum f) { i ^= Int(f); return *this; }
Q_DECL_CONSTEXPR inline operator Int() const { return i; }
Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | Int(f))); }
Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ Int(f))); }
Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); }
Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); }
- Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & Int(f))); }
Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); }
Q_DECL_CONSTEXPR inline bool operator!() const { return !i; }
- Q_DECL_CONSTEXPR inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == Int(f) ); }
+ Q_DECL_CONSTEXPR inline bool testFlag(Enum f) const { return (i & Int(f)) == Int(f) && (Int(f) != 0 || i == Int(f) ); }
private:
Int i;
};
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9995daf1e9..4598f60d5e 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -72,7 +72,7 @@
# include <envLib.h>
#endif
-#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+#if defined(Q_OS_MACX)
#include <CoreServices/CoreServices.h>
#endif
@@ -240,6 +240,12 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
*/
/*!
+ \fn QFlags &QFlags::operator&=(Enum mask)
+
+ \overload
+*/
+
+/*!
\fn QFlags &QFlags::operator|=(QFlags other)
Performs a bitwise OR operation with \a other and stores the
@@ -928,8 +934,8 @@ bool qSharedBuild() Q_DECL_NOTHROW
\endlist
Some constants are defined only on certain platforms. You can use
- the preprocessor symbols Q_OS_WIN and Q_OS_MAC to test that
- the application is compiled under Windows or Mac.
+ the preprocessor symbols Q_OS_WIN and Q_OS_MACX to test that
+ the application is compiled under Windows or OS X.
\sa QLibraryInfo
*/
@@ -1073,6 +1079,27 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
+ \macro Q_OS_MAC
+ \relates <QtGlobal>
+
+ Defined on OS X and iOS (synonym for Q_OS_DARWIN).
+ */
+
+/*!
+ \macro Q_OS_MACX
+ \relates <QtGlobal>
+
+ Defined on OS X.
+ */
+
+/*!
+ \macro Q_OS_IOS
+ \relates <QtGlobal>
+
+ Defined on iOS.
+ */
+
+/*!
\macro Q_OS_WIN
\relates <QtGlobal>
@@ -1395,13 +1422,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
- \macro Q_OS_MAC
- \relates <QtGlobal>
-
- Defined on MAC OS (synonym for Darwin).
- */
-
-/*!
\macro Q_PROCESSOR_ALPHA
\relates <QtGlobal>
@@ -1646,7 +1666,7 @@ static const unsigned int qt_one = 1;
const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
#endif
-#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+#if defined(Q_OS_MACX)
QT_BEGIN_INCLUDE_NAMESPACE
#include "private/qcore_mac_p.h"
@@ -1668,7 +1688,7 @@ Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding e
Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
}
-#endif // defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+#endif // defined(Q_OS_MACX)
#if defined(Q_OS_MAC)
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 0d8a5b1428..2132e555cd 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -203,7 +203,11 @@ typedef quint64 qulonglong;
QT_BEGIN_INCLUDE_NAMESPACE
typedef unsigned char uchar;
typedef unsigned short ushort;
+#if defined(Q_QDOC) || !defined(Q_OS_ANDROID)
typedef unsigned int uint;
+#else
+# include <sys/types.h>
+#endif
typedef unsigned long ulong;
QT_END_INCLUDE_NAMESPACE
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 5fb9640b19..1eaebe5f90 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -291,6 +291,7 @@ static const struct {
{ "Sysroot", "" },
{ "HostPrefix", "" },
{ "HostBinaries", "bin" },
+ { "HostLibraries", "lib" },
{ "HostData", "." },
{ "TargetSpec", "" },
{ "HostSpec", "" },
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 1a00a14caf..b275e018a0 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -82,6 +82,7 @@ public:
SysrootPath,
HostPrefixPath,
HostBinariesPath,
+ HostLibrariesPath,
HostDataPath,
TargetSpecPath,
HostSpecPath,
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index a6f244698d..2b798f9ea0 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -94,22 +94,38 @@ public:
void debug(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
void noDebug(const char *, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
{}
void warning(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
void critical(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
@@ -118,7 +134,11 @@ public:
#endif
void fatal(const char *msg, ...) const Q_DECL_NOTHROW
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 95d9baafd5..74949b86f0 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -293,7 +293,8 @@ public:
WindowType_Mask = 0x000000ff,
MSWindowsFixedSizeDialogHint = 0x00000100,
MSWindowsOwnDC = 0x00000200,
- X11BypassWindowManagerHint = 0x00000400,
+ BypassWindowManagerHint = 0x00000400,
+ X11BypassWindowManagerHint = BypassWindowManagerHint,
FramelessWindowHint = 0x00000800,
WindowTitleHint = 0x00001000,
WindowSystemMenuHint = 0x00002000,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index b6ce9e03fd..9eb0c6b8f2 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1999,6 +1999,12 @@
\value MSWindowsOwnDC Gives the window its own display
context on Windows.
+ \value BypassWindowManagerHint This flag can be used to indicate to the platform plugin
+ that "all" window manager protocols should be disabled. This flag will behave
+ different depending on what operating system the application is running on and
+ what window manager is running. The flag can be used to get a native window
+ with no configuration set.
+
\value X11BypassWindowManagerHint Bypass the window
manager completely. This results in a borderless window
that is not managed at all (i.e., no keyboard input unless
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index edeef3c461..58939cc013 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the FOO module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 0caac3d797..690442d066 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -50,8 +50,9 @@
The operating system, must be one of: (Q_OS_x)
DARWIN - Darwin OS (synonym for Q_OS_MAC)
- MAC - Mac OS X or iOS (iPhoneOS)
- IOS - iOS (treated as a variant of Mac OS)
+ MAC - OS X or iOS (synonym for Q_OS_DARWIN)
+ MACX - OS X
+ IOS - iOS
MSDOS - MS-DOS and Windows
OS2 - OS/2
OS2EMX - XFree86 on OS/2 (not PM)
@@ -166,7 +167,6 @@
#if defined(Q_OS_DARWIN)
# define Q_OS_MAC
-# define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
# if defined(Q_OS_DARWIN64)
# define Q_OS_MAC64
# elif defined(Q_OS_DARWIN32)
@@ -175,6 +175,8 @@
# include <TargetConditionals.h>
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
# define Q_OS_IOS
+# else
+# define Q_OS_MACX
# endif
#endif