CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/ppsspp_config.h
Views: 1400
1
#pragma once
2
3
// This file is included by C, C++ and ASM files
4
// So do not output any token!
5
6
#define PPSSPP_ARCH(PPSSPP_FEATURE) (PPSSPP_ARCH_##PPSSPP_FEATURE)
7
#define PPSSPP_PLATFORM(PPSSPP_FEATURE) (PPSSPP_PLATFORM_##PPSSPP_FEATURE)
8
#define PPSSPP_API(PPSSPP_FEATURE) (PPSSPP_API_##PPSSPP_FEATURE)
9
10
// ARCH defines
11
#if defined(_M_IX86) || defined(__i386__) || defined (__EMSCRIPTEN__)
12
#define PPSSPP_ARCH_X86 1
13
#define PPSSPP_ARCH_32BIT 1
14
#define PPSSPP_ARCH_SSE2 1
15
//TODO: Remove this compat define
16
#ifndef _M_IX86
17
#define _M_IX86 600
18
#endif
19
#endif
20
21
#if (defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)) && !defined(__EMSCRIPTEN__)
22
#define PPSSPP_ARCH_AMD64 1
23
#define PPSSPP_ARCH_SSE2 1
24
#if defined(__ILP32__)
25
#define PPSSPP_ARCH_32BIT 1
26
#else
27
#define PPSSPP_ARCH_64BIT 1
28
#endif
29
//TODO: Remove this compat define
30
#ifndef _M_X64
31
#define _M_X64 1
32
#endif
33
#endif
34
35
#if defined(__arm__) || defined(_M_ARM)
36
#define PPSSPP_ARCH_ARM 1
37
#define PPSSPP_ARCH_32BIT 1
38
39
#if defined(__ARM_ARCH_7__) || \
40
defined(__ARM_ARCH_7A__) || \
41
defined(__ARM_ARCH_7S__)
42
#define PPSSPP_ARCH_ARMV7 1
43
#endif
44
45
#if defined(__ARM_ARCH_7S__)
46
#define PPSSPP_ARCH_ARMV7S 1
47
#endif
48
49
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
50
#define PPSSPP_ARCH_ARM_NEON 1
51
#endif
52
53
#if defined(_M_ARM)
54
#define PPSSPP_ARCH_ARMV7 1
55
#define PPSSPP_ARCH_ARM_NEON 1
56
#endif
57
#endif
58
59
#if defined(__aarch64__) || defined(_M_ARM64)
60
#define PPSSPP_ARCH_ARM64 1
61
#define PPSSPP_ARCH_64BIT 1
62
#define PPSSPP_ARCH_ARM_NEON 1 // Applies to both ARM32 and ARM64
63
#define PPSSPP_ARCH_ARM64_NEON 1
64
#endif
65
66
#if defined(__mips64__)
67
#define PPSSPP_ARCH_MIPS64 1
68
#define PPSSPP_ARCH_64BIT 1
69
#elif defined(__mips__)
70
#define PPSSPP_ARCH_MIPS 1
71
#define PPSSPP_ARCH_32BIT 1
72
#endif
73
74
#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
75
//https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
76
#define PPSSPP_ARCH_RISCV64 1
77
#define PPSSPP_ARCH_64BIT 1
78
#endif
79
80
#if defined(__loongarch_lp64)
81
//https://github.com/gcc-mirror/gcc/blob/master/gcc/config/loongarch/loongarch-c.cc
82
#define PPSSPP_ARCH_LOONGARCH64 1
83
#define PPSSPP_ARCH_64BIT 1
84
#endif
85
86
// PLATFORM defines
87
#if defined(_WIN32)
88
// Covers both 32 and 64bit Windows
89
#define PPSSPP_PLATFORM_WINDOWS 1
90
#ifdef _M_ARM
91
#define PPSSPP_ARCH_ARM_HARDFP 1
92
#endif
93
// UWP trickery
94
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION)
95
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
96
#define PPSSPP_PLATFORM_UWP 1
97
#endif
98
#endif
99
#elif defined(__APPLE__)
100
#include <TargetConditionals.h>
101
#if TARGET_IPHONE_SIMULATOR
102
#define PPSSPP_PLATFORM_IOS 1
103
#define PPSSPP_PLATFORM_IOS_SIMULATOR 1
104
#elif TARGET_OS_IPHONE
105
#define PPSSPP_PLATFORM_IOS 1
106
#elif TARGET_OS_MAC
107
#define PPSSPP_PLATFORM_MAC 1
108
#else
109
#error "Unknown Apple platform"
110
#endif
111
#elif defined(__SWITCH__)
112
#define PPSSPP_PLATFORM_SWITCH 1
113
#elif defined(__ANDROID__)
114
#define PPSSPP_PLATFORM_ANDROID 1
115
#define PPSSPP_PLATFORM_LINUX 1
116
#elif defined(__linux__)
117
#define PPSSPP_PLATFORM_LINUX 1
118
#elif defined(__OpenBSD__)
119
#define PPSSPP_PLATFORM_OPENBSD 1
120
#endif
121
122
// Windows ARM/ARM64, and Windows UWP (all), are the only platform that don't do GL at all (until Apple finally removes it)
123
#if !PPSSPP_PLATFORM(WINDOWS) || ((!PPSSPP_ARCH(ARM) && !PPSSPP_ARCH(ARM64)) && !PPSSPP_PLATFORM(UWP))
124
#define PPSSPP_API_ANY_GL 1
125
#endif
126
127
#if PPSSPP_PLATFORM(WINDOWS)
128
#if !PPSSPP_PLATFORM(UWP)
129
#define PPSSPP_API_D3D9 1
130
#endif
131
#define PPSSPP_API_D3D11 1
132
#endif
133
134
135