Index: hugin-2014.0.0/src/tools/ParseExp.cpp =================================================================== --- hugin-2014.0.0.orig/src/tools/ParseExp.cpp +++ hugin-2014.0.0/src/tools/ParseExp.cpp @@ -34,6 +34,7 @@ #include #include +#define BOOST_SPIRIT_USE_PHOENIX_V3 1 #include #if !defined(SPIRIT_VERSION) || SPIRIT_VERSION < 0x2010 #error "At least Spirit version 2.1 required" @@ -50,11 +51,9 @@ namespace Parser //power function struct lazy_pow_ { - template - struct result { typedef X type; }; + typedef double result_type; - template - X operator()(X x, Y y) const + double operator()(double x, double y) const { return std::pow(x, y); } @@ -63,11 +62,9 @@ struct lazy_pow_ // modulus for double values struct lazy_mod_ { - template - struct result { typedef X type; }; + typedef double result_type; - template - X operator()(X x, Y y) const + double operator()(double x, double y) const { return std::fmod(x,y); } @@ -76,37 +73,33 @@ struct lazy_mod_ // if statement struct lazy_if_ { - template - struct result { typedef Y type; }; + typedef double result_type; - template - X operator()(X x, Y y, Z z) const + double operator()(double x, double y, double z) const { - return x ? y : z; + return (std::fabs(x)>1e-5) ? y : z; } }; // wrapper for unary function struct lazy_ufunc_ { - template - struct result { typedef A1 type; }; + typedef double result_type; - template - A1 operator()(F f, A1 a1) const + double operator()(double (*f)(double), double a1) const { return f(a1); } }; // convert rad into deg -double deg(const double d) +const double deg(const double d) { return d*180.0/boost::math::constants::pi(); }; // convert deg into rad -double rad(const double d) +const double rad(const double d) { return d*boost::math::constants::pi()/180; };