Apply an upstream patch that ports expression parser to Boost.Phoenix V3
This commit is contained in:
parent
39c7a5351b
commit
9f06b7f329
|
@ -0,0 +1,86 @@
|
|||
diff -up hugin-2013.0.0/src/tools/ParseExp.cpp\~ hugin-2013.0.0/src/tools/ParseExp.cpp
|
||||
--- hugin-2013.0.0/src/tools/ParseExp.cpp~ 2013-10-27 10:19:02.000000000 +0100
|
||||
+++ hugin-2013.0.0/src/tools/ParseExp.cpp 2015-02-03 22:40:30.710550300 +0100
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <limits>
|
||||
#include <iterator>
|
||||
|
||||
+#define BOOST_SPIRIT_USE_PHOENIX_V3 1
|
||||
#include <boost/spirit/version.hpp>
|
||||
#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 <typename X, typename Y>
|
||||
- struct result { typedef X type; };
|
||||
+ typedef double result_type;
|
||||
|
||||
- template <typename X, typename Y>
|
||||
- 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 <typename X, typename Y>
|
||||
- struct result { typedef X type; };
|
||||
+ typedef double result_type;
|
||||
|
||||
- template <typename X, typename Y>
|
||||
- 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 <typename X, typename Y, typename Z>
|
||||
- struct result { typedef Y type; };
|
||||
+ typedef double result_type;
|
||||
|
||||
- template <typename X, typename Y, typename Z>
|
||||
- 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 <typename F, typename A1>
|
||||
- struct result { typedef A1 type; };
|
||||
+ typedef double result_type;
|
||||
|
||||
- template <typename F, typename A1>
|
||||
- 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<double>();
|
||||
};
|
||||
|
||||
// convert deg into rad
|
||||
-double rad(const double d)
|
||||
+const double rad(const double d)
|
||||
{
|
||||
return d*boost::math::constants::pi<double>()/180;
|
||||
};
|
||||
|
||||
Diff finished. Tue Feb 3 22:40:34 2015
|
|
@ -23,6 +23,7 @@ BuildRequires: perl-podlators
|
|||
# Fix FTBFS against latest lensfun-0.3 release
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1168239
|
||||
Patch1: hugin-2013.0.0-lensfun_0.3.patch
|
||||
Patch2: hugin-2013.0.0-boost-phoenix3.patch
|
||||
|
||||
%description
|
||||
hugin can be used to stitch multiple images together. The resulting image can
|
||||
|
@ -46,6 +47,7 @@ without a GUI environment.
|
|||
%setup -q
|
||||
|
||||
%patch1 -p1 -b .lensfun_0.3
|
||||
%patch2 -p1 -b .boost-phoenix3
|
||||
|
||||
%build
|
||||
%cmake . -DBUILD_HSI=1
|
||||
|
@ -190,6 +192,8 @@ fi
|
|||
%changelog
|
||||
* Tue Feb 03 2015 Petr Machata <pmachata@redhat.com> - 2014.0.0-3
|
||||
- Rebuild for boost 1.57.0
|
||||
- Apply an upstream patch that ports expression parser to
|
||||
Boost.Phoenix V3 (hugin-2013.0.0-boost-phoenix3.patch)
|
||||
|
||||
* Mon Feb 02 2015 Bruno Postle <bruno@postle.net> - 2014.0.0-2
|
||||
- Upstream release
|
||||
|
|
Loading…
Reference in New Issue