[vala] glib-2.0: Mark va_list.arg() with simple-generics to allow int64 or double



commit ce93033cbc6aefef27dcad638c0176089f10b20d
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Feb 15 19:48:15 2017 +0100

    glib-2.0: Mark va_list.arg() with simple-generics to allow int64 or double

 tests/methods/bug620673.vala |    6 +++++-
 vapi/glib-2.0.vapi           |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/methods/bug620673.vala b/tests/methods/bug620673.vala
index fd6158b..8c37319 100644
--- a/tests/methods/bug620673.vala
+++ b/tests/methods/bug620673.vala
@@ -2,9 +2,13 @@ void foo (int bar, ...) throws Error {
        assert (bar == 42);
        var args = va_list ();
        int arg = args.arg ();
+       int64 arg2 = args.arg ();
+       double arg3 = args.arg ();
        assert (arg == 23);
+       assert (arg2 == 4711LL);
+       assert (arg3 == 3.1415);
 }
 
 void main () {
-       foo (42, 23);
+       foo (42, 23, 4711LL, 3.1415);
 }
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 02c18eb..cbf177f 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -895,7 +895,7 @@ public struct va_list {
        public va_list ();
        [CCode (cname = "va_copy")]
        public va_list.copy (va_list src);
-       [CCode (generic_type_pos = 1.1)]
+       [CCode (generic_type_pos = 1.1, simple_generics = true)]
        public unowned G arg<G> ();
 }
 


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