libsigc++2 r294 - in trunk: . sigc++/macros tests



Author: murrayc
Date: Thu Feb 28 16:50:08 2008
New Revision: 294
URL: http://svn.gnome.org/viewvc/libsigc++2?rev=294&view=rev

Log:
2008-02-28  Elaine Xiong  <elaine xiong sun com>

* sigc++/macros/signal.h.m4:
* tests/test_accum_iter.cc: Add ifdefs around uses of 
reverse_iterator to really fix the build with recent 
versions of Sun CC.
Bug #302098.


Modified:
   trunk/ChangeLog
   trunk/sigc++/macros/signal.h.m4
   trunk/tests/test_accum_iter.cc

Modified: trunk/sigc++/macros/signal.h.m4
==============================================================================
--- trunk/sigc++/macros/signal.h.m4	(original)
+++ trunk/sigc++/macros/signal.h.m4	Thu Feb 28 16:50:08 2008
@@ -178,7 +178,13 @@
       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
       { 
+#ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
         typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
+#else
+        typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
+                                       slot_base, slot_base&, slot_base*, ptrdiff_t> reverse_iterator_type;
+#endif
+
         temp_slot_list slots(impl->slots_);
         reverse_iterator_type it(slots.end());
         for (; it != reverse_iterator_type(slots.begin()); ++it)
@@ -250,7 +256,12 @@
       signal_exec exec(impl);
       temp_slot_list slots(impl->slots_);
 
+#ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
       typedef std::reverse_iterator<signal_impl::iterator_type> reverse_iterator_type;
+#else
+      typedef std::reverse_iterator<signal_impl::iterator_type, std::random_access_iterator_tag,
+                                     slot_base, slot_base&, slot_base*, ptrdiff_t> reverse_iterator_type;
+#endif
       for (reverse_iterator_type it = reverse_iterator_type(slots.end()); it != reverse_iterator_type(slots.begin()); ++it)
         {
           if (it->empty() || it->blocked())

Modified: trunk/tests/test_accum_iter.cc
==============================================================================
--- trunk/tests/test_accum_iter.cc	(original)
+++ trunk/tests/test_accum_iter.cc	Thu Feb 28 16:50:08 2008
@@ -17,7 +17,11 @@
     typedef T result_type;
 
     template<class I>
+#ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR  
         typename std::iterator_traits<I>::value_type operator()(I i1, I i2)
+#else
+        typename I::value_type operator()(I i1, I i2)
+#endif  
         {
             return *std::min_element(i1, i2);
         }



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