From 4759d601a6e8481a90ab33c1649aaecb5ad5d6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 17 Sep 2009 15:27:09 +0200 Subject: Fix time_t binding --- vapi/glib-2.0.vapi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'vapi') diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 9b26eb82c..a06c271c5 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -673,11 +673,10 @@ public struct double { } [CCode (cheader_filename = "time.h", has_type_id = false)] -[ByRef] [IntegerType (rank = 8)] public struct time_t { [CCode (cname = "time")] - public time_t (); + public time_t (out time_t result = null); } [SimpleType] @@ -1941,10 +1940,21 @@ namespace GLib { [CCode (cname = "tm_isdst")] public int isdst; - [CCode (cname = "gmtime_r", instance_pos = -1)] - public Time.gm (time_t time); - [CCode (cname = "localtime_r", instance_pos = -1)] - public Time.local (time_t time); + [CCode (cname = "gmtime_r")] + static void gmtime_r (ref time_t time, out Time result); + [CCode (cname = "localtime_r")] + static void localtime_r (ref time_t time, out Time result); + + public static Time gm (time_t time) { + Time result; + gmtime_r (ref time, out result); + return result; + } + public static Time local (time_t time) { + Time result; + localtime_r (ref time, out result); + return result; + } public string to_string () { return "%04d-%02d-%02d %02d:%02d:%02d".printf (year + 1900, month + 1, day, hour, minute, second); -- cgit v1.2.1