]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Utility/Endian.h
Merge lldb trunk r366426, resolve conflicts, and update FREEBSD-Xlist.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Utility / Endian.h
1 //===-- Endian.h ------------------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLDB_UTILITY_ENDIAN_H
10 #define LLDB_UTILITY_ENDIAN_H
11
12 #include "lldb/lldb-enumerations.h"
13
14 #include <stdint.h>
15
16 namespace lldb_private {
17
18 namespace endian {
19
20 static union EndianTest {
21   uint32_t num;
22   uint8_t bytes[sizeof(uint32_t)];
23 } const endianTest = {0x01020304};
24
25 inline lldb::ByteOrder InlHostByteOrder() {
26   return static_cast<lldb::ByteOrder>(endianTest.bytes[0]);
27 }
28
29 //    ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
30 }
31 }
32
33 #endif // liblldb_host_endian_h_