From 48c97dd3b467ead5f65bcfc078099ddfcfae4a12 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sat, 21 Nov 2020 16:26:26 +0300 Subject: [PATCH] [Base] Android and Arm platform defines --- src/xenia/app/xenia_main.cc | 2 +- src/xenia/base/platform.h | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index bd109681b..97faba005 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -216,7 +216,7 @@ int xenia_main(const std::vector& args) { if (!cvars::portable && !std::filesystem::exists(storage_root / "portable.txt")) { storage_root = xe::filesystem::GetUserFolder(); -#if defined(XE_PLATFORM_WIN32) || defined(XE_PLATFORM_LINUX) +#if defined(XE_PLATFORM_WIN32) || defined(XE_PLATFORM_GNU_LINUX) storage_root = storage_root / "Xenia"; #else #warning Unhandled platform for the data root. diff --git a/src/xenia/base/platform.h b/src/xenia/base/platform.h index 9b98175c5..441d37750 100644 --- a/src/xenia/base/platform.h +++ b/src/xenia/base/platform.h @@ -31,8 +31,14 @@ #define XE_PLATFORM_MAC 1 #elif defined(WIN32) || defined(_WIN32) #define XE_PLATFORM_WIN32 1 -#else +#elif defined(__ANDROID__) +#define XE_PLATFORM_ANDROID 1 #define XE_PLATFORM_LINUX 1 +#elif defined(__gnu_linux__) +#define XE_PLATFORM_GNU_LINUX 1 +#define XE_PLATFORM_LINUX 1 +#else +#error Unsupported target OS. #endif #if defined(__clang__) @@ -51,8 +57,11 @@ #if defined(_M_AMD64) || defined(__amd64__) #define XE_ARCH_AMD64 1 -#elif defined(_M_IX86) -#error "Xenia is not supported on 32-bit platforms." +#elif defined(_M_ARM64) || defined(__aarch64__) +#define XE_ARCH_ARM64 1 +#elif defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || \ + defined(__arm__) +#error Xenia is not supported on 32-bit platforms. #elif defined(_M_PPC) || defined(__powerpc__) #define XE_ARCH_PPC 1 #endif