From ad457d814e25b032b06d1e279ecce549b0deb5e6 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Wed, 30 Dec 2020 16:19:47 +0100
Subject: [PATCH] Restore MSVC 14.1 compatibility
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- OpenMP pragma parser bug
- std::string doesn’t like to be aligned to more than 256 bits
---
 src/boundary/BoundaryHandling.h | 2 +-
 src/field/Field.impl.h          | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/boundary/BoundaryHandling.h b/src/boundary/BoundaryHandling.h
index 96f93c991..cf724cdc1 100644
--- a/src/boundary/BoundaryHandling.h
+++ b/src/boundary/BoundaryHandling.h
@@ -2230,7 +2230,7 @@ inline void BoundaryHandling< FlagField_T, Stencil, Boundaries... >::operator()(
 
    WALBERLA_ASSERT( checkConsistency( localCells ) );
 
-   #ifdef _OPENMP
+   #if defined(_OPENMP) && !(defined(_MSC_VER) && _MSC_VER < 1925)
    const int zMin = int_c( localCells.zMin() );
    const int zMax = int_c( localCells.zMax() );
    #pragma omp parallel for schedule(static) if(threadSafeBCs_)
diff --git a/src/field/Field.impl.h b/src/field/Field.impl.h
index e1515cb75..4856de7ee 100644
--- a/src/field/Field.impl.h
+++ b/src/field/Field.impl.h
@@ -318,6 +318,12 @@ namespace field {
       {
 #ifdef __BIGGEST_ALIGNMENT__
          const uint_t alignment = __BIGGEST_ALIGNMENT__;
+#elif defined(__AVX512F__)
+         const uint_t alignment = 64;
+#elif defined(__AVX__)
+         const uint_t alignment = 32;
+#elif defined(__SSE__) || defined(_MSC_VER)
+         const uint_t alignment = 16;
 #else
          const uint_t alignment = 64;
 #endif
-- 
GitLab