]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: fix qsort_with_data binding
authorEvan Nemerson <evan@coeus-group.com>
Wed, 29 Jan 2014 05:56:03 +0000 (21:56 -0800)
committerEvan Nemerson <evan@coeus-group.com>
Wed, 29 Jan 2014 05:56:03 +0000 (21:56 -0800)
Fixes bug 640786.

vapi/glib-2.0.vapi

index e2ab16b9a393e44726511f6f6e0293865a4b3b44..2e0096aa505219926e7586a1534c90d08fdee40e 100644 (file)
@@ -4913,8 +4913,15 @@ namespace GLib {
        [CCode (cname = "G_STATIC_ASSERT", cheader_filename = "glib.h")]
        public static void static_assert (bool expression);
 
-       [CCode (simple_generics = true)]
-       private static void qsort_with_data<T> (T[] elems, size_t size, [CCode (type = "GCompareDataFunc")] GLib.CompareDataFunc<T> compare_func);
+       [CCode (simple_generics = true, cname = "g_qsort_with_data")]
+       private static void _qsort_with_data<T> (T[] elems, size_t size, [CCode (type = "GCompareDataFunc")] GLib.CompareDataFunc<T> compare_func);
+
+       [CCode (cname = "_vala_g_qsort_with_data")]
+       public static void qsort_with_data<T> (T[] elems, size_t size, [CCode (type = "GCompareDataFunc")] GLib.CompareDataFunc<T> compare_func) {
+               _qsort_with_data<T*> (elems, size, (a, b) => {
+                               return compare_func (*a, *b);
+                       });
+       }
 
        /* Unix-specific functions. All of these have to include glib-unix.h. */
        namespace Unix {