mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 12:39:42 +00:00
Add preprocessor check to determine which common_factor header to use.
This commit is contained in:
parent
c68ccbc6b6
commit
cd4303da23
2 changed files with 16 additions and 0 deletions
|
@ -1,6 +1,10 @@
|
||||||
#include "graphicspage.hpp"
|
#include "graphicspage.hpp"
|
||||||
|
|
||||||
|
#if BOOST_VERSION >= 106500
|
||||||
#include <boost/integer/common_factor.hpp>
|
#include <boost/integer/common_factor.hpp>
|
||||||
|
#else
|
||||||
|
#include <boost/math/common_factor.hpp>
|
||||||
|
#endif
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -18,7 +22,11 @@
|
||||||
|
|
||||||
QString getAspect(int x, int y)
|
QString getAspect(int x, int y)
|
||||||
{
|
{
|
||||||
|
#if BOOST_VERSION >= 106500
|
||||||
int gcd = boost::integer::gcd (x, y);
|
int gcd = boost::integer::gcd (x, y);
|
||||||
|
#else
|
||||||
|
int gcd = boost::math::gcd (x, y);
|
||||||
|
#endif
|
||||||
int xaspect = x / gcd;
|
int xaspect = x / gcd;
|
||||||
int yaspect = y / gcd;
|
int yaspect = y / gcd;
|
||||||
// special case: 8 : 5 is usually referred to as 16:10
|
// special case: 8 : 5 is usually referred to as 16:10
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
#include <MyGUI_TabControl.h>
|
#include <MyGUI_TabControl.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#if BOOST_VERSION >= 106500
|
||||||
#include <boost/integer/common_factor.hpp>
|
#include <boost/integer/common_factor.hpp>
|
||||||
|
#else
|
||||||
|
#include <boost/math/common_factor.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <SDL_video.h>
|
#include <SDL_video.h>
|
||||||
|
|
||||||
|
@ -58,7 +62,11 @@ namespace
|
||||||
|
|
||||||
std::string getAspect (int x, int y)
|
std::string getAspect (int x, int y)
|
||||||
{
|
{
|
||||||
|
#if BOOST_VERSION >= 106500
|
||||||
int gcd = boost::integer::gcd (x, y);
|
int gcd = boost::integer::gcd (x, y);
|
||||||
|
#else
|
||||||
|
int gcd = boost::math::gcd (x, y);
|
||||||
|
#endif
|
||||||
int xaspect = x / gcd;
|
int xaspect = x / gcd;
|
||||||
int yaspect = y / gcd;
|
int yaspect = y / gcd;
|
||||||
// special case: 8 : 5 is usually referred to as 16:10
|
// special case: 8 : 5 is usually referred to as 16:10
|
||||||
|
|
Loading…
Reference in a new issue