Skip to content

Commit

Permalink
Merge pull request #116 from notaz/missing_auxv
Browse files Browse the repository at this point in the history
handle more platforms that lack getauxval/AT_HWCAP
  • Loading branch information
rtissera authored May 3, 2024
2 parents 5c598c2 + 6c739c2 commit 0841ba3
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 0841ba3

Please sign in to comment.