Commit Graph

30348 Commits

Author SHA1 Message Date
Kai Koehne
ed7f77071d Replace custom type traits with std one's
Remove most type traits from qtypetraits.h, but keep the custom
implementation of is_signed/is_unsigned. This gets rid of
BSD-3 licensed code from Google in a public header (hugh!).

The custom implementations for is_signed/is_unsigned are kept
because the implementations in gcc's standard headers do not
work as we expect for enums - both is_signed and is_unsigned
always returns false there - see also
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027

[ChangeLog][QtCore][General] Qt now relies on type traits from
the C++ standard library.

Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-08 15:31:17 +00:00
Kai Koehne
b5fa247102 QStandardPaths: Do not check whether path exists (Windows)
It's arguably better to return a non-existing location than no location
at all. This makes it in line with the documentation for e.g.
QStandardPaths::writableLocation that says

  Note: The storage location returned can be a directory that does not
  exist; i.e., it may need to be created by the system or the user.

Finally, this was also the behavior of code that used
SHGetSpecialFolderPath before.

Change-Id: I5ee44747a38434535610e45a4d303b36ef79d42a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-08 15:30:42 +00:00
Kai Koehne
aa73a7026f QStandardPaths: Replace deprecated Win32 SHGetSpecialFolderPath
SHGetSpecialFolderPath is declared 'unsupported' by Microsoft, and has
problems with non-ASCII characters. Replace it by the newer
SHGetKnownFolderPath.

To fix compilation with MinGW, we have to link in libuuid also in
the bootstrapped tools. The alternative is redefining all GUID's
(like we did for FOLDERID_Downloads), which is arguably less elegant.

Task-number: QTBUG-50570
Change-Id: If99be559bc72de3734ae1fa4d50f960659739898
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-08 15:30:39 +00:00
Kai Koehne
aa7e764058 MinGW: Explicitly define NTDDI_VERSION
Define NTDDI_VERSION, just like _WIN32_WINNT, to be Windows Vista.
Usually NTDDI_VERSION is automatically set by MinGW headers to the value
that matches _WIN32_WINNT. However, for precompiled headers the inclusion
order is that _WIN32_WINNT is set _after_ the relevant MinGW header is
parsed, so this can fail.

The alternative would be to set _WIN32_WINNT via a compiler flag, e.g.
in the mkspecs.

Change-Id: Id59e7083f0d3e00491b54e87647c6c9fabb99795
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-08 15:30:33 +00:00
Friedemann Kleint
d7bcdc3a44 QStyleHelper::uniqueName(): Improve palette pixmap cache key
Use QDataStream to obtain cache key for a palettes that are different
from the default QPalette. This results in unique keys for palettes
created from QStyleSheetStyle's render rules.

Task-number: QTBUG-56743
Change-Id: Icbfe165f705ef3e1c9e88cfc9dca88ff1d1e81e6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-11-08 14:32:37 +00:00
Morten Johan Sørvig
356f5bbac3 Cocoa: Make child window cursors work correctly
The existing cursor logic had a couple of issues:

- It made the faulty assumption that we could not use
the NSWindow invalidateCursorRectsForView API for
child NSViews.

- It used NSWindow invalidateCursorRectsForView and
NSView resetCursorRects. This API has been replaced
by the more general NSTrackingArea API.

- It did not implement falling back to the parent
window cursor if the current window has no cursor
set.

Document that QWindow cursors work the same way as
QWidget cursors in that a QWindow with no set cursor
will fall back to the parent window cursor.

Change the cocoa platform code to use NSTrackingArea
exclusively and implement NSView cursorUpdate which
sets the cursor. Handle immediate change on QWindow::
setCursor() manually.

Add QWindow::effectiveWindowCursor() and
applyEffectiveWindowCursor() which finds the correct
window cursor.

Add a manual test for the child window, child widget,
and QWidget::createWindowChild cases.

Task-number: QTBUG-33479
Task-number: QTBUG-52023
Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-08 12:30:45 +00:00
Morten Johan Sørvig
8f2eb9b43c Prevent stale QOpenGLContext fbo pointer
There is logic for clearing the qgl_curent_fbo pointer
in release(), but it is not always called, causing
the pointer to become stale on QOpenGLFramebufferObject
deletion.

