mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
* Adjustment: Update libsdl to address a bug in compilation on MacOS devices.
This commit is contained in:
parent
516163fd5d
commit
eab544c8f3
270 changed files with 9531 additions and 3704 deletions
|
|
@ -86,18 +86,25 @@ TestEndian(SDL_bool verbose)
|
|||
int error = 0;
|
||||
Uint16 value = 0x1234;
|
||||
int real_byteorder;
|
||||
int real_floatwordorder = 0;
|
||||
Uint16 value16 = 0xCDAB;
|
||||
Uint16 swapped16 = 0xABCD;
|
||||
Uint32 value32 = 0xEFBEADDE;
|
||||
Uint32 swapped32 = 0xDEADBEEF;
|
||||
Uint64 value64, swapped64;
|
||||
|
||||
union {
|
||||
double d;
|
||||
Uint32 ui32[2];
|
||||
} value_double;
|
||||
|
||||
value64 = 0xEFBEADDE;
|
||||
value64 <<= 32;
|
||||
value64 |= 0xCDAB3412;
|
||||
swapped64 = 0x1234ABCD;
|
||||
swapped64 <<= 32;
|
||||
swapped64 |= 0xDEADBEEF;
|
||||
value_double.d = 3.141593;
|
||||
|
||||
if (verbose) {
|
||||
SDL_Log("Detected a %s endian machine.\n",
|
||||
|
|
@ -115,6 +122,22 @@ TestEndian(SDL_bool verbose)
|
|||
}
|
||||
++error;
|
||||
}
|
||||
if (verbose) {
|
||||
SDL_Log("Detected a %s endian float word order machine.\n",
|
||||
(SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big");
|
||||
}
|
||||
if (value_double.ui32[0] == 0x82c2bd7f && value_double.ui32[1] == 0x400921fb) {
|
||||
real_floatwordorder = SDL_LIL_ENDIAN;
|
||||
} else if (value_double.ui32[0] == 0x400921fb && value_double.ui32[1] == 0x82c2bd7f) {
|
||||
real_floatwordorder = SDL_BIG_ENDIAN;
|
||||
}
|
||||
if (real_floatwordorder != SDL_FLOATWORDORDER) {
|
||||
if (verbose) {
|
||||
SDL_Log("Actually a %s endian float word order machine!\n",
|
||||
(real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big" : "unknown" );
|
||||
}
|
||||
++error;
|
||||
}
|
||||
if (verbose) {
|
||||
SDL_Log("Value 16 = 0x%X, swapped = 0x%X\n", value16,
|
||||
SDL_Swap16(value16));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue