From c2c8f2bd282863ed710fc5a0c504cdfc554d143c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 1 Feb 2019 14:12:29 +0100 Subject: [PATCH] Fix compiling with MSVC --- include/deal.II/base/subscriptor.h | 5 +++++ include/deal.II/base/vectorization.h | 4 ++-- source/base/vectorization.cc | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/deal.II/base/subscriptor.h b/include/deal.II/base/subscriptor.h index 431f8c03e4..aae53ff17d 100644 --- a/include/deal.II/base/subscriptor.h +++ b/include/deal.II/base/subscriptor.h @@ -340,6 +340,11 @@ Subscriptor::list_subscribers(StreamType &stream) const << it.first << '\"' << std::endl; } +// forward declare template specialization +template <> +void +Subscriptor::subscribe(std::atomic *const validity, + const char * id) const; DEAL_II_NAMESPACE_CLOSE #endif diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 3f82e165c5..1b8c47005c 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -178,7 +178,7 @@ public: * case, there is only one element. Specializations use SIMD intrinsics and * can work on multiple elements at the same time. */ - static const unsigned int n_array_elements; + static const unsigned int n_array_elements = 1; // POD means that there should be no user-defined constructors, destructors // and copy functions (the standard is somewhat relaxed in C++2011, though). @@ -453,7 +453,7 @@ private: // We need to have a separate declaration for static const members template -const unsigned int VectorizedArray::n_array_elements = 1; +const unsigned int VectorizedArray::n_array_elements; diff --git a/source/base/vectorization.cc b/source/base/vectorization.cc index 1cc3fe6de6..88ffb1f6bc 100644 --- a/source/base/vectorization.cc +++ b/source/base/vectorization.cc @@ -17,7 +17,7 @@ DEAL_II_NAMESPACE_OPEN -#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 +#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && !defined(DEAL_II_MSVC) const unsigned int VectorizedArray::n_array_elements; const unsigned int VectorizedArray::n_array_elements; #endif -- 2.39.5