1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 05:09:41 +00:00

Add preprocessor check to determine which common_factor header to use.

This commit is contained in:
AnyOldName3 2019-02-26 17:03:07 +00:00
parent c68ccbc6b6
commit cd4303da23
2 changed files with 16 additions and 0 deletions

View file

@ -1,6 +1,10 @@
#include "graphicspage.hpp"
#if BOOST_VERSION >= 106500
#include <boost/integer/common_factor.hpp>
#else
#include <boost/math/common_factor.hpp>
#endif
#include <csignal>
#include <QDesktopWidget>
#include <QMessageBox>
@ -18,7 +22,11 @@
QString getAspect(int x, int y)
{
#if BOOST_VERSION >= 106500
int gcd = boost::integer::gcd (x, y);
#else
int gcd = boost::math::gcd (x, y);
#endif
int xaspect = x / gcd;
int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10

View file

@ -8,7 +8,11 @@
#include <MyGUI_TabControl.h>
#include <boost/algorithm/string.hpp>
#if BOOST_VERSION >= 106500
#include <boost/integer/common_factor.hpp>
#else
#include <boost/math/common_factor.hpp>
#endif
#include <SDL_video.h>
@ -58,7 +62,11 @@ namespace
std::string getAspect (int x, int y)
{
#if BOOST_VERSION >= 106500
int gcd = boost::integer::gcd (x, y);
#else
int gcd = boost::math::gcd (x, y);
#endif
int xaspect = x / gcd;
int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10