Fixed Boost header deprecation warning on 1.67 and later
Also removed one unnecessary inclusion of the header of the same.
(cherry-picked from commit 78e8ac51d7
)
This commit is contained in:
parent
3028af890c
commit
acb50b25aa
3 changed files with 21 additions and 2 deletions
|
@ -63,7 +63,11 @@
|
|||
#include "gui/widgets/window.hpp"
|
||||
#include "lexical_cast.hpp"
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
#include <boost/integer/common_factor_rt.hpp>
|
||||
#else
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
#endif
|
||||
|
||||
namespace gui2
|
||||
{
|
||||
|
@ -150,7 +154,11 @@ void preferences_dialog::set_resolution_list(menu_button& res_list, CVideo& vide
|
|||
config option;
|
||||
option["label"] = formatter() << res.x << font::unicode_multiplication_sign << res.y;
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
const int div = boost::integer::gcd(res.x, res.y);
|
||||
#else
|
||||
const int div = boost::math::gcd(res.x, res.y);
|
||||
#endif
|
||||
|
||||
const int x_ratio = res.x / div;
|
||||
const int y_ratio = res.y / div;
|
||||
|
|
|
@ -31,7 +31,11 @@
|
|||
|
||||
#include "utils/functional.hpp"
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
#include <boost/integer/common_factor_rt.hpp>
|
||||
#else
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
#endif
|
||||
|
||||
#define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
|
||||
#define LOG_HEADER LOG_SCOPE_HEADER + ':'
|
||||
|
@ -262,7 +266,12 @@ void slider::set_value_range(int min_value, int max_value)
|
|||
int diff = max_value - min_value;
|
||||
int old_value = get_value();
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
step_size_ = boost::integer::gcd(diff, step_size_);
|
||||
#else
|
||||
step_size_ = boost::math::gcd(diff, step_size_);
|
||||
#endif
|
||||
|
||||
minimum_value_ = min_value;
|
||||
|
||||
slider_set_item_last(diff / step_size_);
|
||||
|
@ -281,7 +290,11 @@ void slider::set_step_size(int step_size)
|
|||
const int range_diff = get_item_count() - 1;
|
||||
const int old_value = get_value();
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
step_size_ = boost::integer::gcd(range_diff, step_size);
|
||||
#else
|
||||
step_size_ = boost::math::gcd(range_diff, step_size);
|
||||
#endif
|
||||
slider_set_item_last(range_diff / step_size_);
|
||||
set_value(old_value);
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@
|
|||
#include "game_config_manager.hpp"
|
||||
#include "resources.hpp"
|
||||
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
|
||||
namespace preferences {
|
||||
|
||||
void set_preference_display_settings()
|
||||
|
|
Loading…
Add table
Reference in a new issue