This can be important if your script will run on different CPU's.
The compiler can calculate for you, like this:
static const int __ENDIAN_CHECK__ = 1;
static int Big_Endian = 0;
static int Little_Endian = 0;
#define IsBigEndian ((*(char*)&__ENDIAN_CHECK__) == 0)
#define IsLittleEndian ((*(char*)&__ENDIAN_CHECK__) == 1)
void Init()
{
Big_Endian = IsBigEndian;
Little_Endian = IsLittleEndian;
VariableDefinePlatformVar(NULL, "BIG_ENDIAN", &IntType, (union AnyValue *)&Big_Endian, FALSE);
VariableDefinePlatformVar(NULL, "LITTLE_ENDIAN", &IntType, (union AnyValue *)&Little_Endian, FALSE);
}
Original issue reported on code.google.com by duncan.f...@gmail.com on 1 Aug 2010 at 3:30
Original issue reported on code.google.com by
duncan.f...@gmail.com
on 1 Aug 2010 at 3:30