2016-10-12 15:32:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// This file is included by C, C++ and ASM files
|
|
|
|
// So do not output any token!
|
|
|
|
|
|
|
|
#define PPSSPP_ARCH(PPSSPP_FEATURE) (PPSSPP_ARCH_##PPSSPP_FEATURE)
|
|
|
|
#define PPSSPP_PLATFORM(PPSSPP_FEATURE) (PPSSPP_PLATFORM_##PPSSPP_FEATURE)
|
2019-05-10 21:25:57 +00:00
|
|
|
#define PPSSPP_API(PPSSPP_FEATURE) (PPSSPP_API_##PPSSPP_FEATURE)
|
2016-10-12 15:32:52 +00:00
|
|
|
|
|
|
|
// ARCH defines
|
2023-08-12 19:38:35 +00:00
|
|
|
#if defined(_M_IX86) || defined(__i386__) || defined (__EMSCRIPTEN__)
|
2016-10-12 15:32:52 +00:00
|
|
|
#define PPSSPP_ARCH_X86 1
|
|
|
|
#define PPSSPP_ARCH_32BIT 1
|
|
|
|
//TODO: Remove this compat define
|
|
|
|
#ifndef _M_IX86
|
|
|
|
#define _M_IX86 600
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2023-08-12 19:38:35 +00:00
|
|
|
#if (defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)) && !defined(__EMSCRIPTEN__)
|
2016-10-12 15:32:52 +00:00
|
|
|
#define PPSSPP_ARCH_AMD64 1
|
2023-07-03 07:36:44 +00:00
|
|
|
#if defined(__ILP32__)
|
|
|
|
#define PPSSPP_ARCH_32BIT 1
|
|
|
|
#else
|
|
|
|
#define PPSSPP_ARCH_64BIT 1
|
|
|
|
#endif
|
2016-10-12 15:32:52 +00:00
|
|
|
//TODO: Remove this compat define
|
|
|
|
#ifndef _M_X64
|
|
|
|
#define _M_X64 1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2017-03-03 21:48:05 +00:00
|
|
|
#if defined(__arm__) || defined(_M_ARM)
|
2016-10-12 15:32:52 +00:00
|
|
|
#define PPSSPP_ARCH_ARM 1
|
|
|
|
#define PPSSPP_ARCH_32BIT 1
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_7__) || \
|
|
|
|
defined(__ARM_ARCH_7A__) || \
|
|
|
|
defined(__ARM_ARCH_7S__)
|
|
|
|
#define PPSSPP_ARCH_ARMV7 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_7S__)
|
|
|
|
#define PPSSPP_ARCH_ARMV7S 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
|
|
|
|
#define PPSSPP_ARCH_ARM_NEON 1
|
|
|
|
#endif
|
|
|
|
|
2017-03-03 21:48:05 +00:00
|
|
|
#if defined(_M_ARM)
|
|
|
|
#define PPSSPP_ARCH_ARMV7 1
|
|
|
|
#define PPSSPP_ARCH_ARM_NEON 1
|
|
|
|
#endif
|
2016-10-12 15:32:52 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-03 22:07:57 +00:00
|
|
|
#if defined(__aarch64__) || defined(_M_ARM64)
|
2016-10-12 15:32:52 +00:00
|
|
|
#define PPSSPP_ARCH_ARM64 1
|
|
|
|
#define PPSSPP_ARCH_64BIT 1
|
|
|
|
#define PPSSPP_ARCH_ARM_NEON 1
|
2022-06-24 07:34:59 +00:00
|
|
|
#define PPSSPP_ARCH_ARM64_NEON 1
|
2016-10-12 15:32:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__mips64__)
|
|
|
|
#define PPSSPP_ARCH_MIPS64 1
|
|
|
|
#define PPSSPP_ARCH_64BIT 1
|
|
|
|
#elif defined(__mips__)
|
|
|
|
#define PPSSPP_ARCH_MIPS 1
|
|
|
|
#define PPSSPP_ARCH_32BIT 1
|
|
|
|
#endif
|
|
|
|
|
2021-07-28 21:28:29 +00:00
|
|
|
#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
|
2021-07-30 15:50:48 +00:00
|
|
|
//https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
|
2021-08-06 18:08:39 +00:00
|
|
|
#define PPSSPP_ARCH_RISCV64 1
|
|
|
|
#define PPSSPP_ARCH_64BIT 1
|
2021-07-28 11:58:56 +00:00
|
|
|
#endif
|
|
|
|
|
2016-10-12 15:32:52 +00:00
|
|
|
|
|
|
|
// PLATFORM defines
|
|
|
|
#if defined(_WIN32)
|
|
|
|
// Covers both 32 and 64bit Windows
|
|
|
|
#define PPSSPP_PLATFORM_WINDOWS 1
|
2019-05-03 22:07:57 +00:00
|
|
|
#ifdef _M_ARM
|
|
|
|
#define PPSSPP_ARCH_ARM_HARDFP 1
|
|
|
|
#endif
|
|
|
|
// UWP trickery
|
2017-02-24 23:25:46 +00:00
|
|
|
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION)
|
2017-11-25 20:36:46 +00:00
|
|
|
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
2017-02-24 17:59:41 +00:00
|
|
|
#define PPSSPP_PLATFORM_UWP 1
|
|
|
|
#endif
|
|
|
|
#endif
|
2016-10-12 15:32:52 +00:00
|
|
|
#elif defined(__APPLE__)
|
|
|
|
#include <TargetConditionals.h>
|
|
|
|
#if TARGET_IPHONE_SIMULATOR
|
|
|
|
#define PPSSPP_PLATFORM_IOS 1
|
|
|
|
#define PPSSPP_PLATFORM_IOS_SIMULATOR 1
|
|
|
|
#elif TARGET_OS_IPHONE
|
|
|
|
#define PPSSPP_PLATFORM_IOS 1
|
|
|
|
#elif TARGET_OS_MAC
|
|
|
|
#define PPSSPP_PLATFORM_MAC 1
|
|
|
|
#else
|
|
|
|
#error "Unknown Apple platform"
|
|
|
|
#endif
|
2019-09-28 16:00:20 +00:00
|
|
|
#elif defined(__SWITCH__)
|
|
|
|
#define PPSSPP_PLATFORM_SWITCH 1
|
2016-10-12 15:32:52 +00:00
|
|
|
#elif defined(__ANDROID__)
|
|
|
|
#define PPSSPP_PLATFORM_ANDROID 1
|
2016-10-20 15:38:53 +00:00
|
|
|
#define PPSSPP_PLATFORM_LINUX 1
|
2016-10-12 15:32:52 +00:00
|
|
|
#elif defined(__linux__)
|
|
|
|
#define PPSSPP_PLATFORM_LINUX 1
|
2023-05-20 02:04:36 +00:00
|
|
|
#elif defined(__OpenBSD__)
|
|
|
|
#define PPSSPP_PLATFORM_OPENBSD 1
|
2016-10-12 15:32:52 +00:00
|
|
|
#endif
|
2019-05-10 21:25:57 +00:00
|
|
|
|
|
|
|
// Windows ARM/ARM64, and Windows UWP (all), are the only platform that don't do GL at all (until Apple finally removes it)
|
|
|
|
#if !PPSSPP_PLATFORM(WINDOWS) || ((!PPSSPP_ARCH(ARM) && !PPSSPP_ARCH(ARM64)) && !PPSSPP_PLATFORM(UWP))
|
|
|
|
#define PPSSPP_API_ANY_GL 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if PPSSPP_PLATFORM(WINDOWS)
|
|
|
|
#if !PPSSPP_PLATFORM(UWP)
|
|
|
|
#define PPSSPP_API_D3D9 1
|
|
|
|
#endif
|
|
|
|
#define PPSSPP_API_D3D11 1
|
|
|
|
#endif
|
2020-10-04 21:24:14 +00:00
|
|
|
|