[PATCH] spirit: fix changesign wrapper

Romain Naour <[email protected]> Fri, 15 May 2015 19:23:35 +0200
Newsgroups gmane.comp.parsers.spirit.devel
Message-ID <[email protected]>
With powerpc target and uClibc toolchain the spirit library doesn't
build properly due to an invalid field access.

"bits" field is intended only for internal use in
include/boost/math/special_functions/sign.hpp not from
include/boost/spirit/home/support/detail/sign.hpp.

This lead to the following build failure:

In file included from ./boost/spirit/home/qi/numeric/detail/real_impl.hpp:22:0,
                 from ./boost/spirit/home/qi/numeric/real.hpp:21,
                 from ./boost/spirit/home/qi/numeric.hpp:17,
                 from ./boost/spirit/include/qi_core.hpp:23,
                 from libs/log/src/default_filter_factory.cpp:21:
./boost/spirit/home/support/detail/sign.hpp: In instantiation of 'T boost::spirit::detail::changesign(T) [with T = long double]':
./boost/spirit/home/qi/numeric/detail/real_impl.hpp:94:50:   required from here
./boost/spirit/home/support/detail/sign.hpp:60:36: error:
no type named 'bits' in 'traits_type {aka struct boost::math::detail::fp_traits_non_native<long double, boost::math::detail::extended_double_precision>}'
         typename traits_type::bits a;

Simply call (boost::math::changesign)(x) from
include/boost/spirit/home/support/detail/sign.hpp to fixes this.

Fixes:
http://autobuild.buildroot.net/results/be1/be1069e8528d299f487f431f7e2d793413ccbab8/build-end.log

Signed-off-by: Romain Naour <[email protected]>
---
 include/boost/spirit/home/support/detail/sign.hpp | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/boost/spirit/home/support/detail/sign.hpp b/include/boost/spirit/home/support/detail/sign.hpp
index 7c1bfb0..2a64e6a 100644
--- a/include/boost/spirit/home/support/detail/sign.hpp
+++ b/include/boost/spirit/home/support/detail/sign.hpp
@@ -55,13 +55,7 @@ namespace boost { namespace spirit { namespace detail
 #if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
         return -x;
 #else
-        typedef typename math::detail::fp_traits<T>::type traits_type;
-
-        typename traits_type::bits a;
-        traits_type::get_bits(x, a);
-        a ^= traits_type::sign;
-        traits_type::set_bits(x, a);
-        return x;
+        return (boost::math::changesign)(x);
 #endif
     }
 #endif
-- 
1.9.3


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y