As a last resort, clear the qgl_curent_fbo pointer
on the current context if it’s pointing to the object
that is being deleted.

Change-Id: I36cca511da295412332193524219e32607ef8261
Task-number: QTBUG-56639
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2016-11-08 12:30:24 +00:00
Gabriel de Dietrich
ae8d3d69d6 macOS: Clear event dispatcher interrupt state
A pending interrupt of a QEventLoop may interfere with
native runModal calls, resulting in Cocoa's main event
loop to be stopped unexpectedly.

After commit 9ab60b9c processEvents() no longer resets
the event dispatcher interrupt flag.

Add QCocoaEventDispatcher::clearCurrentThreadCocoa
EventDispatcherInterruptFlag(). Use it to clear the
interrupt state before calling runModal and variants.

Work around the inability to use platform API in
the print support code.

Change-Id: I52f26f99a63cbb46969db42f65b09a3c3119ad15
Task-number: QTBUG-56746
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-11-08 12:30:06 +00:00
Liang Qi
ef5b4d2ada Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8 2016-11-08 12:16:18 +00:00
Paul Olav Tvete
ffe72840a3 Only turn off font hinting when scale is != 1
KDE will set the screen scale factors to 1 by default. Make sure
we don't turn off font hinting in that case.

Task-number: QTBUG-56797
Change-Id: Ieab18a7cfe4c1cb7087caab4d881932a4a991bc8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-11-08 11:32:02 +00:00
Gabriel de Dietrich
e79b40ee8f macOS: Clear event dispatcher interrupt state
A pending interrupt of a QEventLoop may interfere with
native runModal calls, resulting in Cocoa's main event
loop to be stopped unexpectedly.

After commit 9ab60b9c processEvents() no longer resets
the event dispatcher interrupt flag.

Add QCocoaEventDispatcher::clearCurrentThreadCocoa
EventDispatcherInterruptFlag(). Use it to clear the
interrupt state before calling runModal and variants.

Work around the inability to use platform API in
the print support code.

Change-Id: I3e03e7ec21ff6c49442c7a6e803a7200aac0b58d
Task-number: QTBUG-56746
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-11-08 10:45:45 +00:00
Allan Sandfeld Jensen
baebb6aa26 QVariant to QJsonValue::Null conversion
Adds a few missing parts of the conversion from QVariant to QJsonValue
after the introduction of the nullptr QVariant. The conversion the other
way is already implemented.

Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-08 09:50:32 +00:00
Liang Qi
9d50df5511 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/corelib/tools/qalgorithms.h

Change-Id: Ib8ce4d5d9ecd5b9c166d5b8b44e58f3e4e7283ff
2016-11-08 10:01:50 +01:00
Andrew Knight
c647728652 Fix developer build with -no-feature-cursor
Change-Id: I3ec22f212ad68baa788fcea2e7340c2f53bfc8a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-08 07:35:15 +00:00
Andrew Knight
14805de3d9 Fix build with -no-feature-cursor
Change-Id: I0644342c56facefab611f981690d0c7a2a460e7e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-11-08 07:35:09 +00:00
Maurice Kalinowski
fe51dbac3d winrt: Fix potential memory corruption
The timerInfo list might get accessed concurrently and cause references
to become dangling. Hence, we need to protect usages with a mutex.
According to tests/benchmark there is no impact on performance.

Task-number: QTBUG-56756
Change-Id: I4bdffccff70d2dca99f4a39defad438afe571ada
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-08 07:32:43 +00:00
Oliver Wolff
c972c452e2 winrt: Proper guarding by readMutex
Commented its purpose and the guarded members for
readMutex.

Fixed places where guarded members were accessed without
using the mutex.

Use QMutexLocker instead of manually (un-)locking the
mutex.

Task-number: QTBUG-44357
Change-Id: I3049bb0df30f00659dc284c8e30ad7503c11e7c6
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-08 06:27:59 +00:00
Samuli Piippo
969bb10eed Enable cross_compile when sysroot is used
The crossCompile test checked only if platform and xplatform are different
(which is the usual case), but in yocto builds cross compilation is done
by setting both platform and xplatform to the same target mkspec and using
host tools from -external-hostbindir.

