Introduce portable types to R4300 system types header.
This commit is contained in:
parent
074e735ccc
commit
9897c0cbbc
|
@ -10,6 +10,28 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some versions of Microsoft Visual C/++ compilers before Visual Studio 2010
|
||||||
|
* have <stdint.h> removed in favor of these nonstandard built-in types:
|
||||||
|
*/
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
|
typedef signed __int8 int8_t;
|
||||||
|
typedef signed __int16 int16_t;
|
||||||
|
typedef signed __int32 int32_t;
|
||||||
|
typedef signed __int64 int64_t;
|
||||||
|
|
||||||
|
typedef unsigned __int8 uint8_t;
|
||||||
|
typedef unsigned __int16 uint16_t;
|
||||||
|
typedef unsigned __int32 uint32_t;
|
||||||
|
typedef unsigned __int64 uint64_t;
|
||||||
|
#else
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To do: Use fixed-size types for MIPS union members, not WINAPI types.
|
||||||
|
* On Win32 x86, `unsigned long DWORD` versus `int32_t` is the only conflict.
|
||||||
|
*/
|
||||||
typedef unsigned char BYTE;
|
typedef unsigned char BYTE;
|
||||||
typedef unsigned short WORD;
|
typedef unsigned short WORD;
|
||||||
typedef unsigned long DWORD;
|
typedef unsigned long DWORD;
|
||||||
|
@ -19,23 +41,25 @@ typedef int BOOL;
|
||||||
|
|
||||||
union MIPS_WORD {
|
union MIPS_WORD {
|
||||||
long W;
|
long W;
|
||||||
float F;
|
|
||||||
unsigned long UW;
|
unsigned long UW;
|
||||||
short HW[2];
|
short HW[2];
|
||||||
unsigned short UHW[2];
|
unsigned short UHW[2];
|
||||||
char B[4];
|
char B[4];
|
||||||
unsigned char UB[4];
|
unsigned char UB[4];
|
||||||
|
|
||||||
|
float F;
|
||||||
};
|
};
|
||||||
|
|
||||||
union MIPS_DWORD {
|
union MIPS_DWORD {
|
||||||
double D;
|
|
||||||
__int64 DW;
|
__int64 DW;
|
||||||
unsigned __int64 UDW;
|
unsigned __int64 UDW;
|
||||||
long W[2];
|
long W[2];
|
||||||
float F[2];
|
|
||||||
unsigned long UW[2];
|
unsigned long UW[2];
|
||||||
short HW[4];
|
short HW[4];
|
||||||
unsigned short UHW[4];
|
unsigned short UHW[4];
|
||||||
char B[8];
|
char B[8];
|
||||||
unsigned char UB[8];
|
unsigned char UB[8];
|
||||||
|
|
||||||
|
double D;
|
||||||
|
float F[2];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue