mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Make the host endianness check an integer constant expression.
I will remove the isBigEndianHost function once I update clang. The ifdef logic is designed to * not use configure/cmake to avoid breaking -arch i686 -arch ppc. * default to little endian * be as small as possible It looks like sys/endian.h is the preferred header on most modern BSD systems, but it is better to change this in a followup patch as machine/endian.h is available on FreeBSD, OpenBSD, NetBSD and OS X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -61,7 +61,7 @@ static void ReadInMemoryStruct(const MachOObject &MOO,
|
||||
MachOObject::MachOObject(MemoryBuffer *Buffer_, bool IsLittleEndian_,
|
||||
bool Is64Bit_)
|
||||
: Buffer(Buffer_), IsLittleEndian(IsLittleEndian_), Is64Bit(Is64Bit_),
|
||||
IsSwappedEndian(IsLittleEndian != sys::isLittleEndianHost()),
|
||||
IsSwappedEndian(IsLittleEndian != sys::IsLittleEndianHost),
|
||||
HasStringTable(false), LoadCommands(0), NumLoadedCommands(0) {
|
||||
// Load the common header.
|
||||
memcpy(&Header, Buffer->getBuffer().data(), sizeof(Header));
|
||||
|
Reference in New Issue
Block a user