nemiver r932 - in trunk: . src/common
- From: dodji svn gnome org
- To: svn-commits-list gnome org
- Subject: nemiver r932 - in trunk: . src/common
- Date: Sat, 27 Sep 2008 19:03:47 +0000 (UTC)
Author: dodji
Date: Sat Sep 27 19:03:47 2008
New Revision: 932
URL: http://svn.gnome.org/viewvc/nemiver?rev=932&view=rev
Log:
Use std::tr1::unordered_map, when available, instead of __gnu stuff.
* src/common/nmv-log-stream.cc: Use std::tr1::unordered_map when
available instead of deprecated __gnu features.
This patch is from "BenoÃt Dejean" <benoit placenet org>.
Modified:
trunk/ChangeLog
trunk/src/common/nmv-log-stream.cc
Modified: trunk/src/common/nmv-log-stream.cc
==============================================================================
--- trunk/src/common/nmv-log-stream.cc (original)
+++ trunk/src/common/nmv-log-stream.cc Sat Sep 27 19:03:47 2008
@@ -30,7 +30,6 @@
#include <cstring>
#include <sys/time.h>
#include <iostream>
-#include <ext/hash_map>
#include <list>
#include <vector>
#include <fstream>
@@ -43,8 +42,11 @@
#include "nmv-date-utils.h"
#include "nmv-safe-ptr-utils.h"
-using __gnu_cxx::hash_map ;
-using __gnu_cxx::hash ;
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
+#include <tr1/unordered_map>
+#else
+#include <ext/hash_map>
+#endif
namespace nemiver {
namespace common {
@@ -59,6 +61,16 @@
}
};
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
+struct DomainMap
+ : std::tr1::unordered_map<const char*, bool, std::tr1::hash<const char*>, Eqstr>
+{ };
+#else
+struct DomainMap
+ : __gnu_cxx::hash_map<const char*, bool, __gnu_cxx::hash<const char*>, Eqstr>
+{ };
+#endif
+
static enum LogStream::StreamType s_stream_type = LogStream::COUT_STREAM ;
static enum LogStream::LogLevel s_level_filter = LogStream::LOG_LEVEL_NORMAL ;
static bool s_is_active = true ;
@@ -221,7 +233,7 @@
//Logging domains are just keywords associated to the messages that are
//going to be logged. This helps in for filtering the messages that
//are to be logged or not.
- hash_map<const char*, bool, hash<const char*>, Eqstr > allowed_domains ;
+ DomainMap allowed_domains ;
//the log level of this log stream
enum LogStream::LogLevel level ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]