diff options
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 835e6a6a44..0159bc4128 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -76,9 +76,7 @@ #endif #if defined(Q_OS_DARWIN) -# if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000) -# include <sys/clonefile.h> -# endif +# include <sys/clonefile.h> # include <copyfile.h> // We cannot include <Foundation/Foundation.h> (it's an Objective-C header), but // we need these declarations: @@ -860,7 +858,7 @@ QString QFileSystemEngine::resolveUserName(uint userId) QVarLengthArray<char, 1024> buf(size_max); #endif -#if !defined(Q_OS_INTEGRITY) +#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_WASM) struct passwd *pw = 0; #if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) struct passwd entry; @@ -884,7 +882,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId) QVarLengthArray<char, 1024> buf(size_max); #endif -#if !defined(Q_OS_INTEGRITY) +#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_WASM) struct group *gr = 0; #if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24)) size_max = sysconf(_SC_GETGR_R_SIZE_MAX); @@ -1258,20 +1256,18 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy //static bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error) { -#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000) - if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { - if (::clonefile(source.nativeFilePath().constData(), - target.nativeFilePath().constData(), 0) == 0) - return true; - error = QSystemError(errno, QSystemError::StandardLibraryError); - return false; - } +#if defined(Q_OS_DARWIN) + if (::clonefile(source.nativeFilePath().constData(), + target.nativeFilePath().constData(), 0) == 0) + return true; + error = QSystemError(errno, QSystemError::StandardLibraryError); + return false; #else Q_UNUSED(source); Q_UNUSED(target); -#endif error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented return false; +#endif } //static @@ -1295,13 +1291,11 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy } #endif #if defined(Q_OS_DARWIN) && defined(RENAME_EXCL) - if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { - if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0) - return true; - if (errno != ENOTSUP) { - error = QSystemError(errno, QSystemError::StandardLibraryError); - return false; - } + if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0) + return true; + if (errno != ENOTSUP) { + error = QSystemError(errno, QSystemError::StandardLibraryError); + return false; } #endif |