diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index ecac833a3..5283f8208 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -183,13 +183,12 @@ POSSIBILITY OF SUCH DAMAGE. // ===== ANDROID ===== (almost linux, sort of) #if defined __ANDROID__ -#define TORRENT_ANDROID 1 +#define TORRENT_ANDROID #define TORRENT_HAS_FALLOCATE 0 #define TORRENT_USE_ICONV 0 #define TORRENT_USE_IFADDRS 0 #define TORRENT_USE_MEMALIGN 1 #else // ANDROID -#define TORRENT_ANDROID 0 #define TORRENT_USE_IFADDRS 1 #define TORRENT_USE_POSIX_MEMALIGN 1 diff --git a/src/cpuid.cpp b/src/cpuid.cpp index a061609d1..6de1d1836 100644 --- a/src/cpuid.cpp +++ b/src/cpuid.cpp @@ -46,7 +46,16 @@ POSSIBILITY OF SUCH DAMAGE. #include // for std::memset #endif -#if TORRENT_HAS_ARM && TORRENT_HAS_ARM_NEON +#if defined __GLIBC__ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) +#define TORRENT_HAS_AUXV 1 +#elif defined TORRENT_ANDROID +#define TORRENT_HAS_AUXV 1 +#else +#define TORRENT_HAS_AUXV 0 +#endif + + +#if TORRENT_HAS_ARM && TORRENT_HAS_AUXV #include #endif @@ -95,7 +104,7 @@ namespace libtorrent { namespace aux bool supports_arm_neon() { -#if TORRENT_HAS_ARM_NEON +#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV #if defined __arm__ //return (getauxval(AT_HWCAP) & HWCAP_NEON); return (getauxval(16) & (1 << 12)); @@ -112,7 +121,7 @@ namespace libtorrent { namespace aux bool supports_arm_crc32c() { -#if TORRENT_HAS_ARM_CRC32 +#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV #if defined TORRENT_FORCE_ARM_CRC32 return true; #elif defined __arm__