mirror of
https://github.com/jorio/Pomme.git
synced 2024-11-23 06:32:14 +00:00
Use __BIG_ENDIAN__ macro
This commit is contained in:
parent
501ac5dfeb
commit
7f16782991
@ -19,7 +19,7 @@ typedef unsigned short UInt16;
|
||||
typedef unsigned int UInt32;
|
||||
typedef unsigned long long UInt64;
|
||||
|
||||
#if TARGET_RT_BIGENDIAN
|
||||
#if __BIG_ENDIAN__
|
||||
typedef struct { UInt32 hi, lo; } UnsignedWide;
|
||||
#else
|
||||
typedef struct { UInt32 lo, hi; } UnsignedWide;
|
||||
@ -283,7 +283,7 @@ typedef UInt8 KeyMapByteArray[16];
|
||||
//-----------------------------------------------------------------------------
|
||||
// 'vers' resource
|
||||
|
||||
#if TARGET_RT_BIG_ENDIAN
|
||||
#if __BIG_ENDIAN__
|
||||
//BCD encoded, e.g. "4.2.1a3" is 0x04214003
|
||||
typedef struct NumVersion
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ namespace Pomme
|
||||
{
|
||||
char b[sizeof(T)];
|
||||
Read(b, sizeof(T));
|
||||
#if !(TARGET_RT_BIGENDIAN)
|
||||
#if !(__BIG_ENDIAN__)
|
||||
if constexpr (sizeof(T) > 1)
|
||||
{
|
||||
std::reverse(b, b + sizeof(T));
|
||||
@ -80,7 +80,7 @@ namespace Pomme
|
||||
void Write(T value)
|
||||
{
|
||||
char* b = (char*) &value;
|
||||
#if !(TARGET_RT_BIGENDIAN)
|
||||
#if !(__BIG_ENDIAN__)
|
||||
if constexpr (sizeof(T) > 1)
|
||||
{
|
||||
std::reverse(b, b + sizeof(T));
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
template<typename T> T ByteswapScalar(T x)
|
||||
{
|
||||
#if TARGET_RT_BIGENDIAN
|
||||
#if __BIG_ENDIAN__
|
||||
return x;
|
||||
#else
|
||||
char* b = (char*)&x;
|
||||
|
Loading…
Reference in New Issue
Block a user