summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
commit4159ee840549df11287294f0928e90f35f3e06ff (patch)
tree4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /src/corelib/global
parent59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff)
parentc8c39ecc37c156ac2677de09a26548dfc274b564 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h16
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qglobal.h12
-rw-r--r--src/corelib/global/qnamespace.h5
-rw-r--r--src/corelib/global/qnamespace.qdoc16
-rw-r--r--src/corelib/global/qprocessordetection.h35
-rw-r--r--src/corelib/global/qversiontagging.cpp2
-rw-r--r--src/corelib/global/qversiontagging.h2
8 files changed, 56 insertions, 36 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 5a460e04c5..57745a2fdf 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -922,24 +922,26 @@
# if defined(Q_OS_QNX)
// QNX: test if we are using libcpp (Dinkumware-based).
// Older versions (QNX 650) do not support C++11 features
-// _HAS_CPP0X is defined by toolchains that actually include
+// _HAS_* macros are set to 1 by toolchains that actually include
// Dinkum C++11 libcpp.
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CPP0X)
+# if !__GLIBCXX__
+# if !_HAS_CPP0X
// Disable C++11 features that depend on library support
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
# undef Q_COMPILER_UNICODE_STRINGS
# undef Q_COMPILER_NOEXCEPT
-# endif
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_NULLPTR_T)
+# endif // !_HAS_CPP0X
+# if !_HAS_NULLPTR_T
# undef Q_COMPILER_NULLPTR
-# endif
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CONSTEXPR)
+# endif //!_HAS_NULLPTR_T
+# if !_HAS_CONSTEXPR
// The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min()
// Disable constexpr support on QNX even if the compiler supports it
# undef Q_COMPILER_CONSTEXPR
-# endif
+# endif // !_HAS_CONSTEXPR
+# endif // !__GLIBCXX__
# endif // Q_OS_QNX
# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
&& ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 62308aec9d..8397b31818 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -120,9 +120,7 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
// (if this list becomes too long, consider factoring into a separate file)
Q_STATIC_ASSERT_X(sizeof(int) == 4, "Qt assumes that int is 32 bits");
Q_STATIC_ASSERT_X(UCHAR_MAX == 255, "Qt assumes that char is 8 bits");
-#ifndef QT_BOOTSTRAPPED
-Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "configure test ptrsize failed to correctly determine QT_POINTER_SIZE");
-#endif
+Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined incorrectly");
/*!
\class QFlag
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index d86e410194..db8c60831f 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -193,18 +193,6 @@ typedef unsigned long long quint64; /* 64 bit unsigned */
typedef qint64 qlonglong;
typedef quint64 qulonglong;
-#ifndef QT_POINTER_SIZE
-# if defined(Q_OS_WIN64) || (defined(Q_OS_WINRT) && defined(_M_X64))
-# define QT_POINTER_SIZE 8
-# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
-# define QT_POINTER_SIZE 4
-# elif defined(Q_OS_ANDROID)
-# define QT_POINTER_SIZE 4 // ### Add auto-detection to Windows configure
-# elif !defined(QT_BOOTSTRAPPED)
-# error could not determine QT_POINTER_SIZE
-# endif
-#endif
-
/*
Useful type definitions for Qt
*/
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 056e519e56..45594d1914 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -497,8 +497,9 @@ public:
AA_UseSoftwareOpenGL = 17,
AA_ShareOpenGLContexts = 18,
AA_SetPalette = 19,
- AA_NoHighDpiScaling = 20,
- AA_UseStyleSheetPropagationInWidgetStyles = 21, // ### Qt 6: remove me
+ AA_EnableHighDpiScaling = 20,
+ AA_DisableHighDpiScaling = 21,
+ AA_UseStyleSheetPropagationInWidgetStyles = 22, // ### Qt 6: remove me
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 8568dfd97c..df376405e0 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -208,10 +208,22 @@
\value AA_SetPalette Indicates whether a palette was explicitly set on the
QApplication/QGuiApplication. This value has been added in Qt 5.5.
- \value AA_NoHighDpiScaling Disables all high-DPI scaling in Qt, exposing window
+ \value AA_EnableHighDpiScaling. Enables high-DPI scaling in Qt on supported
+ platforms (see also \l{High DPI Displays}). Supported platforms are
+ X11, Windows and Android. Enabling makes Qt scale the main (device
+ independent) coordinate system according to display scale factors
+ provided by the operating system. This corresponds to setting the
+ QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1. This value
+ has been added in Qt 5.6. This attribute must be set before
+ Q(Gui)Application is constructed.
+
+ \value AA_DisableHighDpiScaling Disables high-DPI scaling in Qt, exposing window
system coordinates. Note that the window system may do its own scaling,
so this does not guarantee that QPaintDevice::devicePixelRatio() will
- be equal to 1. This value has been added in Qt 5.6.
+ be equal to 1. In addition, scale factors set by QT_SCALE_FACTOR will not
+ be affected. This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR
+ environment variable to 0. This value has been added in Qt 5.6. This
+ attribute must be set before Q(Gui)Application is constructed.
\value AA_UseStyleSheetPropagationInWidgetStyles By default, Qt Style Sheets
disable regular QWidget palette and font propagation. When this flag
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index a026224021..4b75872bb6 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -91,6 +91,7 @@
# define Q_PROCESSOR_ARM
# if defined(__aarch64__)
# define Q_PROCESSOR_ARM_64
+# define Q_PROCESSOR_WORDSIZE 8
# else
# define Q_PROCESSOR_ARM_32
# endif
@@ -228,6 +229,7 @@
# endif
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
# define Q_PROCESSOR_MIPS_64
+# define Q_PROCESSOR_WORDSIZE 8
# endif
# if defined(__MIPSEL__)
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
@@ -252,6 +254,7 @@
# define Q_PROCESSOR_POWER
# if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
# define Q_PROCESSOR_POWER_64
+# define Q_PROCESSOR_WORDSIZE 8
# else
# define Q_PROCESSOR_POWER_32
# endif
@@ -323,6 +326,28 @@
#endif
/*
+ Size of a pointer and the machine register size. We detect a 64-bit system by:
+ * GCC and compatible compilers (Clang, ICC on OS X and Windows) always define
+ __SIZEOF_POINTER__. This catches all known cases of ILP32 builds on 64-bit
+ processors.
+ * Most other Unix compilers define __LP64__ or _LP64 on 64-bit mode
+ (Long and Pointer 64-bit)
+ * If Q_PROCESSOR_WORDSIZE was defined above, it's assumed to match the pointer
+ size.
+ Otherwise, we assume to be 32-bit and then check in qglobal.cpp that it is right.
+*/
+
+#if defined __SIZEOF_POINTER__
+# define QT_POINTER_SIZE __SIZEOF_POINTER__
+#elif defined(__LP64__) || defined(_LP64)
+# define QT_POINTER_SIZE 8
+#elif defined(Q_PROCESSOR_WORDSIZE)
+# define QT_POINTER_SIZE Q_PROCESSOR_WORDSIZE
+#else
+# define QT_POINTER_SIZE 4
+#endif
+
+/*
Define Q_PROCESSOR_WORDSIZE to be the size of the machine's word (usually,
the size of the register). On some architectures where a pointer could be
smaller than the register, the macro is defined above.
@@ -330,14 +355,8 @@
Falls back to QT_POINTER_SIZE if not set explicitly for the platform.
*/
#ifndef Q_PROCESSOR_WORDSIZE
-# ifdef __SIZEOF_POINTER__
- /* GCC & friends define this */
-# define Q_PROCESSOR_WORDSIZE __SIZEOF_POINTER__
-# elif defined(_LP64) || defined(__LP64__) || defined(WIN64) || defined(_WIN64)
-# define Q_PROCESSOR_WORDSIZE 8
-# else
-# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE
-# endif
+# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE
#endif
+
#endif // QPROCESSORDETECTION_H
diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp
index fc81d9bb93..e7524f39ef 100644
--- a/src/corelib/global/qversiontagging.cpp
+++ b/src/corelib/global/qversiontagging.cpp
@@ -36,7 +36,7 @@
#define SYM QT_MANGLE_NAMESPACE(qt_version_tag)
//#define SSYM QT_STRINGIFY(SYM)
-#if defined(Q_CC_GNU) && defined(Q_OF_ELF)
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID)
# define make_versioned_symbol2(sym, m, n, separator) \
Q_CORE_EXPORT extern const char sym ## _ ## m ## _ ## n = 0; \
asm(".symver " QT_STRINGIFY(sym) "_" QT_STRINGIFY(m) "_" QT_STRINGIFY(n) ", " \
diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h
index 22e6e82a58..4a1c01c89d 100644
--- a/src/corelib/global/qversiontagging.h
+++ b/src/corelib/global/qversiontagging.h
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
#if defined(QT_BUILD_CORE_LIB) || defined(QT_BOOTSTRAPPED) || defined(QT_NO_VERSION_TAGGING)
// don't make tags in QtCore, bootstrapped systems or if the user asked not to
-#elif defined(Q_CC_GNU)
+#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID)
# if defined(Q_PROCESSOR_X86) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD_KERNEL))
# ifdef __LP64__
# define QT_VERSION_TAG_RELOC(sym) ".quad " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"