Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index



Building LO on OpenSUSE 42.2, against the latest available system
boost library (1.54.0), is failing here with:

/home/davido/projects/libo/tools/source/generic/fract.cxx:183:25:
error: ‘boost::integer’ has not been declared
         T gcd1 = boost::integer::gcd(i.numerator(), den);

Looking into the most recent version:

http://www.boost.org/doc/libs/1_64_0/boost/rational.hpp

reveals, that this part of the code is consumed from:

#include <boost/integer/common_factor_rt.hpp> // for
boost::integer::gcd, lcm

On 1.54 the similar line in rational.hpp read:

#include <boost/math/common_factor_rt.hpp>  // for boost::math::gcd,
lcm

So that this diff fixed the problem here:

diff --git a/tools/source/generic/fract.cxx
b/tools/source/generic/fract.cxx
index bc9bef467e86..02fb711c0c84 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -180,8 +180,8 @@ namespace
         T den = r.denominator();
 
         // Avoid overflow and preserve normalization
-        T gcd1 = boost::integer::gcd(i.numerator(), den);
-        T gcd2 = boost::integer::gcd(num, i.denominator());
+        T gcd1 = boost::math::gcd(i.numerator(), den);
+        T gcd2 = boost::math::gcd(num, i.denominator());
 
         bool fail = false;
         fail |= o3tl::checked_multiply(i.numerator() / gcd1, num /
gcd2, num);

Unless we want to make the code compile against different boost
versions, should we rather bump the boost version check?

My autogen.input is: [1].

* [1] http://paste.openstack.org/show/608796/


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.