diff --git a/src/avx2-64bit-qsort.hpp b/src/avx2-64bit-qsort.hpp index 764bdcf4..e5f53808 100644 --- a/src/avx2-64bit-qsort.hpp +++ b/src/avx2-64bit-qsort.hpp @@ -379,6 +379,19 @@ struct avx2_vector { return v; } }; + +/* + * workaround on 64-bit macOS which defines size_t as unsigned long and defines + * uint64_t as unsigned long long, both of which are 8 bytes + */ +#if defined(__APPLE__) && defined(__x86_64__) +static_assert(sizeof(size_t) == sizeof(uint64_t), + "Size of size_t and uint64_t are not the same"); +template <> +struct avx2_vector : public avx2_vector { +}; +#endif + template <> struct avx2_vector { using type_t = double;