MSVC for windows mobile does not have the errno.h file

This commit is contained in:
Gael Guennebaud 2010-10-07 18:09:15 +02:00
parent af22364988
commit a76ce042e6
2 changed files with 9 additions and 0 deletions

View File

@ -141,7 +141,14 @@
#include <omp.h> #include <omp.h>
#endif #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> #include <cerrno>
#endif
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
#include <complex> #include <complex>

View File

@ -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); void* newptr = ei_aligned_malloc(size);
if (newptr == 0) if (newptr == 0)
{ {
#ifdef EIGEN_HAS_ERRNO
errno = ENOMEM; // according to the standard errno = ENOMEM; // according to the standard
#endif
return 0; return 0;
} }