]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/list.cpp
Multilib linking fixes.
[wxWidgets.git] / src / common / list.cpp
index fed64c544f3b8a5b02d41ba2eb12ef65e15a1fa7..8c6d14fdba637dc1127dfa774ee85dbff31824bc 100644 (file)
@@ -37,6 +37,8 @@
     #include "wx/list.h"
 #endif
 
+#if !wxUSE_STL
+
 // =============================================================================
 // implementation
 // =============================================================================
@@ -44,7 +46,6 @@
 // -----------------------------------------------------------------------------
 // wxListKey
 // -----------------------------------------------------------------------------
-
 wxListKey wxDefaultListKey;
 
 bool wxListKey::operator==(wxListKeyValue value) const
@@ -518,7 +519,11 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
     }
 
     // sort the array
-    qsort((void *)objArray,num,sizeof(wxObject *),compfunc);
+    qsort((void *)objArray,num,sizeof(wxObject *),
+#ifdef __WXWINCE__
+        (int (__cdecl *)(const void *,const void *))
+#endif
+        compfunc);
 
     // put the sorted pointers back into the list
     objPtr = objArray;
@@ -531,6 +536,38 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
     delete[] objArray;
 }
 
+void wxListBase::Reverse()
+{
+    wxNodeBase* node = m_nodeFirst;
+    wxNodeBase* tmp;
+
+    while (node)
+    {
+        // swap prev and next pointers
+        tmp = node->m_next;
+        node->m_next = node->m_previous;
+        node->m_previous = tmp;
+
+        // this is the node that was next before swapping
+        node = tmp;
+    }
+
+    // swap first and last node
+    tmp = m_nodeFirst; m_nodeFirst = m_nodeLast; m_nodeLast = tmp;
+}
+
+void wxListBase::DeleteNodes(wxNodeBase* first, wxNodeBase* last)
+{
+    wxNodeBase* node = first;
+
+    while (node != last)
+    {
+        wxNodeBase* next = node->GetNext();
+        DeleteNode(node);
+        node = next;
+    }
+}
+
 // ============================================================================
 // compatibility section from now on
 // ============================================================================
@@ -689,7 +726,12 @@ bool wxStringList::Member(const wxChar *s) const
     return FALSE;
 }
 
+#ifdef __WXWINCE__
+extern "C" int __cdecl
+#else
 extern "C" int LINKAGEMODE
+#endif
+
 wx_comparestrings(const void *arg1, const void *arg2)
 {
   wxChar **s1 = (wxChar **) arg1;
@@ -732,3 +774,4 @@ wxNode *wxStringList::Prepend(const wxChar *s)
 
 #endif // wxLIST_COMPATIBILITY
 
+#endif // !wxUSE_STL