[vala] glib-2.0: add support for gintptr and guintptr types
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] glib-2.0: add support for gintptr and guintptr types
- Date: Sat, 26 Dec 2015 09:40:32 +0000 (UTC)
commit 4b8a50320e33dc84dcd7c7e11539c2eab0bb43bd
Author: Thomas Martitz <kugel rockbox org>
Date: Mon Dec 14 10:10:28 2015 +0100
glib-2.0: add support for gintptr and guintptr types
Modelled after existing size_t/ssize_t support, i.e. aliased to long/ulong.
Must be fixed for proper win32 support.
Fixes bug 759437
vapi/glib-2.0.vapi | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index e880fef..2fe4452 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -350,6 +350,61 @@ public struct ssize_t {
}
[SimpleType]
+[GIR (name = "gulong")]
+[CCode (cname = "guintptr", cheader_filename = "glib.h", type_id = "G_TYPE_ULONG", marshaller_type_name =
"ULONG", get_value_function = "g_value_get_ulong", set_value_function = "g_value_set_ulong", default_value =
"0UL")]
+[IntegerType (rank = 9)]
+public struct uintptr {
+ [CCode (cname = "0UL")]
+ public const ulong MIN;
+ [CCode (cname = "G_MAXSIZE")]
+ public const ulong MAX;
+
+ [CCode (cname = "G_GUINTPTR_FORMAT")]
+ public const string FORMAT;
+ [CCode (cname = "G_GINTPTR_MODIFIER")]
+ public const string FORMAT_MODIFIER;
+
+ [CCode (cname = "g_strdup_printf", instance_pos = -1)]
+ public string to_string (string format = "%" + FORMAT);
+
+ [CCode (cname = "GSIZE_TO_POINTER")]
+ public void* to_pointer ();
+
+ [CCode (cname = "MIN")]
+ public static uintptr min (uintptr a, uintptr b);
+ [CCode (cname = "MAX")]
+ public static uintptr max (uintptr a, uintptr b);
+ [CCode (cname = "CLAMP")]
+ public uintptr clamp (uintptr low, uintptr high);
+}
+
+[SimpleType]
+[GIR (name = "glong")]
+[CCode (cname = "gintptr", cheader_filename = "glib.h", type_id = "G_TYPE_LONG", marshaller_type_name =
"LONG", get_value_function = "g_value_get_long", set_value_function = "g_value_set_long", default_value =
"0L")]
+[IntegerType (rank = 8)]
+public struct intptr {
+ [CCode (cname = "G_MINSSIZE")]
+ public const long MIN;
+ [CCode (cname = "G_MAXSSIZE")]
+ public const long MAX;
+
+ [CCode (cname = "G_GINTPTR_FORMAT")]
+ public const string FORMAT;
+ [CCode (cname = "G_GINTPTR_MODIFIER")]
+ public const string FORMAT_MODIFIER;
+
+ [CCode (cname = "g_strdup_printf", instance_pos = -1)]
+ public string to_string (string format = "%" + FORMAT);
+
+ [CCode (cname = "MIN")]
+ public static intptr min (intptr a, intptr b);
+ [CCode (cname = "MAX")]
+ public static intptr max (intptr a, intptr b);
+ [CCode (cname = "CLAMP")]
+ public intptr clamp (intptr low, intptr high);
+}
+
+[SimpleType]
[GIR (name = "gint8")]
[CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name =
"CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value =
"0", type_signature = "y")]
[IntegerType (rank = 1, min = -128, max = 127)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]