summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/buffer.cc
diff options
context:
space:
mode:
authorMichael Dickens <michael.dickens@ettus.com>2018-11-16 09:50:50 -0800
committerMartin Braun <martin.braun@ettus.com>2018-11-16 11:31:35 -0800
commitf621c1b1d3ce1e5f4eeddc161eb3a25c48bc8a9e (patch)
tree8e76dc94bf727669ec6fc2f90c0b139e0d5c2756 /gnuradio-runtime/lib/buffer.cc
parent853344d67d77296ad0d32155c7f95e17609e44f5 (diff)
runtime: fix use of boost::math::gcd and boost::integer::gcd
+ the former was augmented by the latter in Boost 1.58.0; + they do the same computation; + the former is being deprecated as of Boost 1.66.0, and recommends moving to the latter; + GR supports Boost 1.54.0 and newer, so we need to be able to support both APIs for now.
Diffstat (limited to 'gnuradio-runtime/lib/buffer.cc')
-rw-r--r--gnuradio-runtime/lib/buffer.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc
index db554d21e7..1681c12763 100644
--- a/gnuradio-runtime/lib/buffer.cc
+++ b/gnuradio-runtime/lib/buffer.cc
@@ -31,7 +31,16 @@
#include <iostream>
#include <assert.h>
#include <algorithm>
+
+// the following header is deprecated as of Boost 1.66.0, and the
+// other API was introduced in Boost 1.58.0. Since we still support
+// Boost back to 1.54.0, use the older API if pre-1.5.80 and otherwise
+// use the newer API.
+#if (BOOST_VERSION < 105800)
#include <boost/math/common_factor_rt.hpp>
+#else
+#include <boost/integer/common_factor_rt.hpp>
+#endif
namespace gr {
@@ -75,7 +84,11 @@ namespace gr {
static long
minimum_buffer_items(long type_size, long page_size)
{
+#if (BOOST_VERSION < 105800)
return page_size / boost::math::gcd (type_size, page_size);
+#else
+ return page_size / boost::integer::gcd (type_size, page_size);
+#endif
}