mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: reduce off_t as int64 for windows compilation
- avoids unresolved pTraits<long int> for reductions
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2024 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -867,7 +867,7 @@ off_t Foam::fileOperations::masterUncollatedFileOperation::fileSize
|
||||
const bool followLink
|
||||
) const
|
||||
{
|
||||
return masterOp<off_t>
|
||||
return masterOp<fileSizeOp::value_type>
|
||||
(
|
||||
fName,
|
||||
fileSizeOp(followLink),
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2024 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -222,14 +222,26 @@ protected:
|
||||
{
|
||||
const bool followLink_;
|
||||
public:
|
||||
fileSizeOp(const bool followLink)
|
||||
|
||||
#ifdef _WIN32
|
||||
// off_t is 'long int' for windows (missing pTraits)
|
||||
typedef int64_t value_type;
|
||||
#else
|
||||
typedef off_t value_type;
|
||||
#endif
|
||||
|
||||
fileSizeOp(bool followLink) noexcept
|
||||
:
|
||||
followLink_(followLink)
|
||||
{}
|
||||
|
||||
off_t operator()(const fileName& f) const
|
||||
auto operator()(const fileName& f) const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return value_type(Foam::fileSize(f, followLink_));
|
||||
#else
|
||||
return Foam::fileSize(f, followLink_);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user