1 //===-- Support/hash_map - "Portable" wrapper around hash_map ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides a wrapper around the mysterious <hash_map> header file
11 // that seems to move around between GCC releases into and out of namespaces at
12 // will. #including this header will cause hash_map to be available in the
15 //===----------------------------------------------------------------------===//
17 #ifndef SUPPORT_HASH_MAP
18 #define SUPPORT_HASH_MAP
20 // Compiler Support Matrix
22 // Version Namespace Header File
24 // 3.0.4 std ext/hash_map
25 // 3.1 __gnu_cxx ext/hash_map
28 #if @HAVE_GNU_EXT_HASH_MAP@
29 // This is for GCC-3.1+ which puts hash in ext/hash_map
30 # include <ext/hash_map>
31 # ifndef HASH_NAMESPACE
32 # define HASH_NAMESPACE __gnu_cxx
35 // GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
36 #elif @HAVE_STD_EXT_HASH_MAP@
37 # include <ext/hash_map>
38 # ifndef HASH_NAMESPACE
39 # define HASH_NAMESPACE std
42 // Older compilers such as GCC before version 3.0 do not keep
43 // extensions in the `ext' directory, and ignore the `std' namespace.
44 #elif @HAVE_GLOBAL_HASH_MAP@
46 # ifndef HASH_NAMESPACE
47 # define HASH_NAMESPACE std
50 // Give a warning if we couldn't find it, instead of (or in addition to)
51 // randomly doing something dumb.
53 # warning "Autoconfiguration failed to find the hash_map header file."
56 using HASH_NAMESPACE::hash_map;
57 using HASH_NAMESPACE::hash_multimap;
58 using HASH_NAMESPACE::hash;
60 // Include vector because ext/hash_map includes stl_vector.h and leaves
61 // out specializations like stl_bvector.h, causing link conflicts.
64 #include <Support/HashExtras.h>