From 7fab6b807ef5b86c97577170b7b5fdc667e3fa20 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 15 Jan 2019 15:04:03 -0800 Subject: math: Replace boost::*::{lcm,gcd}() with portable versions Boost changed the lcm() and gcd() functions in Boost 1.67. This creates portable UHD versions to be used instead. They use various Boost versions under the hood conditionally. --- host/lib/include/uhdlib/usrp/common/adf535x.hpp | 9 ++++----- host/lib/include/uhdlib/usrp/common/lmx2592.hpp | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'host/lib/include') diff --git a/host/lib/include/uhdlib/usrp/common/adf535x.hpp b/host/lib/include/uhdlib/usrp/common/adf535x.hpp index 200610d02..6350261ef 100644 --- a/host/lib/include/uhdlib/usrp/common/adf535x.hpp +++ b/host/lib/include/uhdlib/usrp/common/adf535x.hpp @@ -15,7 +15,6 @@ #include #include #include -#include //gcd #include #include #include @@ -376,8 +375,8 @@ inline double adf535x_impl::_set_frequency( const auto FRAC1 = static_cast(floor((N - INT) * ADF535X_MOD1)); const double residue = (N - INT) * ADF535X_MOD1 - FRAC1; - const double gcd = - boost::math::gcd(static_cast(_pfd_freq), static_cast(freq_resolution)); + const double gcd = double( + uhd::math::gcd(static_cast(_pfd_freq), static_cast(freq_resolution))); const auto MOD2 = static_cast( std::min(floor(_pfd_freq / gcd), static_cast(ADF535X_MAX_MOD2))); const auto FRAC2 = static_cast( @@ -491,8 +490,8 @@ inline double adf535x_impl::_set_frequency( const auto FRAC1 = static_cast(floor((N - INT) * ADF535X_MOD1)); const double residue = (N - INT) * ADF535X_MOD1 - FRAC1; - const double gcd = - boost::math::gcd(static_cast(_pfd_freq), static_cast(freq_resolution)); + const double gcd = double( + uhd::math::gcd(static_cast(_pfd_freq), static_cast(freq_resolution))); const auto MOD2 = static_cast( std::min(floor(_pfd_freq / gcd), static_cast(ADF535X_MAX_MOD2))); const auto FRAC2 = static_cast( diff --git a/host/lib/include/uhdlib/usrp/common/lmx2592.hpp b/host/lib/include/uhdlib/usrp/common/lmx2592.hpp index f71ae0cf5..181b81269 100644 --- a/host/lib/include/uhdlib/usrp/common/lmx2592.hpp +++ b/host/lib/include/uhdlib/usrp/common/lmx2592.hpp @@ -13,7 +13,6 @@ #include #include #include -#include //gcd #include #include #include -- cgit v1.2.3