From: Bruno Turcksin Date: Wed, 6 Feb 2019 22:00:24 +0000 (-0500) Subject: Do not use I in header files due to conflict with X-Git-Tag: v9.1.0-rc1~364^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6cd01769019e600993cbe061aef92df62c370fc;p=dealii.git Do not use I in header files due to conflict with The C version of defines the macro I. So when a third-party library such as lapacke include is included before the header the variable I is expanded which trips the compiler. --- diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index d4ea6babc0..3a8617fc91 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -2296,15 +2296,15 @@ namespace Patterns } private: - template + template static std::array::value> to_string_internal_1(const T & t, const Patterns::Tuple &pattern, - std_cxx14::index_sequence) + std_cxx14::index_sequence) { std::array::value> a = { - {Convert::type>::to_string( - std::get(t), pattern.get_pattern(I).clone())...}}; + {Convert::type>::to_string( + std::get(t), pattern.get_pattern(U).clone())...}}; return a; } @@ -2317,15 +2317,15 @@ namespace Patterns std_cxx14::make_index_sequence::value>{}); } - template + template static T to_value_internal_1(const std::vector &s, const Patterns::Tuple & pattern, - std_cxx14::index_sequence) + std_cxx14::index_sequence) { return std::make_tuple( - Convert::type>::to_value( - s[I], pattern.get_pattern(I).clone())...); + Convert::type>::to_value( + s[U], pattern.get_pattern(U).clone())...); } static T diff --git a/include/deal.II/physics/transformations.h b/include/deal.II/physics/transformations.h index 322aa29747..12e8fcc8a3 100644 --- a/include/deal.II/physics/transformations.h +++ b/include/deal.II/physics/transformations.h @@ -852,8 +852,9 @@ namespace internal Tensor<2, dim, Number> tmp_1; for (unsigned int i = 0; i < dim; ++i) for (unsigned int J = 0; J < dim; ++J) - for (unsigned int I = 0; I < dim; ++I) - tmp_1[i][J] += F[i][I] * T[I][J]; + // Loop over I but complex.h defines a macro I, so use I_ instead + for (unsigned int I_ = 0; I_ < dim; ++I_) + tmp_1[i][J] += F[i][I_] * T[I_][J]; dealii::SymmetricTensor<2, dim, Number> out; for (unsigned int i = 0; i < dim; ++i) @@ -918,12 +919,13 @@ namespace internal // Push forward (inner) index 1 Tensor<4, dim, Number> tmp; - for (unsigned int I = 0; I < dim; ++I) + // Loop over I but complex.h defines a macro I, so use I_ instead + for (unsigned int I_ = 0; I_ < dim; ++I_) for (unsigned int j = 0; j < dim; ++j) for (unsigned int K = 0; K < dim; ++K) for (unsigned int L = 0; L < dim; ++L) for (unsigned int J = 0; J < dim; ++J) - tmp[I][j][K][L] += F[j][J] * H[I][J][K][L]; + tmp[I_][j][K][L] += F[j][J] * H[I_][J][K][L]; // Push forward (outer) indices 0 and 3 tmp = contract<1, 0>(F, contract<3, 1>(tmp, F));