pan2 r349 - in trunk: . pan/general pan/tasks pan/usenet-utils



Author: csk
Date: Sat Jul  5 19:23:30 2008
New Revision: 349
URL: http://svn.gnome.org/viewvc/pan2?rev=349&view=rev

Log:
Bug 541704 â pan uses deprecated `hash_set' class


Modified:
   trunk/ChangeLog
   trunk/acinclude.m4
   trunk/configure.in
   trunk/pan/general/quark.h
   trunk/pan/tasks/nntp.cc
   trunk/pan/usenet-utils/scorefile.cc

Modified: trunk/acinclude.m4
==============================================================================
--- trunk/acinclude.m4	(original)
+++ trunk/acinclude.m4	Sat Jul  5 19:23:30 2008
@@ -1,4 +1,20 @@
 
+dnl Benjamin Kosnik <bkoz redhat com> 
+dnl Last Modified 2008-04-17 
+AC_DEFUN([AC_CXX_HEADER_TR1_UNORDERED_SET], [
+  AC_CACHE_CHECK(for tr1/unordered_set,
+  ac_cv_cxx_tr1_unordered_set,
+  [AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  AC_TRY_COMPILE([#include <tr1/unordered_set>], [using std::tr1::unordered_set;],
+  ac_cv_cxx_tr1_unordered_set=yes, ac_cv_cxx_tr1_unordered_set=no)
+  AC_LANG_RESTORE
+  ])
+  if test "$ac_cv_cxx_tr1_unordered_set" = yes; then
+    AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
+  fi
+])
+
 
 
 AC_DEFUN([AC_CXX_NAMESPACES],

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sat Jul  5 19:23:30 2008
@@ -31,6 +31,7 @@
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_CHECK_FUNCS([localtime_r])
+AC_CXX_HEADER_TR1_UNORDERED_SET
 AC_CXX_HAVE_EXT_HASH_SET
 AC_PROG_AWK
 AC_PROG_INSTALL

Modified: trunk/pan/general/quark.h
==============================================================================
--- trunk/pan/general/quark.h	(original)
+++ trunk/pan/general/quark.h	Sat Jul  5 19:23:30 2008
@@ -29,11 +29,14 @@
 #include <string>
 #include <vector>
 
-#if defined(HAVE_EXT_HASH_SET)
+#if defined(HAVE_TR1_UNORDERED_SET)
+# include <tr1/unordered_set>
+#elif defined(HAVE_EXT_HASH_SET)
 # include <ext/hash_set>
 #else
 # include <set>
 #endif
+
 #include <pan/general/string-view.h>
 
 #ifndef UINT32_MAX
@@ -134,8 +137,10 @@
       };
 
 
-#if defined(HAVE_EXT_HASH_SET)
-      typedef __gnu_cxx::hash_set < Impl, StringViewHash > lookup_t;
+#if defined(HAVE_TR1_UNORDERED_SET)
+      typedef std::tr1::unordered_set<Impl, StringViewHash> lookup_t;
+#elif defined(HAVE_EXT_HASH_SET)
+      typedef __gnu_cxx::hash_set<Impl, StringViewHash> lookup_t;
 #else
       typedef std::set<Impl> lookup_t;
 #endif

Modified: trunk/pan/tasks/nntp.cc
==============================================================================
--- trunk/pan/tasks/nntp.cc	(original)
+++ trunk/pan/tasks/nntp.cc	Sat Jul  5 19:23:30 2008
@@ -20,6 +20,7 @@
 #include <config.h>
 #include <cassert>
 #include <cstdarg>
+#include <cstdlib> // abort, atoi, strtoul
 extern "C" {
   #include <glib.h>
   #include <glib/gi18n.h>

Modified: trunk/pan/usenet-utils/scorefile.cc
==============================================================================
--- trunk/pan/usenet-utils/scorefile.cc	(original)
+++ trunk/pan/usenet-utils/scorefile.cc	Sat Jul  5 19:23:30 2008
@@ -18,6 +18,8 @@
  */
 
 #include <config.h>
+#include <algorithm> // std::replace
+#include <cstdlib> // atoi, strtoul
 #include <iostream>
 #include <sstream>
 #include <string>



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