Change-Id: Ib4ae3975a52196d9c0ad52b5b5e9ccd7c1bfe883
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-08 04:32:17 +00:00
Friedemann Kleint
146a2eef5f Re-add configure option for Direct2D QPA plugin
This also allows us to enable auto-detection for it.

Change-Id: I7639ab533553f02e691e6f6b8cdd8dff19d91809
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-07 18:52:02 +00:00
Oswald Buddenhagen
25a2717f66 fix debug-only builds on debug-and-release platforms
this actually affects only non-framework Darwin builds - debug-only
framework builds are impossible, and Windows is always debug-and-release.

Change-Id: Ia79dbbefc5750168ebd8967fe4afbe173f55a0d6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-07 13:02:44 +00:00
Oswald Buddenhagen
b4979082b8 don't log silent tests to config.log
they were already omitted from the console output; there is no need to
spam the log with them (their completion was not logged, either).

Change-Id: I32c97413d2e6ceb18ee61356855cc6a7fa2222bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:37 +00:00
Oswald Buddenhagen
6c7f81cac9 don't write "Checking for ..." to config.log
the more precise test/library name is already logged.

Change-Id: I73d3229a9e20a0024582b18bfe9f2848cab5f4ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:27 +00:00
Oswald Buddenhagen
f13b18dc0c remove redundancy from the build type report with -force-debug-info
it's a bit pointless to state "(with debug info)" also for the default
build mode.

Change-Id: I99563c424752c735a3157776ef4fe5252ebd3900
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:24 +00:00
Oswald Buddenhagen
dfbfc4915b fix handling of -optimized-tools
this option makes sense only when the default build is debug (regardless
of whether the release build is also enabled), as it overrides the
default.

Change-Id: I29f87430242a7d8239f13f0b33f6eebe098d9cf7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:20 +00:00
Oswald Buddenhagen
c804033f36 don't attempt to install the target of header-only modules
they have none.

Change-Id: I1e5ffa9960c4fac3c708be4820fb40e7909569c8
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:17 +00:00
Oswald Buddenhagen
7ac15ab0ff don't clear config.log unless re-checking
it is counterproductive to clear the log when cached test results are
used, as that makes it hard to determine how they came to be.

-recheck isn't as clear-cut as -recheck-all, as only part of the results
is discarded, and we can't reasonably discard only part of the log. i
opted for clearing the log entirely, as having both the old and new
results in the log would be probably quite confusing.

Change-Id: Ibb391f2ba2ea86d73c23365d46cc66ed8a2158d6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:14 +00:00
Oswald Buddenhagen
2ad4d75754 move empty cache() call back to configure.prf
the new configure system doesn't use this type of caching. also, it's
invoked via qt_parts.prf, which actually has the same call.

Change-Id: Ifa1e810e24330b59a1eb9f883eb0500642a212f3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:10 +00:00
Oswald Buddenhagen
4b1115742a invert the logic of the c++98 default test
this is much more intuitive, and actually produces a sensible result
with configure -recheck after a compiler upgrade.

Change-Id: Icfa0b85377d9fc014e66490c8ebf6c9236df978e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:06 +00:00
Oswald Buddenhagen
66ad9668f3 fix iteration over a feature's outputs
use precalculated path instead of incorrectly assembling it from
scratch. it accidentally worked when the features happened to be in the
right order, as the iteration variable 'feature' from the calling
function was inherited. however, if the feature was accessed via
dependency resolution, things blew up.

amends 90eee08b3e, which presumably came to be this way due to a missing
adjustment to a refactoring.

Change-Id: I78b0acc0682cfc27a458df014ce14262a65c6241
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:02:02 +00:00
Oswald Buddenhagen
890a4d40ec nuke obsolete comment
amends 56ee007b3.

