LLDB  mainline
Endian.h
Go to the documentation of this file.
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 {
22  uint8_t bytes[sizeof(uint32_t)];
23 } const endianTest = {0x01020304};
24 
26  return (lldb::ByteOrder)endianTest.bytes[0];
27 }
28 
29 // ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
30 }
31 }
32 
33 #endif // liblldb_host_endian_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
uint8_t bytes[sizeof(uint32_t)]
Definition: Endian.h:22
static union lldb_private::endian::EndianTest endianTest
lldb::ByteOrder InlHostByteOrder()
Definition: Endian.h:25