diff options
author | 2010-10-07 18:09:15 +0200 | |
---|---|---|
committer | 2010-10-07 18:09:15 +0200 | |
commit | a76ce042e649170a32ac663e7888992b94a89937 (patch) | |
tree | 591fdd4547d3014fc7585d650acd58ecd3d77184 | |
parent | af223649881b816f747df2d4f0ff82394846d52a (diff) |
MSVC for windows mobile does not have the errno.h file
-rw-r--r-- | Eigen/Core | 7 | ||||
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Eigen/Core b/Eigen/Core index a76d705b0..6951babd0 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -141,7 +141,14 @@ #include <omp.h> #endif +// MSVC for windows mobile does not have the errno.h file +#if !(defined(_MSC_VER) && defined(_WIN32_WCE)) +#define EIGEN_HAS_ERRNO +#endif + +#ifdef EIGEN_HAS_ERRNO #include <cerrno> +#endif #include <cstdlib> #include <cmath> #include <complex> diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 75c3e5ec4..362ccf18e 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -146,7 +146,9 @@ inline void* ei_generic_aligned_realloc(void* ptr, size_t size, size_t old_size) void* newptr = ei_aligned_malloc(size); if (newptr == 0) { + #ifdef EIGEN_HAS_ERRNO errno = ENOMEM; // according to the standard + #endif return 0; } |