From e54898f53e73b0cb3cc0d993f7816d14efe59fa6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sun, 7 Sep 2014 23:02:30 +0200 Subject: [PATCH] bug #619: workaround MSVC 2008 implementing std::abs for int only on WINCE --- Eigen/src/Core/MathFunctions.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 5df1fbfec..e9fed2e52 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -12,6 +12,15 @@ namespace Eigen { +// On WINCE, std::abs is defined for int only, so let's defined our own overloads: +// This issue has been confirmed with MSVC 2008 only, but the issue might exist for more recent versions too. +#if defined(_WIN32_WCE) && defined(_MSC_VER) && _MSC_VER<=1500 +long abs(long x) { return (labs(x)); } +double abs(double x) { return (fabs(x)); } +float abs(float x) { return (fabsf(x)); } +long double abs(long double x) { return (fabsl(x)); } +#endif + namespace internal { /** \internal \struct global_math_functions_filtering_base