1 //===-- llvm/ADT/hash_set - "Portable" wrapper around hash_set --*- 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 //===----------------------------------------------------------------------===//
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
16 //===----------------------------------------------------------------------===//
18 #ifndef LLVM_ADT_HASH_SET
19 #define LLVM_ADT_HASH_SET
21 // Compiler Support Matrix
23 // Version Namespace Header File
25 // 3.0.4 std ext/hash_set
26 // 3.1 __gnu_cxx ext/hash_set
29 // GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
30 // the __gnu_cxx namespace.
31 #if @HAVE_GNU_EXT_HASH_SET@
32 # include <ext/hash_set>
33 # ifndef HASH_NAMESPACE
34 # define HASH_NAMESPACE __gnu_cxx
37 // GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
38 #elif @HAVE_STD_EXT_HASH_SET@
39 # include <ext/hash_set>
40 # ifndef HASH_NAMESPACE
41 # define HASH_NAMESPACE std
44 // Older compilers such as GCC before version 3.0 do not keep
45 // extensions in the `ext' directory, and ignore the `std' namespace.
46 #elif @HAVE_GLOBAL_HASH_SET@
48 # ifndef HASH_NAMESPACE
49 # define HASH_NAMESPACE std
52 // Give a warning if we couldn't find it, instead of (or in addition to)
53 // randomly doing something dumb.
55 # warning "Autoconfiguration failed to find the hash_set header file."
58 using HASH_NAMESPACE::hash_set;
59 using HASH_NAMESPACE::hash;
61 // Include vector because ext/hash_set includes stl_vector.h and leaves
62 // out specializations like stl_bvector.h, causing link conflicts.
65 #include <llvm/ADT/HashExtras.h>