From a76ce042e649170a32ac663e7888992b94a89937 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 7 Oct 2010 18:09:15 +0200 Subject: MSVC for windows mobile does not have the errno.h file --- Eigen/Core | 7 +++++++ Eigen/src/Core/util/Memory.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Eigen/Core b/Eigen/Core index a76d705b0..6951babd0 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -141,7 +141,14 @@ #include #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 +#endif #include #include #include 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; } -- cgit v1.2.3