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