From 74aefcb6d2b5c93b1944e15bb34654c68091db53 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 22 Jun 2021 21:05:05 -0700 Subject: [PATCH] ANDROID: arch.h: Add RISC-V support Trivial patch to add support for RISC-V. `__riscv__` is the deprecated definition available on older toolchains. Bug: None Link: https://webrtc-review.googlesource.com/c/src/+/222481 [adelva: cherry-picked back with conflict in AUTHORS only] Change-Id: I0a028de8aedfd18e69c3260f3b810e7502ae4b10 --- AUTHORS | 1 + rtc_base/system/arch.h | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 63d90c271d..0a8aa33b3b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -92,6 +92,7 @@ Miguel Paris Raman Budny Stephan Hartmann Lennart Grahl +Zhaofeng Li &yet LLC <*@andyet.com> 8x8 Inc. <*@sip-communicator.org> diff --git a/rtc_base/system/arch.h b/rtc_base/system/arch.h index be2367b85f..42eb46e71e 100644 --- a/rtc_base/system/arch.h +++ b/rtc_base/system/arch.h @@ -67,12 +67,13 @@ #define WEBRTC_ARCH_32_BITS #endif #define WEBRTC_ARCH_BIG_ENDIAN -#elif defined(__riscv) && __riscv_xlen == 64 +#elif defined(__riscv) || defined(__riscv__) +#define WEBRTC_ARCH_LITTLE_ENDIAN +#if __riscv_xlen == 64 #define WEBRTC_ARCH_64_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(__riscv) && __riscv_xlen == 32 +#else #define WEBRTC_ARCH_32_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN +#endif #elif defined(__pnacl__) #define WEBRTC_ARCH_32_BITS #define WEBRTC_ARCH_LITTLE_ENDIAN