diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 188e3fdc25..67a8d66963 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1766,7 +1766,7 @@ void tst_QFile::largeUncFileSupport() // Retry in case of sharing violation QTRY_VERIFY(fOpen(largeFileEncoded, "rb", &fhF)); StdioFileGuard fh(fhF); - int fd = int(_fileno(fh)); + int fd = int(QT_FILENO(fh)); QFile file; QVERIFY(file.open(fd, QIODevice::ReadOnly)); QCOMPARE(file.size(), size); @@ -2854,8 +2854,8 @@ void tst_QFile::handle() StdioFileGuard fp(fopen(qPrintable(m_testSourceFile), "r")); QVERIFY(fp); file2.open(fp, QIODevice::ReadOnly); - QCOMPARE(int(file2.handle()), int(fileno(fp))); - QCOMPARE(int(file2.handle()), int(fileno(fp))); + QCOMPARE(int(file2.handle()), int(QT_FILENO(fp))); + QCOMPARE(int(file2.handle()), int(QT_FILENO(fp))); fp.close(); //test round trip of adopted posix file handle diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 732d81d84a..621214452b 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -57,8 +57,10 @@ #if defined(Q_OS_WIN) #include #include +#define QT_UNLINK _unlink #else #include +#define QT_UNLINK unlink #endif #if defined(Q_OS_DARWIN) @@ -1736,7 +1738,7 @@ void tst_QSettings::sync() // Now "some other app" will change other.software.org.ini QString userConfDir = settingsPath("__user__") + QDir::separator(); - unlink((userConfDir + "other.software.org.ini").toLatin1()); + QT_UNLINK((userConfDir + "other.software.org.ini").toLatin1()); rename((userConfDir + "software.org.ini").toLatin1(), (userConfDir + "other.software.org.ini").toLatin1());