1 //===-- Endian.h ------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_UTILITY_ENDIAN_H
10 #define LLDB_UTILITY_ENDIAN_H
12 #include "lldb/lldb-enumerations.h"
16 namespace lldb_private {
20 static union EndianTest {
22 uint8_t bytes[sizeof(uint32_t)];
23 } const endianTest = {0x01020304};
25 inline lldb::ByteOrder InlHostByteOrder() {
26 return static_cast<lldb::ByteOrder>(endianTest.bytes[0]);
29 // ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
33 #endif // liblldb_host_endian_h_