aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-18 16:36:47 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-18 16:36:47 +0000
commite778ae2559a37b65e9bdd6df687032e33c505cc4 (patch)
treed2d92879fc67d775d53d6e320fe5f22a6b90cd2c /Eigen/src/Core/util
parentbaf0cffedd8774b49708eeb8b0f2c2c2b1ce51ea (diff)
only use alloca on linux. Use malloc on other platforms. Needed for mingw
compatibility.
Diffstat (limited to 'Eigen/src/Core/util')
-rw-r--r--Eigen/src/Core/util/Macros.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 647cfcbfa..51b7a8669 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -52,7 +52,9 @@ using Eigen::Matrix; \
using Eigen::MatrixBase;
#ifdef NDEBUG
-#define EIGEN_NO_DEBUG
+# ifndef EIGEN_NO_DEBUG
+# define EIGEN_NO_DEBUG
+# endif
#endif
#ifndef ei_assert
@@ -146,4 +148,12 @@ friend class Eigen::MatrixBase<Derived>;
#define EIGEN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
#define EIGEN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
+#ifdef __linux__
+# define EIGEN_USE_ALLOCA 1
+# define ei_alloca_or_malloc(condition, size) (condition?alloca(size):malloc(size))
+#else
+# define EIGEN_USE_ALLOCA 0
+# define ei_alloca_or_malloc(condition, size) malloc(size)
+#endif
+
#endif // EIGEN_MACROS_H