aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Macros.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-12-20 22:52:27 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-12-20 22:52:27 +0100
commit2b3fc981b8603820982429520d4362d6b9607bda (patch)
treead99b3558589faf887d2ab69af0a1b8f8a5b6f60 /Eigen/src/Core/util/Macros.h
parent94e8d8902f882058ff9912238e5934ab5632217d (diff)
bug #1362: workaround constant conditional warning produced by MSVC
Diffstat (limited to 'Eigen/src/Core/util/Macros.h')
-rw-r--r--Eigen/src/Core/util/Macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 56b7f0dbb..95960b448 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -628,6 +628,14 @@ namespace Eigen {
#endif
+#if EIGEN_COMP_MSVC
+ // NOTE MSVC often gives C4127 warnings with compiletime if statements. See bug 1362.
+ // This workaround is ugly, but it does the job.
+# define EIGEN_CONST_CONDITIONAL(cond) (void)0, cond
+#else
+# define EIGEN_CONST_CONDITIONAL(cond) cond
+#endif
+
//------------------------------------------------------------------------------------------
// Static and dynamic alignment control
//