Fix #include flavor
[oota-llvm.git] / include / llvm / ADT / hash_set.in
1 //===-- llvm/ADT/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 LLVM_ADT_HASH_SET
19 #define LLVM_ADT_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 #undef HAVE_GNU_EXT_HASH_SET
30 #undef HAVE_STD_EXT_HASH_SET
31 #undef HAVE_GLOBAL_HASH_SET
32
33 // GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
34 // the __gnu_cxx namespace.
35 #if HAVE_GNU_EXT_HASH_SET
36 # include <ext/hash_set>
37 # ifndef HASH_NAMESPACE
38 #  define HASH_NAMESPACE __gnu_cxx
39 # endif
40
41 // GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
42 #elif HAVE_STD_EXT_HASH_SET
43 # include <ext/hash_set>
44 # ifndef HASH_NAMESPACE
45 #  define HASH_NAMESPACE std
46 # endif
47
48 // Older compilers such as GCC before version 3.0 do not keep
49 // extensions in the `ext' directory, and ignore the `std' namespace.
50 #elif HAVE_GLOBAL_HASH_SET
51 # include <hash_set>
52 # ifndef HASH_NAMESPACE
53 #  define HASH_NAMESPACE std
54 # endif
55
56 // Give a warning if we couldn't find it, instead of (or in addition to)
57 // randomly doing something dumb.
58 #else
59 # warning "Autoconfiguration failed to find the hash_set header file."
60 #endif
61
62 using HASH_NAMESPACE::hash_set;
63 using HASH_NAMESPACE::hash;
64
65 // Include vector because ext/hash_set includes stl_vector.h and leaves
66 // out specializations like stl_bvector.h, causing link conflicts.
67 #include <vector>
68
69 #include "llvm/ADT/HashExtras.h"
70
71 #endif