Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qtbase] Compile with largefile support. JB#49745
  • Loading branch information
Franz-Josef Haider committed May 28, 2020
1 parent 924dfb5 commit 9ad44f5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions qmake/generators/makefiledeps.cpp
Expand Up @@ -55,6 +55,8 @@
#include <share.h>
#endif

#include "qplatformdefs.h"

QT_BEGIN_NAMESPACE

// FIXME: a line ending in CRLF gets counted as two lines.
Expand Down Expand Up @@ -513,7 +515,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)

const QMakeLocalFileName sourceFile = fixPathForFile(file->file, true);

struct stat fst;
QT_STATBUF fst;
char *buffer = 0;
int buffer_len = 0;
{
Expand All @@ -525,7 +527,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
#else
fd = open(sourceFile.local().toLatin1().constData(), O_RDONLY);
#endif
if (fd == -1 || fstat(fd, &fst) || S_ISDIR(fst.st_mode)) {
if (fd == -1 || QT_FSTAT(fd, &fst) || S_ISDIR(fst.st_mode)) {
if (fd != -1)
QT_CLOSE(fd);
return false;
Expand Down Expand Up @@ -893,7 +895,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
int buffer_len = 0;
char *buffer = 0;
{
struct stat fst;
QT_STATBUF fst;
int fd;
#if defined(_MSC_VER) && _MSC_VER >= 1400
if (_sopen_s(&fd, fixPathForFile(file->file, true).local().toLocal8Bit().constData(),
Expand All @@ -902,7 +904,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
#else
fd = open(fixPathForFile(file->file, true).local().toLocal8Bit().constData(), O_RDONLY);
#endif
if (fd == -1 || fstat(fd, &fst) || S_ISDIR(fst.st_mode)) {
if (fd == -1 || QT_FSTAT(fd, &fst) || S_ISDIR(fst.st_mode)) {
if (fd != -1)
QT_CLOSE(fd);
return false; //shouldn't happen
Expand Down
5 changes: 3 additions & 2 deletions qmake/library/ioutils.cpp
Expand Up @@ -32,6 +32,7 @@
****************************************************************************/

#include "ioutils.h"
#include "qplatformdefs.h"

#include <qdir.h>
#include <qfile.h>
Expand All @@ -57,8 +58,8 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)
return FileNotFound;
return (attr & FILE_ATTRIBUTE_DIRECTORY) ? FileIsDir : FileIsRegular;
#else
struct ::stat st;
if (::stat(fileName.toLocal8Bit().constData(), &st))
QT_STATBUF st;
if (QT_STAT(fileName.toLocal8Bit().constData(), &st))
return FileNotFound;
return S_ISDIR(st.st_mode) ? FileIsDir : FileIsRegular;
#endif
Expand Down
6 changes: 4 additions & 2 deletions qmake/library/qmakebuiltins.cpp
Expand Up @@ -82,6 +82,8 @@
#define QT_PCLOSE pclose
#endif

#include "qplatformdefs.h"

using namespace QMakeInternal;

QT_BEGIN_NAMESPACE
Expand Down Expand Up @@ -1602,8 +1604,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
const QString &tfn = resolvePath(args.at(0).toQString(m_tmp1));
const QString &rfn = resolvePath(args.at(1).toQString(m_tmp2));
#ifdef Q_OS_UNIX
struct stat st;
if (stat(rfn.toLocal8Bit().constData(), &st)) {
QT_STATBUF st;
if (QT_STAT(rfn.toLocal8Bit().constData(), &st)) {
evalError(fL1S("Cannot stat() reference file %1: %2.").arg(rfn, fL1S(strerror(errno))));
return ReturnFalse;
}
Expand Down
1 change: 1 addition & 0 deletions rpm/qtbase.spec
Expand Up @@ -488,6 +488,7 @@ MAKEFLAGS=%{?_smp_mflags} \
-no-xkbcommon \
-no-xcb \
-no-xinput2 \
-largefile \
%ifarch aarch64
-no-pch \
%endif
Expand Down
4 changes: 2 additions & 2 deletions src/corelib/io/qfilesystemengine_unix.cpp
Expand Up @@ -332,8 +332,8 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
//static
QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
{
struct stat statResult;
if (stat(entry.nativeFilePath().constData(), &statResult)) {
QT_STATBUF statResult;
if (QT_STAT(entry.nativeFilePath().constData(), &statResult)) {
qErrnoWarning("stat() failed for '%s'", entry.nativeFilePath().constData());
return QByteArray();
}
Expand Down

0 comments on commit 9ad44f5

Please sign in to comment.