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
13
14#include <cstdint>
15
16namespace lldb_private {
17
18namespace endian {
19
20static union EndianTest {
21 uint32_t num;
22 uint8_t bytes[sizeof(uint32_t)];
23} const endianTest = {0x01020304};
24
26 return static_cast<lldb::ByteOrder>(endianTest.bytes[0]);
27}
28
29// ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
30}
31}
32
33#endif // LLDB_UTILITY_ENDIAN_H
static union lldb_private::endian::EndianTest endianTest
lldb::ByteOrder InlHostByteOrder()
Definition: Endian.h:25
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
ByteOrder
Byte ordering definitions.
uint8_t bytes[sizeof(uint32_t)]
Definition: Endian.h:22