From: Rico Tzschichholz Date: Mon, 16 Mar 2020 07:08:46 +0000 (+0100) Subject: gio-2.0: Add binding for g_io_error_from_win32_error() X-Git-Tag: 0.48.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36bfca5805eda1531df290b1ef62adc5a0a7f3a2;p=thirdparty%2Fvala.git gio-2.0: Add binding for g_io_error_from_win32_error() --- diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index 05613546d..daa566e42 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -4767,6 +4767,12 @@ namespace GLib { public static GLib.IOError from_errno (int err_no) { return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_errno (err_no), "%s", GLib.strerror (err_no)); } + [CCode (cname = "g_io_error_from_win32_error")] + public static int _from_win32_error (int error_code); + [CCode (cname = "vala_g_io_error_from_win32_error")] + public static GLib.IOError from_win32_error (int error_code) { + return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_win32_error (error_code), "%s", GLib.Win32.error_message (error_code)); + } [CCode (cheader_filename = "gio/gio.h", cname = "g_io_error_from_errno")] public static int _from_errno (int err_no); [CCode (cheader_filename = "gio/gio.h")] diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala index f83892ded..9bb88ae92 100644 --- a/vapi/metadata/Gio-2.0-custom.vala +++ b/vapi/metadata/Gio-2.0-custom.vala @@ -169,6 +169,12 @@ namespace GLib { public static GLib.IOError from_errno (int err_no) { return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_errno (err_no), "%s", GLib.strerror (err_no)); } + [CCode (cname = "g_io_error_from_win32_error")] + public static int _from_win32_error (int error_code); + [CCode (cname = "vala_g_io_error_from_win32_error")] + public static GLib.IOError from_win32_error (int error_code) { + return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_win32_error (error_code), "%s", GLib.Win32.error_message (error_code)); + } } public delegate void SimpleActionActivateCallback (SimpleAction action, Variant? parameter);