mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-14 10:08:32 +05:00
BinaryArchive platform compatibility
This commit is contained in:
parent
aeadc7f79a
commit
22b45dde67
@ -864,7 +864,15 @@ namespace ngcore
|
|||||||
Archive & Do (int * i, size_t n) override
|
Archive & Do (int * i, size_t n) override
|
||||||
{ stream->read(reinterpret_cast<char*>(i), n*sizeof(int)); return *this; } // NOLINT
|
{ stream->read(reinterpret_cast<char*>(i), n*sizeof(int)); return *this; } // NOLINT
|
||||||
Archive & Do (size_t * i, size_t n) override
|
Archive & Do (size_t * i, size_t n) override
|
||||||
{ stream->read(reinterpret_cast<char*>(i), n*sizeof(size_t)); return *this; } // NOLINT
|
{
|
||||||
|
// for platform independence
|
||||||
|
if constexpr (sizeof(long) == 8)
|
||||||
|
stream->read(reinterpret_cast<char*>(i), n*sizeof(size_t)); // NOLINT
|
||||||
|
else
|
||||||
|
for(size_t j = 0; j < n; j++)
|
||||||
|
(*this) & i[j];
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user