#ifndef _TYPEDEF_H
#define _TYPEDEF_H

typedef unsigned char u8, uint8_t, BYTE, uchar;
typedef signed char s8, int8_t;
typedef unsigned short u16, uint16_t, WORD, ushort;
typedef signed short s16, int16_t;
typedef unsigned int uint, UINT, ssize_t, size_t;
typedef unsigned long u32, uint32_t, DWORD, ulong;
typedef signed long s32, int32_t;
typedef unsigned long long u64, uint64_t, ulonglong;
typedef signed long long s64, int64_t;

typedef volatile unsigned long *psfr_t;

#ifndef VOID
#define VOID                    void
#endif
#ifndef CONST
#define CONST                   const
#endif
#ifndef BOOL
typedef unsigned char           BOOL;
#endif
#ifndef BOOLEAN
typedef unsigned char           BOOLEAN;
#endif
#ifndef CHAR
typedef char                    CHAR;
#endif
#ifndef INT8
typedef char                    INT8;
#endif
#ifndef INT16
typedef short                   INT16;
#endif
#ifndef INT32
typedef long                    INT32;
#endif
#ifndef UINT8
typedef unsigned char           UINT8;
#endif
#ifndef UINT16
typedef unsigned short          UINT16;
#endif
#ifndef UINT32
typedef unsigned long           UINT32;
#endif
#ifndef UINT8V
typedef unsigned char volatile  UINT8V;
#endif
#ifndef UINT16V
typedef unsigned short volatile UINT16V;
#endif
#ifndef UINT32V
typedef unsigned long volatile  UINT32V;
#endif

#ifndef UINT8C
typedef const unsigned char           UINT8C;
#endif
#ifndef UINT16C
typedef const unsigned short          UINT16C;
#endif
#ifndef UINT32C
typedef const unsigned long           UINT32C;
#endif

#ifndef PVOID
typedef void                    *PVOID;
#endif
#ifndef PCHAR
typedef char                    *PCHAR;
#endif
#ifndef PCHAR
typedef const char              *PCCHAR;
#endif
#ifndef PINT8
typedef char                    *PINT8;
#endif
#ifndef PINT16
typedef short                   *PINT16;
#endif
#ifndef PINT32
typedef long                    *PINT32;
#endif
#ifndef PUINT8
typedef unsigned char           *PUINT8;
#endif
#ifndef PUINT16
typedef unsigned short          *PUINT16;
#endif
#ifndef PUINT32
typedef unsigned long           *PUINT32;
#endif
#ifndef PUINT8V
typedef volatile unsigned char  *PUINT8V;
#endif
#ifndef PUINT16V
typedef volatile unsigned short *PUINT16V;
#endif
#ifndef PUINT32V
typedef volatile unsigned long  *PUINT32V;
#endif

#define TRUE    1
#define FALSE   0

#endif // _TYPEDEF_H
