aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared
diff options
context:
space:
mode:
authorAokromes <Aokromes@users.noreply.github.com>2014-05-03 19:25:36 +0200
committerAokromes <Aokromes@users.noreply.github.com>2014-05-03 19:25:36 +0200
commitd7b1405725d2f247776f3586df8c3512416f60cd (patch)
tree3aced294b76f2e78b2d71b2d920297337b1249da /src/server/shared
parentb7a105bcc86b4791e0deeaff7d8ba697821172ae (diff)
parentcbd36d5a4e97d41e56b7339a619ee1072fc9cc17 (diff)
Merge pull request #11968 from Dehravor/cpp11
Core/Misc: Remove remaining COMPILER_HAS_CPP11_SUPPORT related macros
Diffstat (limited to 'src/server/shared')
-rw-r--r--src/server/shared/Common.h2
-rw-r--r--src/server/shared/CompilerDefs.h8
-rw-r--r--src/server/shared/Dynamic/HashNamespace.h119
-rw-r--r--src/server/shared/Dynamic/ObjectRegistry.h2
-rw-r--r--src/server/shared/Dynamic/UnorderedMap.h72
-rw-r--r--src/server/shared/Dynamic/UnorderedSet.h66
-rw-r--r--src/server/shared/Logging/Appender.h5
-rw-r--r--src/server/shared/Logging/Log.h6
8 files changed, 7 insertions, 273 deletions
diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h
index fb153f2ba3e..f49bbf0bada 100644
--- a/src/server/shared/Common.h
+++ b/src/server/shared/Common.h
@@ -61,7 +61,7 @@
#include "Define.h"
-#include "Dynamic/UnorderedMap.h"
+#include <unordered_map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/server/shared/CompilerDefs.h b/src/server/shared/CompilerDefs.h
index 8a557328af4..2c2d7ea861d 100644
--- a/src/server/shared/CompilerDefs.h
+++ b/src/server/shared/CompilerDefs.h
@@ -55,12 +55,4 @@
# error "FATAL ERROR: Unknown compiler."
#endif
-#if defined(__cplusplus) && __cplusplus == 201103L
-# define COMPILER_HAS_CPP11_SUPPORT 1
-#elif _MSC_VER >= 1700
-# define COMPILER_HAS_CPP11_SUPPORT 1
-#else
-# define COMPILER_HAS_CPP11_SUPPORT 0
-#endif
-
#endif
diff --git a/src/server/shared/Dynamic/HashNamespace.h b/src/server/shared/Dynamic/HashNamespace.h
deleted file mode 100644
index 0e95332c05f..00000000000
--- a/src/server/shared/Dynamic/HashNamespace.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TRINITY_HASH_NAMESPACE_H
-#define TRINITY_HASH_NAMESPACE_H
-
-#include "Define.h"
-
-#if COMPILER_HAS_CPP11_SUPPORT
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#elif defined(_STLPORT_VERSION)
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
-# define HASH_NAMESPACE_START namespace std { namespace tr1 {
-# define HASH_NAMESPACE_END } }
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
-# define HASH_NAMESPACE_START namespace stdext {
-# define HASH_NAMESPACE_END }
-
-#if !_HAS_TRADITIONAL_STL
-#ifndef HASH_NAMESPACE
-#define HASH_NAMESPACE
-#else
-
-// can be not used by some platforms, so provide fake forward
-HASH_NAMESPACE_START
-
-template<class K>
-class hash
-{
-public:
- size_t operator() (K const&);
-};
-
-HASH_NAMESPACE_END
-
-#endif
-#endif
-
-#elif COMPILER == COMPILER_INTEL
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
-# define HASH_NAMESPACE_START namespace std { namespace tr1 {
-# define HASH_NAMESPACE_END } }
-#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
-# define HASH_NAMESPACE_START namespace __gnu_cxx {
-# define HASH_NAMESPACE_END }
-
-#include <ext/hash_fun.h>
-#include <string>
-
-HASH_NAMESPACE_START
-
-template<>
-class hash<unsigned long long>
-{
-public:
- size_t operator()(const unsigned long long &__x) const { return (size_t)__x; }
-};
-
-template<typename T>
-class hash<T *>
-{
-public:
- size_t operator()(T * const &__x) const { return (size_t)__x; }
-};
-
-template<> struct hash<std::string>
-{
- size_t operator()(const std::string &__x) const
- {
- return hash<char const*>()(__x.c_str());
- }
-};
-
-HASH_NAMESPACE_END
-
-#else
-# define HASH_NAMESPACE_START namespace std {
-# define HASH_NAMESPACE_END }
-#endif
-
-#if COMPILER != COMPILER_MICROSOFT
-
-// Visual Studio use non standard hash calculation function, so provide fake forward for other
-HASH_NAMESPACE_START
-
-template<class K>
-size_t hash_value(K const&);
-
-HASH_NAMESPACE_END
-
-#endif
-
-#endif
diff --git a/src/server/shared/Dynamic/ObjectRegistry.h b/src/server/shared/Dynamic/ObjectRegistry.h
index 4b17b2fc558..be7ce00ac05 100644
--- a/src/server/shared/Dynamic/ObjectRegistry.h
+++ b/src/server/shared/Dynamic/ObjectRegistry.h
@@ -20,12 +20,12 @@
#define TRINITY_OBJECTREGISTRY_H
#include "Define.h"
-#include "Dynamic/UnorderedMap.h"
#include <ace/Singleton.h>
#include <string>
#include <vector>
#include <map>
+#include <unordered_map>
/** ObjectRegistry holds all registry item of the same type
*/
diff --git a/src/server/shared/Dynamic/UnorderedMap.h b/src/server/shared/Dynamic/UnorderedMap.h
deleted file mode 100644
index f97c4830c75..00000000000
--- a/src/server/shared/Dynamic/UnorderedMap.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TRINITY_UNORDERED_MAP_H
-#define TRINITY_UNORDERED_MAP_H
-
-#include "HashNamespace.h"
-
-#if COMPILER_HAS_CPP11_SUPPORT
-# include <unordered_map>
-#elif COMPILER == COMPILER_INTEL
-# include <ext/hash_map>
-#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
-# include <unordered_map>
-#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
-# include <tr1/unordered_map>
-#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
-# include <ext/hash_map>
-#elif COMPILER == COMPILER_MICROSOFT && ((_MSC_VER >= 1500 && _HAS_TR1) || _MSC_VER >= 1700) // VC9.0 SP1 and later
-# include <unordered_map>
-#else
-# include <hash_map>
-#endif
-
-#ifdef _STLPORT_VERSION
-# define UNORDERED_MAP std::hash_map
-# define UNORDERED_MULTIMAP std::hash_multimap
-#elif COMPILER_HAS_CPP11_SUPPORT
-# define UNORDERED_MAP std::unordered_map
-# define UNORDERED_MULTIMAP std::unordered_multimap
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
-# define UNORDERED_MAP std::tr1::unordered_map
-# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
-# define UNORDERED_MAP std::tr1::unordered_map
-# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
-# define UNORDERED_MAP stdext::hash_map
-# define UNORDERED_MULTIMAP stdext::hash_multimap
-#elif COMPILER == COMPILER_INTEL
-# define UNORDERED_MAP std::hash_map
-# define UNORDERED_MULTIMAP std::hash_multimap
-#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
-# define UNORDERED_MAP std::unordered_map
-# define UNORDERED_MULTIMAP std::unordered_multimap
-#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
-# define UNORDERED_MAP std::tr1::unordered_map
-# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
-#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
-# define UNORDERED_MAP __gnu_cxx::hash_map
-# define UNORDERED_MULTIMAP __gnu_cxx::hash_multimap
-#else
-# define UNORDERED_MAP std::hash_map
-# define UNORDERED_MULTIMAP std::hash_multimap
-#endif
-
-#endif
diff --git a/src/server/shared/Dynamic/UnorderedSet.h b/src/server/shared/Dynamic/UnorderedSet.h
deleted file mode 100644
index 0e084698c47..00000000000
--- a/src/server/shared/Dynamic/UnorderedSet.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TRINITY_UNORDERED_SET_H
-#define TRINITY_UNORDERED_SET_H
-
-#include "HashNamespace.h"
-
-#if COMPILER_HAS_CPP11_SUPPORT
-# include <unordered_set>
-#elif COMPILER == COMPILER_INTEL
-# include <ext/hash_set>
-#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
-# include <unordered_set>
-#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
-# include <tr1/unordered_set>
-#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
-# include <ext/hash_set>
-#elif COMPILER == COMPILER_MICROSOFT && ((_MSC_VER >= 1500 && _HAS_TR1) || _MSC_VER >= 1700) // VC9.0 SP1 and later
-# include <unordered_set>
-#else
-# include <hash_set>
-#endif
-
-#ifdef _STLPORT_VERSION
-# define UNORDERED_SET std::hash_set
-using std::hash_set;
-#elif COMPILER_HAS_CPP11_SUPPORT
-# define UNORDERED_SET std::unordered_set
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
-# define UNORDERED_SET std::tr1::unordered_set
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
-# define UNORDERED_SET std::tr1::unordered_set
-#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
-# define UNORDERED_SET stdext::hash_set
-using stdext::hash_set;
-#elif COMPILER == COMPILER_INTEL
-# define UNORDERED_SET std::hash_set
-using std::hash_set;
-#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
-# define UNORDERED_SET std::unordered_set
-#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
-# define UNORDERED_SET std::tr1::unordered_set
-#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
-# define UNORDERED_SET __gnu_cxx::hash_set
-#else
-# define UNORDERED_SET std::hash_set
-using std::hash_set;
-#endif
-
-#endif
diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h
index b373f0459c9..84d0dc14eca 100644
--- a/src/server/shared/Logging/Appender.h
+++ b/src/server/shared/Logging/Appender.h
@@ -20,8 +20,7 @@
#include "Define.h"
#include <time.h>
-#include "Dynamic/UnorderedMap.h"
-
+#include <unordered_map>
#include <string>
// Values assigned have their equivalent in enum ACE_Log_Priority
@@ -105,6 +104,6 @@ class Appender
AppenderFlags flags;
};
-typedef UNORDERED_MAP<uint8, Appender*> AppenderMap;
+typedef std::unordered_map<uint8, Appender*> AppenderMap;
#endif
diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h
index 73c5601b95b..5fa638e2f40 100644
--- a/src/server/shared/Logging/Log.h
+++ b/src/server/shared/Logging/Log.h
@@ -23,8 +23,8 @@
#include "Appender.h"
#include "Logger.h"
#include "LogWorker.h"
-#include "Dynamic/UnorderedMap.h"
+#include <unordered_map>
#include <string>
#include <ace/Singleton.h>
@@ -34,8 +34,8 @@ class Log
{
friend class ACE_Singleton<Log, ACE_Thread_Mutex>;
- typedef UNORDERED_MAP<std::string, Logger> LoggerMap;
- typedef UNORDERED_MAP<std::string, Logger const*> CachedLoggerContainer;
+ typedef std::unordered_map<std::string, Logger> LoggerMap;
+ typedef std::unordered_map<std::string, Logger const*> CachedLoggerContainer;
private:
Log();