From 5b253c76e017aefc43566f6bdbc9e7e3ba7729ff Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 10 Nov 2016 15:24:35 +0100 Subject: [PATCH] Add a guard to avoid multiply defined AVX operators on Windows --- libsrc/general/mysimd.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsrc/general/mysimd.hpp b/libsrc/general/mysimd.hpp index bc00adae..62a87baf 100644 --- a/libsrc/general/mysimd.hpp +++ b/libsrc/general/mysimd.hpp @@ -9,7 +9,9 @@ #include -#ifdef WIN32 +#ifdef WIN32 +#ifndef AVX_OPERATORS_DEFINED +#define AVX_OPERATORS_DEFINED inline __m128d operator- (__m128d a) { return _mm_xor_pd(a, _mm_set1_pd(-0.0)); } inline __m128d operator+ (__m128d a, __m128d b) { return _mm_add_pd(a,b); } inline __m128d operator- (__m128d a, __m128d b) { return _mm_sub_pd(a,b); } @@ -36,6 +38,7 @@ inline __m256d operator-= (__m256d &a, __m256d b) { return a = a-b; } inline __m256d operator*= (__m256d &a, __m256d b) { return a = a*b; } inline __m256d operator/= (__m256d &a, __m256d b) { return a = a/b; } #endif +#endif