Change-Id: Ida4f79ae72f185ce1f4cca9add30e3084da9c5bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 13:01:58 +00:00
Oswald Buddenhagen
eda3184a67 fix icpc version detection
the regex didn't match the actual output ("icpc (ICC) 17.0.0 20160721"),
and the code failed to concatenate the lines (broken in 492d7d14fc, as
for clang).

but using -dumpversion (as we do for g++) is more elegant anyway, so do
it instead.

Change-Id: I328bbfab9c08d6e660c3f1ec51554d9f877b8f66
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-07 13:01:55 +00:00
Lars Knoll
6172ebaf30 Fix compiler version detection for clang
Concatenate the multi line output from clang into one line before parsing
it. This got broken in 492d7d14fc.

Change-Id: I282d69932c5851f229213d7ef1ca6a78cd56c8c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-07 08:53:27 +00:00
Richard Moe Gustavsen
68a0bd8592 iOS, mkspec: only link in qiosnsphotolibrarysupport for iOS
The plugin depends on AssetLibrary.framework, which is only
available for iOS.

Change-Id: I798c87b57881210ced8e4a7399c1e45d130ee357
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-07 08:50:16 +00:00
Richard Moe Gustavsen
91c0afdcbf iOS: only build nsphotolibrarysupport for iOS
The plugin depends on AssetLibrary.framework, which is only
available for iOS.

Change-Id: Ic7b3c4ffb4d26808d2120e46593cb4e191e2c10b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-07 08:50:07 +00:00
Richard Moe Gustavsen
a07e77a99a iOS: fix 'incompatible pointer type' compiler warning
Change-Id: I01bb7516a3600dd1dbd71dd6989f541494840abc
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-07 08:45:14 +00:00
Eskil Abrahamsen Blomfeldt
95d1273548 Windows: Don't claim bitmap fonts support all standard sizes
We were throwing away important information by claiming that all
fonts support all the standard sizes in QFontDatabase on Windows
This caused the font dialog to list unsupported sizes for bitmap
fonts, unlike the native font dialog.

We would also claim to support creating bitmap fonts at
unsupported sizes, which would lead to
1. QFontInfo(font).pointSize() would return the requested size,
not the actual rendered size.
2. Bitmap fonts created at 64 pixels and higher would be invisible.

On Mac, there are no system bitmap fonts, and the use is not very
common, but installing some bitmap fonts on the system, it does
seem to ignore the sizes supported in the font and just displays
the standard list instead, so we keep the current behavior there.

[ChangeLog][QtGui][Text] Fixed list of supported sizes for
bitmap fonts on Windows.

Task-number: QTBUG-56672
Change-Id: Idbec2db9eb3381ab5ddf6259bd2befcba9b93564
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 08:32:37 +00:00
Samuli Piippo
c5f1828424 Fix freetype detection on QNX
Pass qtConfLibrary_freetype test even when the .../freetype2 folder
is not found, so that freetype and fontconfig config.tests are run.
This fixes freetype detection on QNX, since the freetype headers are
located in the default .../include folder.

Task-number: QTBUG-56861
Change-Id: Ic8d72e6509195acd2d22a70603df850361f07b34
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-07 07:26:29 +00:00
Oswald Buddenhagen
2f5b7157f5 remove dependencies from sync.profile
the CI obtains them from the qt5 super repo nowadays.

Change-Id: I146e6a74763f32bee6651f427dd3664a1236ea0e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2016-11-05 21:04:25 +00:00
Andrew Knight
b18a4de814 Register Qt::TextFlag with QT_Q_ENUM
By some unfortunate oversight, this enum was never registered.

Change-Id: I2227ccf294d2cf717187a3dcaaf4cbfacc4ac65d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-05 10:15:03 +00:00
Tor Arne Vestbø
a21ffd44b3 Use async delivery when flushing events from secondary threads
Commit 33d748bb8 (Allow granular synchronous and asynchronous delivery of
QPA events) replaced a postWindowSystemEvent() with a SynchronousDelivery,
which was completely broken, as the delivery is already guarded by a mutex
wait.

Change-Id: I929fddc4e3403f943e8fe0677b5a46bf58419575
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-11-04 23:23:23 +00:00
Thiago Macieira
ea9a8672a1 Fix build with ICC on macOS: <atomic> is properly supported
I'm guess I introduced the regression in the commit
18ed6f20ad, which I wasn't sure about.

