MSVC 2015 fix hack around internal compiler crash on openmp atomic
authorMartijn Berger <martijn.berger@gmail.com>
Thu, 10 Dec 2015 13:59:17 +0000 (14:59 +0100)
committerMartijn Berger <martijn.berger@gmail.com>
Thu, 10 Dec 2015 14:00:30 +0000 (15:00 +0100)
Eigen3 bug report: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1131

extern/Eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h

index 3f5ffcf51c77aaa81ec571bbb30bb8c8bb1de205..a36c7c7a61c6202f044e776daa2707e12fbb8f27 100644 (file)
@@ -140,8 +140,14 @@ static void run(Index rows, Index cols, Index depth,
       // Release all the sub blocks B'_j of B' for the current thread,
       // i.e., we simply decrement the number of users by 1
       for(Index j=0; j<threads; ++j)
+      {
         #pragma omp atomic
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+               (info[j].users) -= 1;
+#else
         --(info[j].users);
+#endif
+      }
     }
   }
   else