Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/CommonTypes.h
3185 views
1
// Copyright (C) 2003 Dolphin Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official SVN repository and contact information can be found at
16
// http://code.google.com/p/dolphin-emu/
17
18
19
// This header contains type definitions that are shared between the Dolphin core and
20
// other parts of the code. Any definitions that are only used by the core should be
21
// placed in "Common.h" instead.
22
23
#pragma once
24
25
#if defined(_MSC_VER)
26
27
#define NO_INLINE __declspec(noinline)
28
29
typedef unsigned __int8 u8;
30
typedef unsigned __int16 u16;
31
typedef unsigned __int32 u32;
32
typedef unsigned __int64 u64;
33
34
typedef signed __int8 s8;
35
typedef signed __int16 s16;
36
typedef signed __int32 s32;
37
typedef signed __int64 s64;
38
39
#else
40
41
#define NO_INLINE __attribute__((noinline))
42
43
#ifdef __SWITCH__
44
// Some HID conflicts
45
#define KEY_UP PKEY_UP
46
#define KEY_DOWN PKEY_DOWN
47
// Other conflicts
48
#define Event _Event
49
#define Framebuffer _Framebuffer
50
#define Waitable _Waitable
51
#define ThreadContext _ThreadContext
52
#include <switch.h>
53
// Cleanup
54
#undef KEY_UP
55
#undef KEY_DOWN
56
#undef Event
57
#undef Framebuffer
58
#undef Waitable
59
#undef ThreadContext
60
61
// Conflicting types with libnx
62
#ifndef _u64
63
#define u64 _u64
64
#endif // _u64
65
66
#ifndef s64
67
#define s64 _s64
68
#endif // _s64
69
70
typedef unsigned char u_char;
71
typedef unsigned short u_short;
72
typedef unsigned int u_int;
73
typedef unsigned long u_long;
74
#endif // __SWITCH__
75
76
typedef unsigned char u8;
77
typedef unsigned short u16;
78
typedef unsigned int u32;
79
typedef unsigned long long u64;
80
81
typedef signed char s8;
82
typedef signed short s16;
83
typedef signed int s32;
84
typedef signed long long s64;
85
86
#endif // _WIN32
87
88