[Common] CommonType base for Nintendo Switch

Avoid name conflicts & declare certain types
This commit is contained in:
M4xw 2023-06-27 13:38:00 +02:00
parent 36584aa6f4
commit 21be8c3c2b

View File

@ -36,6 +36,39 @@ typedef signed __int64 s64;
#else
#ifdef __SWITCH__
// Some HID conflicts
#define KEY_UP PKEY_UP
#define KEY_DOWN PKEY_DOWN
// Other conflicts
#define Event _Event
#define Framebuffer _Framebuffer
#define Waitable _Waitable
#define ThreadContext _ThreadContext
#include <switch.h>
// Cleanup
#undef KEY_UP
#undef KEY_DOWN
#undef Event
#undef Framebuffer
#undef Waitable
#undef ThreadContext
// Conflicting types with libnx
#ifndef _u64
#define u64 _u64
#endif // _u64
#ifndef s64
#define s64 _s64
#endif // _s64
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#endif // __SWITCH__
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;