summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-19 15:30:21 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-05-19 15:30:21 (GMT)
commit594dd9b36a7f3ac37b56c89596ff38451570de3e (patch)
tree8950a435b89378220a624f8cf42e3883a05ff2ec /Source/cmDefinitions.h
parent25d22be514436d8dfbcac0024b952bd059eeabc6 (diff)
parentd7923b82ade9f84d0fc4c6d44b9719f2f7c0e9af (diff)
downloadCMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.zip
CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.gz
CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.bz2
Merge topic 'use-std-unordered_map'
d7923b82 Use std::unordered_map instead of hash_map where available. 820777af Tests: Don't rely on ordering of targets in maps. 921d74d8 AutoGen: Don't iterate over a container while populating it.
Diffstat (limited to 'Source/cmDefinitions.h')
-rw-r--r--Source/cmDefinitions.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 80643a9..bf791ed 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -14,8 +14,12 @@
#include "cmStandardIncludes.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
+#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
+#include <unordered_map>
+#else
#include "cmsys/hash_map.hxx"
#endif
+#endif
#include <list>
@@ -64,9 +68,12 @@ private:
};
static Def NoDef;
- // Local definitions, set or unset.
#if defined(CMAKE_BUILD_WITH_CMAKE)
+#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
+ typedef std::unordered_map<std::string, Def> MapType;
+#else
typedef cmsys::hash_map<std::string, Def> MapType;
+#endif
#else
typedef std::map<std::string, Def> MapType;
#endif