1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 10:05:05 -07:00

Define additional capabilities when using Visual Studio

This commit is contained in:
Frank Denis 2023-09-11 00:52:12 +02:00
parent 5b056f65f8
commit 08070591be

View File

@ -228,24 +228,36 @@ xor_buf(unsigned char *out, const unsigned char *in, size_t n)
# endif
#endif
#if defined(_MSC_VER) && \
(defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))
#ifdef _MSC_VER
# include <intrin.h>
# if defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)
# include <intrin.h>
# define HAVE_INTRIN_H 1
# define HAVE_MMINTRIN_H 1
# define HAVE_EMMINTRIN_H 1
# define HAVE_PMMINTRIN_H 1
# define HAVE_TMMINTRIN_H 1
# define HAVE_SMMINTRIN_H 1
# define HAVE_AVXINTRIN_H 1
# if _MSC_VER >= 1600
# define HAVE_WMMINTRIN_H 1
# endif
# if _MSC_VER >= 1700 && defined(_M_X64)
# define HAVE_AVX2INTRIN_H 1
# endif
# if _MSC_VER >= 1910 && defined(_M_X64)
# define HAVE_AVX512FINTRIN_H 1
# endif
# elif defined(_M_ARM64)
# ifdef __ARM_NEON
# define HAVE_ARMCRYPTO 1
# endif
# endif /* _MSC_VER */
# define HAVE_INTRIN_H 1
# define HAVE_MMINTRIN_H 1
# define HAVE_EMMINTRIN_H 1
# define HAVE_PMMINTRIN_H 1
# define HAVE_TMMINTRIN_H 1
# define HAVE_SMMINTRIN_H 1
# define HAVE_AVXINTRIN_H 1
# if _MSC_VER >= 1600
# define HAVE_WMMINTRIN_H 1
# endif
# if _MSC_VER >= 1700 && defined(_M_X64)
# define HAVE_AVX2INTRIN_H 1
# endif
#elif defined(HAVE_INTRIN_H)
# include <intrin.h>
#endif