mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-01 07:15:54 +00:00
Fix __builtin_cpu_supports(aes) on GCC 9 and earlier
This commit is contained in:
parent
8fb2c72ca1
commit
8125d2194b
@ -98,6 +98,11 @@ if (HAVE_GETAUXVAL)
|
||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_GETAUXVAL)
|
||||
endif()
|
||||
|
||||
check_c_source_compiles("int main(void) { return __builtin_cpu_supports(\"aes\"); }" HAVE_BICS_AES)
|
||||
if (HAVE_BICS_AES)
|
||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_BICS_AES)
|
||||
endif()
|
||||
|
||||
if (CEC_FOUND)
|
||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
|
||||
list(APPEND MOONLIGHT_OPTIONS CEC)
|
||||
|
@ -113,10 +113,6 @@ bool ensure_buf_size(void **buf, size_t *buf_size, size_t required_size) {
|
||||
}
|
||||
|
||||
bool has_fast_aes() {
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETAUXVAL) && (defined(__arm__) || defined(__aarch64__))
|
||||
#if defined(__arm__) && defined(HWCAP2_AES)
|
||||
return !!(getauxval(AT_HWCAP2) & HWCAP2_AES);
|
||||
@ -125,7 +121,7 @@ bool has_fast_aes() {
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#elif __has_builtin(__builtin_cpu_supports) && (defined(__i386__) || defined(__x86_64__))
|
||||
#elif defined(HAVE_BICS_AES)
|
||||
return __builtin_cpu_supports("aes");
|
||||
#elif defined(__BUILTIN_CPU_SUPPORTS__) && defined(__powerpc__)
|
||||
return __builtin_cpu_supports("vcrypto");
|
||||
|
Loading…
x
Reference in New Issue
Block a user