diff --git a/configure.ac b/configure.ac index 41e34e9e..020bc9a8 100644 --- a/configure.ac +++ b/configure.ac @@ -453,7 +453,7 @@ AC_SUBST(CFLAGS_AVX2) AC_SUBST(CFLAGS_AESNI) AC_SUBST(CFLAGS_PCLMUL) -AC_CHECK_HEADERS([sys/mman.h]) +AC_CHECK_HEADERS([sys/mman.h intrin.h]) dnl Checks for typedefs, structures, and compiler characteristics. diff --git a/src/libsodium/include/sodium/private/common.h b/src/libsodium/include/sodium/private/common.h index 15612b7b..ffe4d604 100644 --- a/src/libsodium/include/sodium/private/common.h +++ b/src/libsodium/include/sodium/private/common.h @@ -225,6 +225,9 @@ sodium__mm_set1_epi64x(int64_t q) return _mm_set_epi64x(q, q); } # endif + +#elif defined(HAVE_INTRIN_H) +# include #endif #endif diff --git a/src/libsodium/sodium/runtime.c b/src/libsodium/sodium/runtime.c index a66bfb57..8bdcde0d 100644 --- a/src/libsodium/sodium/runtime.c +++ b/src/libsodium/sodium/runtime.c @@ -3,8 +3,8 @@ #ifdef HAVE_ANDROID_GETCPUFEATURES # include #endif -#if (defined(_MSC_VER) && \ - (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) || defined(HAVE__XGETBV) +#if defined(HAVE_INTRIN_H) || (defined(_MSC_VER) && \ + (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) # include #endif