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
This commit is contained in:
Zhaofeng Li
2021-06-22 21:05:05 -07:00
committed by Alistair Delva
parent 300242bf56
commit 74aefcb6d2
2 changed files with 6 additions and 4 deletions

View File

@ -92,6 +92,7 @@ Miguel Paris <mparisdiaz@gmail.com>
Raman Budny <budnyjj@gmail.com>
Stephan Hartmann <stha09@googlemail.com>
Lennart Grahl <lennart.grahl@gmail.com>
Zhaofeng Li <hello@zhaofeng.li>
&yet LLC <*@andyet.com>
8x8 Inc. <*@sip-communicator.org>

View File

@ -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