summaryrefslogtreecommitdiffstats
path: root/libraries/libclaw/patches/02_libclaw-1.7.4-gcc62.patch
blob: e1da77043db4c73d82e8d5e358a857d7e05d99a2 (plain)
From a13a75306bba55538ba7d5188ffc1a7eb34f173b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 28 Nov 2016 10:21:33 +0100
Subject: [PATCH 1/2] Deal with correct getline() type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

  libclaw-1.7.4/claw/code/configuration_file.cpp:
    In member function ‘bool claw::configuration_file::get_line(std::istream&,
    const claw::configuration_file::syntax_description&, std::__cxx11::string&) const’:
  libclaw-1.7.4/claw/code/configuration_file.cpp:444:39: error: cannot convert
    ‘std::basic_istream<char>’ to ‘bool’ in initialization
       bool result = text::getline(is, line);
---
 claw/code/configuration_file.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/claw/code/configuration_file.cpp b/claw/code/configuration_file.cpp
index e7bb26a..3839cff 100644
--- a/claw/code/configuration_file.cpp
+++ b/claw/code/configuration_file.cpp
@@ -441,7 +441,7 @@ claw::configuration_file::file_end() const
 bool claw::configuration_file::get_line
 ( std::istream& is, const syntax_description& syntax, std::string& line ) const
 {
-  bool result = text::getline(is, line);
+  bool result = text::getline(is, line).good();
 
   if ( result )
     {
-- 
2.9.3

From cadc97d9626307d2f1fcf113099c9c4ca0f7cf6b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 28 Nov 2016 10:09:33 +0100
Subject: [PATCH 2/2] Do something random to make C++ happy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

  In file included from /usr/include/boost/bind.hpp:22:0, libclaw-1.7.4/claw/code/tween/single_tweener.cpp:32:
  /usr/include/boost/bind/bind.hpp: In instantiation of ‘void boost::_bi::list2<A1, A2>::operator()(boost::_bi::type<void>, F&, A&, int) [with F = void (*)(double&, double&); A = boost::_bi::rrlist1<double>; A1 = boost::reference_wrapper<double>; A2 = boost::arg<1>]’:
  /usr/include/boost/bind/bind.hpp:1234:50:   required from ‘boost::_bi::bind_t<R, F, L>::result_type boost::_bi::bind_t<R, F, L>::operator()(A1&&) [with A1 = double; R = void; F = void (*)(double&, double&); L = boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> >; boost::_bi::bind_t<R, F, L>::result_type = void]’
  /usr/include/boost/function/function_template.hpp:159:11:   required from ‘static void boost::detail::function::void_function_obj_invoker1<FunctionObj, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionObj = boost::_bi::bind_t<void, void (*)(double&, double&), boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> > >; R = void; T0 = double]’
  /usr/include/boost/function/function_template.hpp:937:38:   required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = boost::_bi::bind_t<void, void (*)(double&, double&), boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> > >; R = void; T0 = double]’
  /usr/include/boost/function/function_template.hpp:727:7:   required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type) [with Functor = boost::_bi::bind_t<void, void (*)(double&, double&), boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> > >; R = void; T0 = double; typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type = int]’
  /usr/include/boost/function/function_template.hpp:1073:16:   required from ‘boost::function<R(T0)>::function(Functor, typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type) [with Functor = boost::_bi::bind_t<void, void (*)(double&, double&), boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> > >; R = void; T0 = double; typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type = int]’
  /usr/include/boost/function/function_template.hpp:1126:5:   required from ‘typename boost::enable_if_c<(! boost::is_integral<Functor>::value), boost::function<R(T0)>&>::type boost::function<R(T0)>::operator=(Functor) [with Functor = boost::_bi::bind_t<void, void (*)(double&, double&), boost::_bi::list2<boost::reference_wrapper<double>, boost::arg<1> > >; R = void; T0 = double; typename boost::enable_if_c<(! boost::is_integral<Functor>::value), boost::function<R(T0)>&>::type = boost::function<void(double)>&]’
  libclaw-1.7.4/claw/code/tween/single_tweener.cpp:125:62:	 required from here
  /usr/include/boost/bind/bind.hpp:319:35: error: invalid initialization of non-const reference of type ‘double&’ from an rvalue of type ‘double’
  	 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
  	 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CMakeFiles/claw_tween-static.dir/build.make:89: recipe for target 'CMakeFiles/claw_tween-static.dir/claw/code/tween/single_tweener.cpp.o' failed
---
 claw/code/tween/single_tweener.cpp | 2 +-
 claw/tween/single_tweener.hpp      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/claw/code/tween/single_tweener.cpp b/claw/code/tween/single_tweener.cpp
index 2a3c7fe..d173eec 100644
--- a/claw/code/tween/single_tweener.cpp
+++ b/claw/code/tween/single_tweener.cpp
@@ -241,7 +241,7 @@ double claw::tween::single_tweener::do_update( double dt )
   const double result = dt - t;
   m_date += t;
 
-  const double val( get_value() );
+  double val( get_value() );
 
   m_callback(val);
 
diff --git a/claw/tween/single_tweener.hpp b/claw/tween/single_tweener.hpp
index 9f05671..f730cfa 100644
--- a/claw/tween/single_tweener.hpp
+++ b/claw/tween/single_tweener.hpp
@@ -51,7 +51,7 @@ namespace claw
     public:
       /** \brief The type of the function called when the single_tweener is
           updated. */
-      typedef boost::function<void (double)> update_function;
+      typedef boost::function<void (double&)> update_function;
 
       /** \brief The type of the function used to compute the new value. */
       typedef boost::function<double (double)> easing_function;
-- 
2.9.3