diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2017-02-10 13:08:49 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2017-02-10 13:08:49 -0800 |
commit | 8b3cc54c42d6f2cc7db6f2a56da0e6510782b747 (patch) | |
tree | 96f56f49a34f7b848d4e053600ac46b5a45fe314 /Eigen/src/Core/util/Macros.h | |
parent | a1ff24f96a1280cd7d7395f739d8f265150879bb (diff) |
Added a new EIGEN_HAS_INDEXED_VIEW define that set to 0 for older compilers that are known to fail to compile the indexed views (I used the define from the indexed_views.cpp test).
Only include the indexed view methods when the compiler supports the code.
This makes it possible to use Eigen again in complex code bases such as TensorFlow and older compilers such as gcc 4.8
Diffstat (limited to 'Eigen/src/Core/util/Macros.h')
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index bc033959c..0e2863306 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -349,6 +349,12 @@ # define __has_feature(x) 0 #endif +#if !( EIGEN_COMP_CLANG && ((EIGEN_COMP_CLANG<309) || defined(__apple_build_version__)) || EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC<49) +#define EIGEN_HAS_INDEXED_VIEW 1 +#else +#define EIGEN_HAS_INDEXED_VIEW 0 +#endif + // Upperbound on the C++ version to use. // Expected values are 03, 11, 14, 17, etc. // By default, let's use an arbitrarily large C++ version. |