Add special u32_le/etc. types to mark endianness.

Might even want u32_be...
This commit is contained in:
Unknown W. Brackets 2013-07-24 23:23:35 -07:00
parent 79990fe01d
commit f1c354607e
2 changed files with 13 additions and 4 deletions

View File

@ -20,8 +20,7 @@
// other parts of the code. Any definitions that are only used by the core should be
// placed in "Common.h" instead.
#ifndef _COMMONTYPES_H_
#define _COMMONTYPES_H_
#pragma once
#ifdef __arm__
#if !defined(ARM)
@ -55,4 +54,14 @@ typedef signed long long s64;
#endif // _WIN32
#endif // _COMMONTYPES_H_
#if !defined(BIG_ENDIAN) && !defined(__BIG_ENDIAN__)
typedef u32 u32_le;
typedef u16 u16_le;
typedef u64 u64_le;
typedef s32 s32_le;
typedef s16 s16_le;
typedef s64 s64_le;
#else
#error FIX ME
#endif

View File

@ -243,7 +243,7 @@ const char *GetAddressName(u32 address);
template <typename T>
struct PSPPointer
{
u32 ptr;
u32_le ptr;
inline T &operator*() const
{