Skip to content

Commit

Permalink
handle more platforms that lack getauxval/AT_HWCAP
Browse files Browse the repository at this point in the history
also add NO_HWCAP for further opt-out
  • Loading branch information
notaz committed Mar 29, 2024
1 parent 5c598c2 commit 6c739c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deps/lzma-22.01/src/CpuArch.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,17 @@ BoolInt CPU_IsSupported_AES (void) { return 0; }

#else

#include <sys/auxv.h>

#if (defined(__ANDROID_API__) && __ANDROID_API__ < 18) || \
defined(_MIYOO) || defined(_3DS) || defined(NO_HWCAP)
// no getauxval/AT_HWCAP
#else
#define USE_HWCAP
#endif

#ifdef USE_HWCAP

#include <asm/hwcap.h>
#include <sys/auxv.h>

#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
Expand Down

0 comments on commit 6c739c2

Please sign in to comment.