removed unnessary bits that cmake should be doing for us; replace Misc::gcd with std::gcd

pull/593/head
Bret Curtis 4 years ago
parent c62546fb12
commit 82431b752d

@ -416,7 +416,7 @@ endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++17 -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long")
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON )
if (APPLE)

@ -13,12 +13,13 @@
#include <SDL_video.h>
#include <numeric>
#include <components/files/configurationmanager.hpp>
#include <components/misc/gcd.hpp>
QString getAspect(int x, int y)
{
int gcd = Misc::gcd (x, y);
int gcd = std::gcd (x, y);
int xaspect = x / gcd;
int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10

@ -10,10 +10,10 @@
#include <SDL_video.h>
#include <iomanip>
#include <numeric>
#include <components/debug/debuglog.hpp>
#include <components/misc/stringops.hpp>
#include <components/misc/gcd.hpp>
#include <components/misc/constants.hpp>
#include <components/widgets/sharedstatebutton.hpp>
#include <components/settings/settings.hpp>
@ -60,7 +60,7 @@ namespace
std::string getAspect (int x, int y)
{
int gcd = Misc::gcd (x, y);
int gcd = std::gcd (x, y);
int xaspect = x / gcd;
int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10

@ -86,7 +86,7 @@ add_component_dir (esmterrain
)
add_component_dir (misc
gcd constants utf8stream stringops resourcehelpers rng messageformatparser weakcache
constants utf8stream stringops resourcehelpers rng messageformatparser weakcache
)
add_component_dir (debug

@ -1,13 +0,0 @@
#ifndef MISC_GCD_H
#define MISC_GCD_H
namespace Misc
{
// TODO: replace to the std::gcd() when the C++17 will be available.
int gcd(int a, int b)
{
return b == 0 ? a : gcd(b, a % b);
}
}
#endif
Loading…
Cancel
Save