[vala] glib-2.0: fix qsort_with_data binding



commit 994dd5674637dfe577408f486216728addbae8e5
Author: Evan Nemerson <evan coeus-group com>
Date:   Tue Jan 28 21:56:03 2014 -0800

    glib-2.0: fix qsort_with_data binding
    
    Fixes bug 640786.

 vapi/glib-2.0.vapi |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index e2ab16b..2e0096a 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -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 {


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