From: Wolfgang Bangerth Date: Thu, 7 Jan 2016 22:30:53 +0000 (-0600) Subject: Use a portable syntax to always inline functions. X-Git-Tag: v8.4.0-rc2~100^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b2aed4bf8995647c62b8af653e29ae4e992f17e;p=dealii.git Use a portable syntax to always inline functions. --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 81475a71f6..59f1b0c330 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -843,7 +843,7 @@ namespace internal namespace TensorSubscriptor { template - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE ArrayElementType & subscript (ArrayElementType *values, const unsigned int i, @@ -869,7 +869,7 @@ namespace internal template -inline __attribute__((always_inline)) +inline DEAL_II_ALWAYS_INLINE typename Tensor::value_type & Tensor::operator[] (const unsigned int i) { @@ -878,7 +878,7 @@ Tensor::operator[] (const unsigned int i) template -inline __attribute__((always_inline)) +inline DEAL_II_ALWAYS_INLINE const typename Tensor::value_type & Tensor::operator[] (const unsigned int i) const { @@ -1468,7 +1468,7 @@ operator- (const Tensor &p, const Tensor */ template -inline __attribute__((always_inline)) +inline DEAL_II_ALWAYS_INLINE typename Tensor::type>::tensor_type operator * (const Tensor &src1, const Tensor &src2) diff --git a/include/deal.II/base/tensor_accessors.h b/include/deal.II/base/tensor_accessors.h index 60d3133fbb..7f5a71574c 100644 --- a/include/deal.II/base/tensor_accessors.h +++ b/include/deal.II/base/tensor_accessors.h @@ -183,7 +183,7 @@ namespace TensorAccessors * @author Matthias Maier, 2015 */ template - __attribute__((always_inline)) internal::ReorderedIndexView + DEAL_II_ALWAYS_INLINE internal::ReorderedIndexView reordered_index_view(T &t) { #ifdef DEAL_II_WITH_CXX11 @@ -264,7 +264,7 @@ namespace TensorAccessors * @author Matthias Maier, 2015 */ template - __attribute__((always_inline)) void contract(T1 &result, const T2 &left, const T3 &right) + DEAL_II_ALWAYS_INLINE void contract(T1 &result, const T2 &left, const T3 &right) { #ifdef DEAL_II_WITH_CXX11 static_assert(rank_1 >= no_contr, "The rank of the left tensor must be " @@ -393,7 +393,7 @@ namespace TensorAccessors value_type; // Recurse by applying index j directly: - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { return value_type(t_[j]); @@ -422,7 +422,7 @@ namespace TensorAccessors typedef StoreIndex > value_type; - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { return value_type(Identity(t_), j); @@ -443,7 +443,7 @@ namespace TensorAccessors typedef typename ReferenceType::value_type>::type value_type; - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { return t_[j]; @@ -466,7 +466,7 @@ namespace TensorAccessors typedef typename ValueType::value_type return_type; - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE typename ReferenceType::type apply(unsigned int j) const { return t_[j]; @@ -492,7 +492,7 @@ namespace TensorAccessors typedef StoreIndex > value_type; - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE value_type operator[](unsigned int j) const { return value_type(*this, j); @@ -524,7 +524,7 @@ namespace TensorAccessors typedef typename ValueType::value_type return_type; typedef return_type value_type; - inline __attribute__((always_inline)) + inline DEAL_II_ALWAYS_INLINE return_type &operator[](unsigned int j) const { return s_.apply(j)[i_]; @@ -595,7 +595,7 @@ namespace TensorAccessors { public: template - inline __attribute__((always_inline)) static + inline DEAL_II_ALWAYS_INLINE static void contract(T1 &result, const T2 &left, const T3 &right) { for (unsigned int i = 0; i < dim; ++i) @@ -623,7 +623,7 @@ namespace TensorAccessors { public: template - inline __attribute__((always_inline)) static + inline DEAL_II_ALWAYS_INLINE static void contract(T1 &result, const T2 &left, const T3 &right) { for (unsigned int i = 0; i < dim; ++i) @@ -651,7 +651,7 @@ namespace TensorAccessors { public: template - inline __attribute__((always_inline)) static + inline DEAL_II_ALWAYS_INLINE static void contract(T1 &result, const T2 &left, const T3 &right) { result = Contract2::template contract2(left, right); @@ -667,7 +667,7 @@ namespace TensorAccessors { public: template - inline __attribute__((always_inline)) static + inline DEAL_II_ALWAYS_INLINE static T1 contract2(const T2 &left, const T3 &right) { T1 result = T1(); @@ -685,7 +685,7 @@ namespace TensorAccessors { public: template - inline __attribute__((always_inline)) static + inline DEAL_II_ALWAYS_INLINE static T1 contract2(const T2 &left, const T3 &right) { return left * right;