Fixed: Compilation with VC++ 2010

--HG--
branch : develop
This commit is contained in:
kervala 2018-08-09 14:31:17 +02:00
parent f39c6ed3c6
commit 78670dfdda
3 changed files with 28 additions and 1 deletions

View file

@ -79,6 +79,9 @@
# elif _MSC_VER >= 1600 # elif _MSC_VER >= 1600
# define NL_COMP_VC10 # define NL_COMP_VC10
# define NL_COMP_VC_VERSION 100 # define NL_COMP_VC_VERSION 100
# ifdef _HAS_CPP0X
# undef _HAS_CPP0X // VC++ 2010 doesn't implement C++11 stuff we need
# endif
# elif _MSC_VER >= 1500 # elif _MSC_VER >= 1500
# define NL_COMP_VC9 # define NL_COMP_VC9
# define NL_COMP_VC_VERSION 90 # define NL_COMP_VC_VERSION 90

View file

@ -187,7 +187,21 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri
if (isUrl && i > 0 && !markdown) if (isUrl && i > 0 && !markdown)
{ {
// '}' is in the list because of color tags, ie "@{FFFF}http://..." // '}' is in the list because of color tags, ie "@{FFFF}http://..."
const vector<ucchar> chars {' ', '"', '\'', '(', '[', '}'}; #ifdef NL_ISO_CPP0X_AVAILABLE
const vector<ucchar> chars{ ' ', '"', '\'', '(', '[', '}' };
#else
static std::vector<ucchar> chars;
if (chars.empty())
{
chars.push_back(' ');
chars.push_back('"');
chars.push_back('\'');
chars.push_back('(');
chars.push_back('[');
chars.push_back('}');
}
#endif
isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end(); isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end();
} }
return isUrl; return isUrl;

View file

@ -547,6 +547,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
uint32 maxEquipTime = 0; uint32 maxEquipTime = 0;
#ifdef NL_ISO_CPP0X_AVAILABLE
std::map<ITEM_TYPE::TItemType, bool> possiblyDual = std::map<ITEM_TYPE::TItemType, bool> possiblyDual =
{ {
{ITEM_TYPE::ANKLET, false}, {ITEM_TYPE::ANKLET, false},
@ -554,6 +555,15 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
{ITEM_TYPE::EARING, false}, {ITEM_TYPE::EARING, false},
{ITEM_TYPE::RING, false}, {ITEM_TYPE::RING, false},
}; };
#else
std::map<ITEM_TYPE::TItemType, bool> possiblyDual;
possiblyDual[ITEM_TYPE::ANKLET] = false;
possiblyDual[ITEM_TYPE::BRACELET] = false;
possiblyDual[ITEM_TYPE::EARING] = false;
possiblyDual[ITEM_TYPE::RING] = false;
#endif
std::vector<CInventoryItem> duals; std::vector<CInventoryItem> duals;
std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::bag); std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::bag);
for(int i=0; i < items.size(); i++) for(int i=0; i < items.size(); i++)