Change-Id: Ic46ff326a6ba46bc877cfffd14839f84fdf796e7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-04 16:32:54 +00:00
Kai Koehne
02167870c3 Use new "Files" property in testlib 3rdparty documentation
Change-Id: I4ecef274f4afe0b1a25502fb64b2213a7bdb2853
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-04 15:20:12 +00:00
Richard Moe Gustavsen
6a4aaa3477 iOS: remove wrong file include after upstream merge
qiosfileenginefactory.h is now a part of the optional plugin.

Amends d7e49801

Change-Id: Ia1854145f54e4278ab5c0020361915f476d48cc9
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-11-04 12:17:19 +00:00
Kai Koehne
dd876ccb66 Add missing QBIG5CODEC_LICENSE.txt file
Add file that was forgotten in eb96813976.

Change-Id: Ib288bfc1f1f9cb4857e42f2fa3fe750e23b56aea
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-04 11:48:47 +00:00
Friedemann Kleint
da9ddb1e32 Direct2D QPA config test: Test for presence of IDXGISurface1
Partial Direct2D was added to recent versions of MinGW, which made the
config test pass but is not sufficient to actually build the plugin.
Check for IDXGISurface1 in addition.

Change-Id: Ie108f5735ceb0a44934429b0fd2213612ed28848
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-04 11:22:29 +00:00
Eskil Abrahamsen Blomfeldt
1ba0cfab30 Windows: Fix high-dpi text rendering
In change ce2ae6ebd8 we added support for
hinted rendering to the DirectWrite engine. Previously, we would just
use the DirectWrite engine for all text rendering in high-dpi and assume
we would get only vertical hinting, but since the default changed, we
ended up scaling hinted text and the resulting text layouts were a mess.

Task-number: QTBUG-56841
Change-Id: I52101ea264878138de41878d1677c0ef8b522e78
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-04 11:20:31 +00:00
Liang Qi
e918605f42 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/json/qjsonparser.cpp
	src/gui/opengl/qopengl.cpp

Change-Id: Ib4d3208398399691839e6c6eaeb9006f99e3a62b
2016-11-04 11:39:15 +01:00
Joerg Bornemann
c0c75b3c20 vcxproj generator: Support the /DEBUG:FASTLINK option of VS 2015
Make qmake understand the /DEBUG:FASTLINK option in QMAKE_LFLAGS, and
write the corresponding value correctly to VS 2015 project files.

Task-number: QTBUG-55591
Change-Id: I670375ed1523a5ab96bb3cce28635785564edba8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-04 09:55:07 +00:00
Lars Knoll
15df60239d Fix OOM crashes for huge json documents
Check all places where we reallocate our internal data structure
and return a DocumentTooLarge parse error if we can't get enough
memory.

Change-Id: I006d0170d941837220c7dad0508571b68e2cbfd7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kati Kankaanpaa <kati.kankaanpaa@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-04 07:53:39 +00:00
Thiago Macieira
4b6784b49c Stop using readdir_r: glibc deprecated it and it's not a good idea
POSIX does not require that readdir() be reentrant even for operations
on different dirent objects, but all implementations (according to the
glibc documentation) already do that. Moreover, it's not a good idea to
use readdir_r since the buffer space is limited by the caller, so
certain file names may be too long (ENAMETOOLONG) -- we had a workaround
for QNX, but for no other OS. According to the glibc documentation, it
is expected that POSIX will mark readdir_r obsolete and instead require
some form of reentrancy for readdir.

This commit makes everyone use readdir instead. The macros in
qplatformdefs.h are left behind in case someone else is using them.

With glibc 2.24, we started getting:

 qplatformdefs.h:150:35: warning: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations]
 qfilesystemiterator_unix.cpp:112:17: note: in expansion of macro ‘QT_READDIR_R’

Task-number: QTBUG-56088
Change-Id: I33dc971f005a4848bb8ffffd14749b4082f62e69
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2016-11-03 15:31:33 +00:00