mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
gcc update:
- removed support for 4.6 - compilation fixes for 4.7
This commit is contained in:
@@ -1213,7 +1213,6 @@ std::vector<const CGObjectInstance *> VCAI::getPossibleDestinations(HeroPtr h)
|
|||||||
std::vector<const CGObjectInstance *> possibleDestinations;
|
std::vector<const CGObjectInstance *> possibleDestinations;
|
||||||
for(const CGObjectInstance *obj : visitableObjs)
|
for(const CGObjectInstance *obj : visitableObjs)
|
||||||
{
|
{
|
||||||
const int3 pos = obj->visitablePos();
|
|
||||||
if (isGoodForVisit(obj, h))
|
if (isGoodForVisit(obj, h))
|
||||||
{
|
{
|
||||||
possibleDestinations.push_back(obj);
|
possibleDestinations.push_back(obj);
|
||||||
@@ -1305,7 +1304,7 @@ void VCAI::wander(HeroPtr h)
|
|||||||
if(townsReachable.size())
|
if(townsReachable.size())
|
||||||
{
|
{
|
||||||
boost::sort(townsReachable, compareReinforcements);
|
boost::sort(townsReachable, compareReinforcements);
|
||||||
dests.emplace_back(townsReachable.back());
|
dests.push_back(townsReachable.back());
|
||||||
}
|
}
|
||||||
else if(townsNotReachable.size())
|
else if(townsNotReachable.size())
|
||||||
{
|
{
|
||||||
|
|||||||
11
Global.h
11
Global.h
@@ -24,12 +24,12 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|||||||
# define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__)
|
# define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__clang__) && defined(__GNUC__) && (GCC_VERSION < 460)
|
#if !defined(__clang__) && defined(__GNUC__) && (GCC_VERSION < 470)
|
||||||
# error VCMI requires at least gcc-4.6 for successful compilation or clang-3.1. Please update your compiler
|
# error VCMI requires at least gcc-4.7.2 for successful compilation or clang-3.1. Please update your compiler
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && (GCC_VERSION == 470 || GCC_VERSION == 471)
|
#if defined(__GNUC__) && (GCC_VERSION == 470 || GCC_VERSION == 471)
|
||||||
# error This GCC version has buggy std::array::at version and should not be used. Please update to 4.7.2 or use 4.6.x.
|
# error This GCC version has buggy std::array::at version and should not be used. Please update to 4.7.2 or later
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
@@ -42,11 +42,6 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|||||||
# define CPP11_USE_INITIALIZERS_LIST
|
# define CPP11_USE_INITIALIZERS_LIST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//override keyword - not present in gcc-4.6
|
|
||||||
#if !defined(_MSC_VER) && !defined(__clang__) && !(defined(__GNUC__) && (GCC_VERSION >= 470))
|
|
||||||
# define override
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
/* Suppress some compiler warnings */
|
/* Suppress some compiler warnings */
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|||||||
@@ -332,7 +332,6 @@ void RemoveObject::applyFirstCl( CClient *cl )
|
|||||||
|
|
||||||
CGI->mh->hideObject(o);
|
CGI->mh->hideObject(o);
|
||||||
|
|
||||||
int3 pos = o->visitablePos();
|
|
||||||
//notify interfaces about removal
|
//notify interfaces about removal
|
||||||
for(auto i=cl->playerint.begin(); i!=cl->playerint.end(); i++)
|
for(auto i=cl->playerint.begin(); i!=cl->playerint.end(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -515,8 +515,8 @@ void CRmgTemplateZone::placeObject(CMapGenerator* gen, CGObjectInstance* object,
|
|||||||
|
|
||||||
auto points = object->getBlockedPos();
|
auto points = object->getBlockedPos();
|
||||||
if (object->isVisitable())
|
if (object->isVisitable())
|
||||||
points.emplace(pos + object->getVisitableOffset());
|
points.insert(pos + object->getVisitableOffset());
|
||||||
points.emplace(pos);
|
points.insert(pos);
|
||||||
for(auto const &p : points)
|
for(auto const &p : points)
|
||||||
{
|
{
|
||||||
if (tileinfo.find(pos + p) != tileinfo.end())
|
if (tileinfo.find(pos + p) != tileinfo.end())
|
||||||
|
|||||||
Reference in New Issue
Block a user