compile-time system endian check

This commit is contained in:
Jack Andersen 2015-07-12 06:51:04 -10:00
parent 7ef451c86a
commit 7ec5a5971a
2 changed files with 1 additions and 7 deletions

View File

@ -13,7 +13,7 @@ namespace Athena
namespace utility
{
inline bool isEmpty(atInt8* buf, atUint32 size) {return !memcmp(buf, buf + 1, size - 1);}
bool isSystemBigEndian();
inline bool isSystemBigEndian() {return (*(atUint16*)"\xFE\xFF" == 0xFEFF);}
inline atInt16 swap16(atInt16 val)
{

View File

@ -23,12 +23,6 @@ namespace Athena
namespace utility
{
bool isSystemBigEndian()
{
static const atUint8* test = (atUint8*)"\xFE\xFF";
return (*(atUint16*)test == 0xFEFF);
}
void fillRandom(atUint8* rndArea, atUint64 count)
{
for (atUint64 i = 0; i < count; i++)