Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
windows: fix build of simd.cc (union init + template conflict because…
… of same type) By default, first member of union only can be initialized. Gcc has extension to deal with this. For VS, designated initializer is only available from C++20, so it can't be used. So, using macro that init with first field of union. https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.10240.0/km/crt/arm64_neon.h#L103 typedef union __declspec(intrin_type) _ADVSIMD_ALIGN(16) __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; So we must init as __int64[2] instead. --- In more, template conflict cause uint64x2_t and uint32x4_t are same types for VS: https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.10240.0/km/crt/arm64_neon.h#L284 In gcc, those are distinct (builtin) types: https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.10240.0/km/crt/arm64_neon.h#L284
- Loading branch information