summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-11-08 17:35:03 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-14 09:45:10 +0100
commit0109f86e51497141516c567b0640128e167cc124 (patch)
treed093f117a6a74fa209cbee6c9f4e054d9b9b8344 /src/corelib
parent578e6d6834ae8608fb98f1f871e7bd21d64aaf1e (diff)
Don't use deprecated functions on Mac OS X
io/qfilesystemwatcher_fsevents.cpp:346:15: warning: 'stat64' is deprecated [-Wdeprecated-declarations] if (::stat64(it->absolutePath, &newInfo) == 0) { ^ According to 'man 2 stat' on Mac OS X, the stat64() function is deprecated in 10.6 and above. Instead, we are supposed to define the _DARWIN_USE_64_BIT_INODE which enables the 64-bit ino_t member in the stat struct and uses function symbol suffixes to call the correct version of stat with 64-bit inode support. Change-Id: I697374186c7f4d69df783f06962ca5644222194d Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp10
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents_p.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index 6ae6e388e1..95da897974 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-
+#define _DARWIN_USE_64_BIT_INODE
#include <qplatformdefs.h>
#include "qfilesystemwatcher.h"
@@ -72,7 +72,7 @@ static bool operator==(const struct ::timespec &left, const struct ::timespec &r
&& left.tv_nsec == right.tv_nsec;
}
-static bool operator==(const struct ::stat64 &left, const struct ::stat64 &right)
+static bool operator==(const struct ::stat &left, const struct ::stat &right)
{
return left.st_dev == right.st_dev
&& left.st_mode == right.st_mode
@@ -85,7 +85,7 @@ static bool operator==(const struct ::stat64 &left, const struct ::stat64 &right
&& left.st_flags == right.st_flags;
}
-static bool operator!=(const struct ::stat64 &left, const struct ::stat64 &right)
+static bool operator!=(const struct ::stat &left, const struct ::stat &right)
{
return !(operator==(left, right));
}
@@ -342,8 +342,8 @@ void QFSEventsFileSystemWatcherEngine::updateList(PathInfoList &list, bool direc
PathInfoList::iterator End = list.end();
PathInfoList::iterator it = list.begin();
while (it != End) {
- struct ::stat64 newInfo;
- if (::stat64(it->absolutePath, &newInfo) == 0) {
+ struct ::stat newInfo;
+ if (::stat(it->absolutePath, &newInfo) == 0) {
if (emitSignals) {
if (newInfo != it->savedInfo) {
it->savedInfo = newInfo;
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
index 2466a6e3d8..3830002c0a 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h
+++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
@@ -75,7 +75,7 @@ typedef uint64_t FSEventStreamEventId;
QT_BEGIN_NAMESPACE
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-// Yes, I use a stat64 element here. QFileInfo requires too much knowledge about implementation
+// Yes, I use a stat element here. QFileInfo requires too much knowledge about implementation
// details to be used as a long-standing record. Since I'm going to have to store this information, I can
// do the stat myself too.
struct PathInfo {
@@ -83,7 +83,7 @@ struct PathInfo {
: originalPath(path), absolutePath(absPath) {}
QString originalPath; // The path we need to emit
QByteArray absolutePath; // The path we need to stat.
- struct ::stat64 savedInfo; // All the info for the path so we can compare it.
+ struct ::stat savedInfo; // All the info for the path so we can compare it.
};
typedef QLinkedList<PathInfo> PathInfoList;
typedef QHash<QString, PathInfoList> PathHash;