Made error message more comprehensible.
[oota-llvm.git] / include / Support / hash_map
1 //===-- Support/hash_map - "Portable" wrapper around hash_map ---*- C++ -*-===//
2 // 
3 // This file provides a wrapper around the mysterious <hash_map> header file
4 // that seems to move around between GCC releases into and out of namespaces at
5 // will.  #including this header will cause hash_map to be available in the
6 // global namespace.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef SUPPORT_HASH_MAP
11 #define SUPPORT_HASH_MAP
12
13 // Compiler Support Matrix
14 //
15 // Version   Namespace   Header File
16 //  2.95.x       ::        hash_map
17 //  3.0.4       std      ext/hash_map
18 //  3.1      __gnu_cxx   ext/hash_map
19 //
20
21 #include "Config/config.h"
22
23 #ifdef HAVE_GNU_EXT_HASH_MAP
24 // This is for GCC-3.1+ which puts hash in ext/hash_map
25 #include <ext/hash_map>
26 #define HASH_NAMESPACE __gnu_cxx
27
28 #else
29
30 // This is for GCC-3.0.x which puts hashmap in the `ext' directory.
31 #ifdef HAVE_STD_EXT_HASH_MAP
32 #include <ext/hash_map>
33 #define HASH_NAMESPACE std
34
35 #else
36 // This handles older, pre-3.0 GCC which do not have the extentions in the `ext'
37 // directory, and ignore the `std' namespace.
38 #include <hash_map>
39 #define HASH_NAMESPACE std
40 #endif
41
42 #endif
43
44 using HASH_NAMESPACE::hash_map;
45 using HASH_NAMESPACE::hash_multimap;
46 using HASH_NAMESPACE::hash;
47
48 // Include vector because ext/hash_map includes stl_vector.h and leaves
49 // out specializations like stl_bvector.h, causing link conflicts.
50 #include <vector>
51
52 #include <Support/HashExtras.h>
53
54 #endif