From 695a7ab9d74f53a9576e74e87410d7c9ce5abe73 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 15 May 2012 08:18:39 +0200 Subject: [PATCH] protect min/max with parenthesis --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index d6c2a29de..70d3222f5 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -539,13 +539,13 @@ inline const AutoDiffScalar& real(const AutoDiffScalar& x) { template inline typename DerType::Scalar imag(const AutoDiffScalar&) { return 0.; } template -inline AutoDiffScalar min(const AutoDiffScalar& x, const T& y) { return (x <= y ? x : y); } +inline AutoDiffScalar (min)(const AutoDiffScalar& x, const T& y) { return (x <= y ? x : y); } template -inline AutoDiffScalar max(const AutoDiffScalar& x, const T& y) { return (x >= y ? x : y); } +inline AutoDiffScalar (max)(const AutoDiffScalar& x, const T& y) { return (x >= y ? x : y); } template -inline AutoDiffScalar min(const T& x, const AutoDiffScalar& y) { return (x < y ? x : y); } +inline AutoDiffScalar (min)(const T& x, const AutoDiffScalar& y) { return (x < y ? x : y); } template -inline AutoDiffScalar max(const T& x, const AutoDiffScalar& y) { return (x > y ? x : y); } +inline AutoDiffScalar (max)(const T& x, const AutoDiffScalar& y) { return (x > y ? x : y); } #define sign(x) x >= 0 ? 1 : -1 // required for abs function below