llvm.org GIT mirror llvm / b60fe77
hash_map and hash_set: * Define HASH_NAMESPACE to `std' in the case of pre-3.0 GCC compilers * Add comments to clarify the intent of all the #ifdef madness * Add VIM directive to highlight files as C++ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7903 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 17 years ago
2 changed file(s) with 13 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
0 //===-- Support/hash_map - "Portable" wrapper around hash_map ---*- C++ -*-===//
1 //
1 // vim:ft=cpp
2 //
23 // This file provides a wrapper around the mysterious header file
34 // that seems to move around between GCC releases into and out of namespaces at
45 // will. #including this header will cause hash_map to be available in the
2021 #include "Config/config.h"
2122
2223 #ifdef HAVE_GNU_EXT_HASH_MAP
23
24 // This is for GCC-3.1+ which puts hash in ext/hash_map
2425 #include
2526 #define HASH_NAMESPACE __gnu_cxx
2627
2728 #else
2829
30 // This is for GCC-3.0.x which puts hashmap in the `ext' directory.
2931 #ifdef HAVE_STD_EXT_HASH_MAP
3032 #include
3133 #define HASH_NAMESPACE std
3234
3335 #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.
3438 #include
35 #define HASH_NAMESPACE
39 #define HASH_NAMESPACE std
3640 #endif
3741
3842 #endif
0 //===-- Support/hash_set - "Portable" wrapper around hash_set ---*- C++ -*-===//
1 // vim:ft=cpp
12 //
23 // This file provides a wrapper around the mysterious header file
34 // that seems to move around between GCC releases into and out of namespaces at
2122
2223 #ifdef HAVE_GNU_EXT_HASH_SET
2324
25 // This is for GCC-3.1+ which puts hashset in ext/hash_set
2426 #include
2527 #define HASH_NAMESPACE __gnu_cxx
2628
2729 #else
2830
31 // This is for GCC-3.0.x which puts hashmap in the `ext' directory.
2932 #ifdef HAVE_STD_EXT_HASH_SET
3033 #include
3134 #define HASH_NAMESPACE std
3235
3336 #else
37 // This handles older, pre-3.0 GCC which do not have the extentions in the `ext'
38 // directory, and ignore the `std' namespace.
3439 #include
35 #define HASH_NAMESPACE
40 #define HASH_NAMESPACE std
3641 #endif
3742
3843 #endif
4752 #include
4853
4954 #endif
50