[vala] girparser: add support for gintptr and guintptr types.



commit c2779cc36236f5a6e0a6f2a79562e5b029254928
Author: Thomas Martitz <kugel rockbox org>
Date:   Mon Dec 14 10:12:29 2015 +0100

    girparser: add support for gintptr and guintptr types.
    
    Modelled after existing size_t/ssize_t support, i.e. map to corresponding
    types from glib-2.0.vapi.

 vala/valagirparser.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 89339e7..1ca871a 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -2575,12 +2575,16 @@ public class Vala.GirParser : CodeVisitor {
                        } else if (type_name == "glong") {
                                if (ctype != null && ctype.has_prefix ("gssize")) {
                                        type_name = "ssize_t";
+                               } else if (ctype != null && ctype.has_prefix ("gintptr")) {
+                                       type_name = "intptr";
                                } else {
                                        type_name = "long";
                                }
                        } else if (type_name == "gulong") {
                                if (ctype != null && ctype.has_prefix ("gsize")) {
                                        type_name = "size_t";
+                               } else if (ctype != null && ctype.has_prefix ("guintptr")) {
+                                       type_name = "uintptr";
                                } else {
                                        type_name = "ulong";
                                }
@@ -2612,6 +2616,10 @@ public class Vala.GirParser : CodeVisitor {
                                type_name = "size_t";
                        } else if (type_name == "gssize") {
                                type_name = "ssize_t";
+                       } else if (type_name == "guintptr") {
+                               type_name = "uintptr";
+                       } else if (type_name == "gintptr") {
+                               type_name = "intptr";
                        } else if (type_name == "GType") {
                                type_name = "GLib.Type";
                        } else if (type_name == "GLib.String") {


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