+ /* Find smallest element in first threshold and place it at the
+ array's beginning. This is the smallest array element,
+ and the operation speeds up insertion sort's inner loop. */
+
+ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size)
+ if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, user_data) < 0)
+ tmp_ptr = run_ptr;
+
+ if (tmp_ptr != base_ptr)
+ SWAP (tmp_ptr, base_ptr, size);
+
+ /* Insertion sort, running from left-hand-side up to right-hand-side. */
+
+ run_ptr = base_ptr + size;
+ while ((run_ptr += size) <= end_ptr)
+ {
+ tmp_ptr = run_ptr - size;
+ while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, user_data) < 0)
+ tmp_ptr -= size;
+
+ tmp_ptr += size;
+ if (tmp_ptr != run_ptr)
+ {
+ char *trav;
+
+ trav = run_ptr + size;
+ while (--trav >= run_ptr)
+ {
+ char c = *trav;
+ char *hi, *lo;
+
+ for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo)
+ *hi = *lo;
+ *hi = c;
+ }
+ }
+ }
+ }
+}
+
+#endif // wxUSE_BASE
+
+
+
+// ============================================================================
+// GUI-only functions from now on
+// ============================================================================
+
+#if wxUSE_GUI
+
+// this function is only really implemented for X11-based ports, including GTK1
+// (GTK2 sets detectable auto-repeat automatically anyhow)
+#if !(defined(__WXX11__) || defined(__WXMOTIF__) || \
+ (defined(__WXGTK__) && !defined(__WXGTK20__)))
+bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
+{
+ return true;
+}
+#endif // !X11-based port
+
+// ----------------------------------------------------------------------------
+// Launch default browser
+// ----------------------------------------------------------------------------
+
+#if defined(__WXMSW__)
+
+// implemented in a port-specific utils source file:
+bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags);
+
+#elif defined(__WXX11__) || defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || \
+ (defined(__WXOSX__) )
+
+// implemented in a port-specific utils source file:
+bool wxDoLaunchDefaultBrowser(const wxString& url, int flags);
+
+#else
+
+// a "generic" implementation:
+bool wxDoLaunchDefaultBrowser(const wxString& url, int flags)
+{
+ // on other platforms try to use mime types or wxExecute...