[llvm-commits] CVS: llvm/include/Support/hash_map hash_set

Brian Gaeke gaeke at cs.uiuc.edu
Sun Nov 9 21:07:21 PST 2003


Changes in directory llvm/include/Support:

hash_map updated: 1.13 -> 1.14
hash_set updated: 1.12 -> 1.13

---
Log message:

Patch to fix PR102, contributed by Reid Spencer.


---
Diffs of the changes:  (+43 -29)

Index: llvm/include/Support/hash_map
diff -u llvm/include/Support/hash_map:1.13 llvm/include/Support/hash_map:1.14
--- llvm/include/Support/hash_map:1.13	Mon Oct 20 14:46:57 2003
+++ llvm/include/Support/hash_map	Sun Nov  9 21:06:09 2003
@@ -29,23 +29,30 @@
 
 #ifdef HAVE_GNU_EXT_HASH_MAP
 // This is for GCC-3.1+ which puts hash in ext/hash_map
-#include <ext/hash_map>
-#define HASH_NAMESPACE __gnu_cxx
+# include <ext/hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE __gnu_cxx
+# endif
 
-#else
+// GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
+#elif defined(HAVE_STD_EXT_HASH_MAP)
+# include <ext/hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
 
-// This is for GCC-3.0.x which puts hashmap in the `ext' directory.
-#ifdef HAVE_STD_EXT_HASH_MAP
-#include <ext/hash_map>
-#define HASH_NAMESPACE std
+// Older compilers such as GCC before version 3.0 do not keep
+// extensions in the `ext' directory, and ignore the `std' namespace.
+#elif defined(HAVE_GLOBAL_HASH_MAP)
+# include <hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
 
+// Give a warning if we couldn't find it, instead of (or in addition to)
+// randomly doing something dumb.
 #else
-// This handles older, pre-3.0 GCC which do not have the extentions in the `ext'
-// directory, and ignore the `std' namespace.
-#include <hash_map>
-#define HASH_NAMESPACE std
-#endif
-
+# warning "Autoconfiguration failed to find the hash_map header file."
 #endif
 
 using HASH_NAMESPACE::hash_map;


Index: llvm/include/Support/hash_set
diff -u llvm/include/Support/hash_set:1.12 llvm/include/Support/hash_set:1.13
--- llvm/include/Support/hash_set:1.12	Mon Oct 20 14:46:57 2003
+++ llvm/include/Support/hash_set	Sun Nov  9 21:06:09 2003
@@ -28,26 +28,33 @@
 
 #include "Config/config.h"
 
-#ifdef HAVE_GNU_EXT_HASH_SET
+// GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
+// the __gnu_cxx namespace.
+#if defined(HAVE_GNU_EXT_HASH_SET)
+# include <ext/hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE __gnu_cxx
+# endif
 
-// This is for GCC-3.1+ which puts hashset in ext/hash_set
-#include <ext/hash_set>
-#define HASH_NAMESPACE __gnu_cxx
+// GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
+#elif defined(HAVE_STD_EXT_HASH_SET)
+# include <ext/hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
 
-#else
-
-// This is for GCC-3.0.x which puts hashmap in the `ext' directory.
-#ifdef HAVE_STD_EXT_HASH_SET
-#include <ext/hash_set>
-#define HASH_NAMESPACE std
+// Older compilers such as GCC before version 3.0 do not keep
+// extensions in the `ext' directory, and ignore the `std' namespace.
+#elif defined(HAVE_GLOBAL_HASH_SET)
+# include <hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
 
+// Give a warning if we couldn't find it, instead of (or in addition to)
+// randomly doing something dumb.
 #else
-// This handles older, pre-3.0 GCC which do not have the extentions in the `ext'
-// directory, and ignore the `std' namespace.
-#include <hash_set>
-#define HASH_NAMESPACE std
-#endif
-
+# warning "Autoconfiguration failed to find the hash_set header file."
 #endif
 
 using HASH_NAMESPACE::hash_set;





More information about the llvm-commits mailing list