[flang-commits] [flang] [flang][NFC] Use LLVM's endianness enum (PR #86516)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Tue Mar 26 14:22:46 PDT 2024
================
@@ -261,12 +262,10 @@ template <bool IS_SIGNED = false> class Int128 {
}
}
static constexpr std::uint64_t topBit{std::uint64_t{1} << 63};
-#if FLANG_LITTLE_ENDIAN
- std::uint64_t low_{0}, high_{0};
-#elif FLANG_BIG_ENDIAN
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
std::uint64_t high_{0}, low_{0};
#else
-#error host endianness is not known
+ std::uint64_t low_{0}, high_{0};
----------------
klausler wrote:
You're just defaulting to little-endianness here if `BYTE_ORDER` is undefined. This can be worse than the current situation.
https://github.com/llvm/llvm-project/pull/86516
More information about the flang-commits
mailing list