diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-04-27 16:31:08 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-04-28 06:48:33 +0200 |
commit | bbc385150f8ae0ab7b2fc179db82ef4bb3d5ac28 (patch) | |
tree | 035b946da27cc8d77b60e593056bc0096757accd /tests/auto/corelib/io/qfile/tst_qfile.cpp | |
parent | 069369d86707c89645d63ff36151065c47e6c0ea (diff) |
Fix warnings from deprecated posix functions
Windows wants ISO C++ _fileno and _unlink instead of posix fileno and
unlink. For fileno we have the QT_FILENO macro in qplatformdefs.h, so use
it. For unlink we don't have a macro in Qt, so declare one in the test.
Change-Id: I56c5c3fb4e500769c744132c46107816f89bb2c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 |