Endian.h revision 317032
199158Sdes//===-- Endian.h ------------------------------------------------*- C++ -*-===// 2255376Sdes// 399158Sdes// The LLVM Compiler Infrastructure 499158Sdes// 5141098Sdes// This file is distributed under the University of Illinois Open Source 6141098Sdes// License. See LICENSE.TXT for details. 799158Sdes// 899158Sdes//===----------------------------------------------------------------------===// 999158Sdes 1099158Sdes#ifndef LLDB_UTILITY_ENDIAN_H 1199158Sdes#define LLDB_UTILITY_ENDIAN_H 1299158Sdes 1399158Sdes#include "lldb/lldb-enumerations.h" 14 15#include <stdint.h> 16 17namespace lldb_private { 18 19namespace endian { 20 21static union EndianTest { 22 uint32_t num; 23 uint8_t bytes[sizeof(uint32_t)]; 24} const endianTest = {0x01020304}; 25 26inline lldb::ByteOrder InlHostByteOrder() { 27 return (lldb::ByteOrder)endianTest.bytes[0]; 28} 29 30// ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0]; 31} 32} 33 34#endif // liblldb_host_endian_h_ 35