[nemiver] Fix build with gcc 4.1.2 (Closes: #572704)



commit 00d0c925a5789778dbc8999a27cdbdbfdb106a27
Author: Hans Vercammen <hveso3 gmail com>
Date:   Thu Mar 12 13:16:59 2009 +0100

    Fix build with gcc 4.1.2 (Closes: #572704)
    
    	* src/common/nmv-log-stream.cc: Add a hash functor for std::string
    	  to be used with ext/hash_map.
---
 src/common/nmv-log-stream.cc |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/common/nmv-log-stream.cc b/src/common/nmv-log-stream.cc
index 8bcd74a..0dc4647 100644
--- a/src/common/nmv-log-stream.cc
+++ b/src/common/nmv-log-stream.cc
@@ -46,6 +46,16 @@
 #include <tr1/unordered_map>
 #else
 #include <ext/hash_map>
+
+namespace __gnu_cxx {
+    template<>
+    struct hash<std::string> {
+        size_t operator() (const std::string& s) const
+        {
+            return hash<const char*>() (s.c_str ());
+        }
+    };
+}
 #endif
 
 namespace nemiver {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]