Skip to content
Commits on Source (1)
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2023 OpenCFD Ltd.
Copyright (C) 2016-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -29,8 +29,8 @@ License
#include "adiosTime.H"
#include "cloud.H"
#include "foamVersion.H"
#include "endian.H"
#include "OSspecific.H"
#include <cstdint> // For endian information
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
......@@ -201,15 +201,34 @@ void Foam::adiosFoam::adiosCoreWrite::putBaseAttributes()
);
// Endian type (LSB|MSB)
#ifdef __BYTE_ORDER__
// Clang, Gcc, Icc, and others
putAttribute
(
adiosFoam::foamAttribute / "endian",
#ifdef WM_LITTLE_ENDIAN
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
"LSB"
#else
"MSB"
#endif
#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
"MSB";
#else
"mixed"
#endif
);
#endif
// C++20
// if constexpr (std::endian::native == std::endian::big)
// {
// putAttribute(adiosFoam::foamAttribute / "endian", "MSB");
// }
// else if constexpr (std::endian::native == std::endian::little)
// {
// putAttribute(adiosFoam::foamAttribute / "endian", "LSB");
// }
// else
// {
// putAttribute(adiosFoam::foamAttribute / "endian", "mixed");
// }
// OpenFOAM label size (32|64)
putIntAttribute
......