cmELF: Use KWIML ABI.h header to get endian-ness

Port away from KWSys CPU header.
This commit is contained in:
Brad King 2015-12-09 11:38:10 -05:00
parent dc873f6eef
commit d462ac27d8
1 changed files with 3 additions and 4 deletions

View File

@ -16,8 +16,7 @@
#include <cmsys/FStream.hxx> #include <cmsys/FStream.hxx>
// Need the native byte order of the running CPU. // Need the native byte order of the running CPU.
#define cmsys_CPU_UNKNOWN_OKAY // We can decide at runtime if not known. #include <cmIML/ABI.h>
#include <cmsys/CPU.h>
// Include the ELF format information system header. // Include the ELF format information system header.
#if defined(__OpenBSD__) #if defined(__OpenBSD__)
@ -102,9 +101,9 @@ public:
// In most cases the processor-specific byte order will match that // In most cases the processor-specific byte order will match that
// of the target execution environment. If we choose wrong here // of the target execution environment. If we choose wrong here
// it is fixed when the header is read. // it is fixed when the header is read.
#if cmsys_CPU_ENDIAN_ID == cmsys_CPU_ENDIAN_ID_LITTLE #if cmIML_ABI_ENDIAN_ID == cmIML_ABI_ENDIAN_ID_LITTLE
this->NeedSwap = (this->ByteOrder == ByteOrderMSB); this->NeedSwap = (this->ByteOrder == ByteOrderMSB);
#elif cmsys_CPU_ENDIAN_ID == cmsys_CPU_ENDIAN_ID_BIG #elif cmIML_ABI_ENDIAN_ID == cmIML_ABI_ENDIAN_ID_BIG
this->NeedSwap = (this->ByteOrder == ByteOrderLSB); this->NeedSwap = (this->ByteOrder == ByteOrderLSB);
#else #else
this->NeedSwap = false; // Final decision is at runtime anyway. this->NeedSwap = false; // Final decision is at runtime anyway.