eglfs: Unify the native resource getters

Similarly to how it's done in xcb. And add support for eglwindow since
the WId will soon once again cease to be an EGLNativeWindowType.

Change-Id: I0e3b86a21179439821550c9423f0e747ccae5897
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
docs: QT_STATICPLUGIN is needed when building a plugin, not application.

Change-Id: Ifcdf2df6adad7511730af3f24d4d4c82aa78e61f
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
iOS: Compare similar types when setting up QPlatformScreen

[NSArray count] returns an NSUInteger (unsigned long).

Change-Id: I3b1c6720e9503ed181f01a7e737de07a277f7bde
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Strengthen check for combined QMAKE_EXTRA_COMPILER with variable output

The pattern ${QMAKE_ needs to be at the beginning of the line, or not
start with a $ (which would make it a regular qmake variable).

Also, it's fine that the variable is of the QMAKE_VAR_foo type, as
these variables are resolved at generator time, but are constant
and do not depend on the inputs. This means we have to replace
extra variables in the output.

Change-Id: I21ad24ae770f2137e2d5d92a20ee54e2f3f4ca06
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Sanitize QMAKE_EXTRA_COMPILERS paths in makefiles

There was a mismatch of how we sanitized paths for dependencies of the
target and how those dependencies were sanitized (or not sanitized),
resulting in the target depending on 'some/path/foo.o' while the
extra compiler target was named 'some/path//foo.o', with an extra
slash. This confused 'make' enough to decide that it didn't know
how to build the dependencies for the target.

Change-Id: I181b86c291286cbbbb1f7b4c3b929a5f1dc163a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
qmake: Don't create OBJECTS_DIR and friends for TEMPLATE = subdirs

A bunch of empty and never-to-be-used directories makes the build tree
noisy and harder to navigate.

Change-Id: Iebef91c82d58a8d6a0047fb5439d50eb6806f557
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
qmake: Expose ARGC to qmake functions to be able to check argument count

ARGS already exists, but is a flattened list of the arguments, so both
foo(bar, baz) and foo(bar baz) will give count(ARGS, 2), making it
unreliable for validating arguments to qmake functions.

Change-Id: I0bcc16614c64000169431327da48fd1a26708e67
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
QAnimationGroup: avoid undefined behavior

The existing code performed a downcast from QObject* to QAbstractAnimation*
at a time when the former QAbstractAnimation only is a QObject anymore.
The comment indicates that this was understood at the time of writing (or
else a little later), but it drew the wrong conclusions.

Statically downcasting a type whose dynamic type is (no longer) of the
target type is undefined behavior.

This change fixes the code to (implicitly) cast _up_ to QObject and
compare at that level.

Says Clang:
src/corelib/animation/qanimationgroup.cpp:278:33: runtime error:
 downcast of address 0x000002966ab0 which does not point to an object of type 'QAbstractAnimation'
 0x000002966ab0: note: object is of type 'QObject'
 00 00 00 00  80 d7 e6 d7 88 2b 00 00  70 7b 96 02 00 00 00 00  61 00 6e 00 6e 00 6f 00  21 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'QObject'

Change-Id: I51d6277020d0ff32cd7b80a8cddcf2cda1a626a6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QMutex: fix race on 'owner' in the recursive case

The read from 'owner' for comparison with 'self' in QRecursiveMutexPrivate::lock()
is not synchronized with the write to 'owner' in the same function further down,
and neither operation is atomic.

Fix by making 'owner' an atomic pointer.

Change-Id: I186b88575589da0dce5827a1e17ceb4ce599ed02
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
qatomic_cxx11: fix fetchAndAdd*()

In qatomic_cxx11, the 'Type' is std::atomic<T>, whose fetch_add method,
used in fetchAndAdd*(), already does the right thing for T* with sizeof(T) > 1.
The code, however, applied 'AddScale' to the 'valueToAdd', thus becoming
incompatible with normal pointer arithmetics.

This is very apparent when one goes to the length of actually testing
qatomic_cxx11 with tst_QAtomicPointer (which is non-trivial, since the
-c++11 configure option currently doesn't have an effect on tests/auto).

To fix, remove the AddScale factor.

Change-Id: I7507203af3b7df31d8322b31a6a1a33ca847d224
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>