aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-09-07 23:02:30 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-09-07 23:02:30 +0200
commite54898f53e73b0cb3cc0d993f7816d14efe59fa6 (patch)
tree2054a1d396c87c14a4e194fd9dfa082750f2f084 /Eigen/src/Core/MathFunctions.h
parentfafc829424894d8cbb88f52e56cf074a351d92a5 (diff)
bug #619: workaround MSVC 2008 implementing std::abs for int only on WINCE
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r--Eigen/src/Core/MathFunctions.h9
1 files changed, 9 insertions, 0 deletions
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