+ }
+ else
+ {
+ if ((s & (sizeof (guint32) - 1)) == 0
+ && ((char *) b - (char *) 0) % ALIGNOF_GUINT32 == 0)
+ {
+ if (s == sizeof (guint32))
+ p.var = 0;
+ else if (s == sizeof (guint64)
+ && ((char *) b - (char *) 0) % ALIGNOF_GUINT64 == 0)
+ p.var = 1;
+ else if ((s & (sizeof (unsigned long) - 1)) == 0
+ && ((char *) b - (char *) 0)
+ % ALIGNOF_UNSIGNED_LONG == 0)
+ p.var = 2;
+ }
+ msort_with_tmp (&p, b, n);
+ }
+ g_free (tmp);
+}
+
+/**
+ * g_qsort_with_data:
+ * @pbase: start of array to sort
+ * @total_elems: elements in the array
+ * @size: size of each element
+ * @compare_func: function to compare elements
+ * @user_data: data to pass to @compare_func
+ *
+ * This is just like the standard C qsort() function, but
+ * the comparison routine accepts a user data argument.
+ *
+ * This is guaranteed to be a stable sort since version 2.32.
+ */
+void
+g_qsort_with_data (gconstpointer pbase,
+ gint total_elems,
+ gsize size,
+ GCompareDataFunc compare_func,
+ gpointer user_data)
+{
+ msort_r ((gpointer)pbase, total_elems, size, compare_func, user_data);