From 71089537da99c29e96c36d0c8713a6d6a1653aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Sep 2024 10:51:40 +0300 Subject: [PATCH 1/6] Update gir --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index 8c3ba91da566..f7d2061cc781 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 8c3ba91da5665b64d49c687cf88cbc80793551f5 +Subproject commit f7d2061cc781c7e1de9865eca0718c993132a889 From 65789d2f8636b05c3d942a86d2f5b56f142f7968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Sep 2024 10:52:25 +0300 Subject: [PATCH 2/6] Regenerate with latest gir --- gdk-pixbuf/src/auto/pixbuf_loader.rs | 12 ++++++------ gdk-pixbuf/src/auto/versions.txt | 2 +- gdk-pixbuf/sys/src/lib.rs | 12 ++++++------ gdk-pixbuf/sys/versions.txt | 2 +- gio/src/auto/action_group.rs | 8 ++++---- gio/src/auto/app_launch_context.rs | 2 +- gio/src/auto/application.rs | 4 ++-- gio/src/auto/dbus_auth_observer.rs | 2 +- gio/src/auto/list_model.rs | 6 +++--- gio/src/auto/menu_model.rs | 6 +++--- gio/src/auto/mount_operation.rs | 8 ++++---- gio/src/auto/settings.rs | 6 +++--- gio/src/auto/versions.txt | 2 +- gio/src/auto/vfs.rs | 4 ++-- gio/sys/src/lib.rs | 12 ++++++------ gio/sys/versions.txt | 2 +- glib/gobject-sys/src/lib.rs | 12 ++++++------ glib/gobject-sys/versions.txt | 2 +- glib/src/auto/versions.txt | 2 +- glib/sys/src/lib.rs | 13 ++++++------- glib/sys/versions.txt | 2 +- graphene/src/auto/versions.txt | 2 +- graphene/sys/src/lib.rs | 12 ++++++------ graphene/sys/versions.txt | 2 +- pango/src/auto/versions.txt | 2 +- pango/sys/src/lib.rs | 12 ++++++------ pango/sys/versions.txt | 2 +- pangocairo/src/auto/versions.txt | 2 +- pangocairo/sys/src/lib.rs | 12 ++++++------ pangocairo/sys/versions.txt | 2 +- 30 files changed, 84 insertions(+), 85 deletions(-) diff --git a/gdk-pixbuf/src/auto/pixbuf_loader.rs b/gdk-pixbuf/src/auto/pixbuf_loader.rs index ec59eb203dba..5dd296a92e21 100644 --- a/gdk-pixbuf/src/auto/pixbuf_loader.rs +++ b/gdk-pixbuf/src/auto/pixbuf_loader.rs @@ -190,10 +190,10 @@ pub trait PixbufLoaderExt: IsA + sealed::Sealed + 'static { F: Fn(&P, i32, i32, i32, i32) + 'static, >( this: *mut ffi::GdkPixbufLoader, - x: libc::c_int, - y: libc::c_int, - width: libc::c_int, - height: libc::c_int, + x: std::ffi::c_int, + y: std::ffi::c_int, + width: std::ffi::c_int, + height: std::ffi::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); @@ -247,8 +247,8 @@ pub trait PixbufLoaderExt: IsA + sealed::Sealed + 'static { F: Fn(&P, i32, i32) + 'static, >( this: *mut ffi::GdkPixbufLoader, - width: libc::c_int, - height: libc::c_int, + width: std::ffi::c_int, + height: std::ffi::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/gdk-pixbuf/sys/src/lib.rs b/gdk-pixbuf/sys/src/lib.rs index 279c287747b0..577fcaed073b 100644 --- a/gdk-pixbuf/sys/src/lib.rs +++ b/gdk-pixbuf/sys/src/lib.rs @@ -15,14 +15,15 @@ use gio_sys as gio; use glib_sys as glib; use gobject_sys as gobject; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -396,7 +397,6 @@ impl ::std::fmt::Debug for GdkPixbufSimpleAnimIter { } } -#[link(name = "gdk_pixbuf-2.0")] extern "C" { //========================================================================= diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/gio/src/auto/action_group.rs b/gio/src/auto/action_group.rs index b94c3472b919..ea6302e8c6fc 100644 --- a/gio/src/auto/action_group.rs +++ b/gio/src/auto/action_group.rs @@ -178,7 +178,7 @@ pub trait ActionGroupExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str) + 'static, >( this: *mut ffi::GActionGroup, - action_name: *mut libc::c_char, + action_name: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); @@ -215,7 +215,7 @@ pub trait ActionGroupExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str, bool) + 'static, >( this: *mut ffi::GActionGroup, - action_name: *mut libc::c_char, + action_name: *mut std::ffi::c_char, enabled: glib::ffi::gboolean, f: glib::ffi::gpointer, ) { @@ -255,7 +255,7 @@ pub trait ActionGroupExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str) + 'static, >( this: *mut ffi::GActionGroup, - action_name: *mut libc::c_char, + action_name: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); @@ -292,7 +292,7 @@ pub trait ActionGroupExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str, &glib::Variant) + 'static, >( this: *mut ffi::GActionGroup, - action_name: *mut libc::c_char, + action_name: *mut std::ffi::c_char, value: *mut glib::ffi::GVariant, f: glib::ffi::gpointer, ) { diff --git a/gio/src/auto/app_launch_context.rs b/gio/src/auto/app_launch_context.rs index e58b7bbddc16..05541e154e08 100644 --- a/gio/src/auto/app_launch_context.rs +++ b/gio/src/auto/app_launch_context.rs @@ -112,7 +112,7 @@ pub trait AppLaunchContextExt: IsA + sealed::Sealed + 'static F: Fn(&P, &str) + 'static, >( this: *mut ffi::GAppLaunchContext, - startup_notify_id: *mut libc::c_char, + startup_notify_id: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); diff --git a/gio/src/auto/application.rs b/gio/src/auto/application.rs index f28f72b32a9f..5fd5a2906a04 100644 --- a/gio/src/auto/application.rs +++ b/gio/src/auto/application.rs @@ -480,7 +480,7 @@ pub trait ApplicationExt: IsA + sealed::Sealed + 'static { this: *mut ffi::GApplication, command_line: *mut ffi::GApplicationCommandLine, f: glib::ffi::gpointer, - ) -> libc::c_int { + ) -> std::ffi::c_int { let f: &F = &*(f as *const F); f( Application::from_glib_borrow(this).unsafe_cast_ref(), @@ -512,7 +512,7 @@ pub trait ApplicationExt: IsA + sealed::Sealed + 'static { this: *mut ffi::GApplication, options: *mut glib::ffi::GVariantDict, f: glib::ffi::gpointer, - ) -> libc::c_int { + ) -> std::ffi::c_int { let f: &F = &*(f as *const F); f( Application::from_glib_borrow(this).unsafe_cast_ref(), diff --git a/gio/src/auto/dbus_auth_observer.rs b/gio/src/auto/dbus_auth_observer.rs index ee28ec4450fa..56a26c07ba6a 100644 --- a/gio/src/auto/dbus_auth_observer.rs +++ b/gio/src/auto/dbus_auth_observer.rs @@ -59,7 +59,7 @@ impl DBusAuthObserver { F: Fn(&DBusAuthObserver, &str) -> bool + 'static, >( this: *mut ffi::GDBusAuthObserver, - mechanism: *mut libc::c_char, + mechanism: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); diff --git a/gio/src/auto/list_model.rs b/gio/src/auto/list_model.rs index 40d81f6d3b4c..3b69585c56f4 100644 --- a/gio/src/auto/list_model.rs +++ b/gio/src/auto/list_model.rs @@ -78,9 +78,9 @@ pub trait ListModelExt: IsA + sealed::Sealed + 'static { F: Fn(&P, u32, u32, u32) + 'static, >( this: *mut ffi::GListModel, - position: libc::c_uint, - removed: libc::c_uint, - added: libc::c_uint, + position: std::ffi::c_uint, + removed: std::ffi::c_uint, + added: std::ffi::c_uint, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); diff --git a/gio/src/auto/menu_model.rs b/gio/src/auto/menu_model.rs index ca4cbd6bc049..438dba2193be 100644 --- a/gio/src/auto/menu_model.rs +++ b/gio/src/auto/menu_model.rs @@ -119,9 +119,9 @@ pub trait MenuModelExt: IsA + sealed::Sealed + 'static { F: Fn(&P, i32, i32, i32) + 'static, >( this: *mut ffi::GMenuModel, - position: libc::c_int, - removed: libc::c_int, - added: libc::c_int, + position: std::ffi::c_int, + removed: std::ffi::c_int, + added: std::ffi::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); diff --git a/gio/src/auto/mount_operation.rs b/gio/src/auto/mount_operation.rs index 8144d485a5e2..399c08ea5bb4 100644 --- a/gio/src/auto/mount_operation.rs +++ b/gio/src/auto/mount_operation.rs @@ -270,9 +270,9 @@ pub trait MountOperationExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str, &str, &str, AskPasswordFlags) + 'static, >( this: *mut ffi::GMountOperation, - message: *mut libc::c_char, - default_user: *mut libc::c_char, - default_domain: *mut libc::c_char, + message: *mut std::ffi::c_char, + default_user: *mut std::ffi::c_char, + default_domain: *mut std::ffi::c_char, flags: ffi::GAskPasswordFlags, f: glib::ffi::gpointer, ) { @@ -348,7 +348,7 @@ pub trait MountOperationExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str, i64, i64) + 'static, >( this: *mut ffi::GMountOperation, - message: *mut libc::c_char, + message: *mut std::ffi::c_char, time_left: i64, bytes_left: i64, f: glib::ffi::gpointer, diff --git a/gio/src/auto/settings.rs b/gio/src/auto/settings.rs index bf027a7fd26e..d63c64ba69b5 100644 --- a/gio/src/auto/settings.rs +++ b/gio/src/auto/settings.rs @@ -517,7 +517,7 @@ pub trait SettingsExt: IsA + sealed::Sealed + 'static { ) -> SignalHandlerId { unsafe extern "C" fn changed_trampoline, F: Fn(&P, &str) + 'static>( this: *mut ffi::GSettings, - key: *mut libc::c_char, + key: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); @@ -553,7 +553,7 @@ pub trait SettingsExt: IsA + sealed::Sealed + 'static { F: Fn(&P, u32) -> glib::Propagation + 'static, >( this: *mut ffi::GSettings, - key: libc::c_uint, + key: std::ffi::c_uint, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); @@ -583,7 +583,7 @@ pub trait SettingsExt: IsA + sealed::Sealed + 'static { F: Fn(&P, &str) + 'static, >( this: *mut ffi::GSettings, - key: *mut libc::c_char, + key: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/gio/src/auto/vfs.rs b/gio/src/auto/vfs.rs index c0b908a20f6b..c3081f30b4ef 100644 --- a/gio/src/auto/vfs.rs +++ b/gio/src/auto/vfs.rs @@ -99,7 +99,7 @@ pub trait VfsExt: IsA + sealed::Sealed + 'static { Box_::new(uri_func); unsafe extern "C" fn uri_func_func( vfs: *mut ffi::GVfs, - identifier: *const libc::c_char, + identifier: *const std::ffi::c_char, user_data: glib::ffi::gpointer, ) -> *mut ffi::GFile { let vfs = from_glib_borrow(vfs); @@ -121,7 +121,7 @@ pub trait VfsExt: IsA + sealed::Sealed + 'static { Box_::new(parse_name_func); unsafe extern "C" fn parse_name_func_func( vfs: *mut ffi::GVfs, - identifier: *const libc::c_char, + identifier: *const std::ffi::c_char, user_data: glib::ffi::gpointer, ) -> *mut ffi::GFile { let vfs = from_glib_borrow(vfs); diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index 5772282c541f..f9fbc1267698 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -18,14 +18,15 @@ mod manual; pub use manual::*; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -9363,7 +9364,6 @@ impl ::std::fmt::Debug for GVolume { } } -#[link(name = "gio-2.0")] extern "C" { //========================================================================= diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/glib/gobject-sys/src/lib.rs b/glib/gobject-sys/src/lib.rs index 1017b7026635..658a5bd2025c 100644 --- a/glib/gobject-sys/src/lib.rs +++ b/glib/gobject-sys/src/lib.rs @@ -13,14 +13,15 @@ use glib_sys as glib; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -1415,7 +1416,6 @@ impl ::std::fmt::Debug for GTypePlugin { } } -#[link(name = "gobject-2.0")] extern "C" { //========================================================================= diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index d1bd63dce21f..ab5f3f5d83cf 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -15,14 +15,15 @@ mod manual; pub use manual::*; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; pub type gboolean = c_int; pub const GFALSE: c_int = 0; @@ -2668,8 +2669,6 @@ impl ::std::fmt::Debug for GVariantType { } } -#[link(name = "gobject-2.0")] -#[link(name = "glib-2.0")] extern "C" { //========================================================================= diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/graphene/sys/src/lib.rs b/graphene/sys/src/lib.rs index 6e4ca37db5e8..9a4a9abe3b52 100644 --- a/graphene/sys/src/lib.rs +++ b/graphene/sys/src/lib.rs @@ -13,14 +13,15 @@ use glib_sys as glib; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -353,7 +354,6 @@ impl ::std::fmt::Debug for graphene_vec4_t { } } -#[link(name = "graphene-1.0")] extern "C" { //========================================================================= diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/pango/sys/src/lib.rs b/pango/sys/src/lib.rs index 71682c40c262..71b819c3d767 100644 --- a/pango/sys/src/lib.rs +++ b/pango/sys/src/lib.rs @@ -14,14 +14,15 @@ use glib_sys as glib; use gobject_sys as gobject; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -1398,7 +1399,6 @@ impl ::std::fmt::Debug for PangoRenderer { } } -#[link(name = "pango-1.0")] extern "C" { //========================================================================= diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) diff --git a/pangocairo/sys/src/lib.rs b/pangocairo/sys/src/lib.rs index 673a891443e5..25b9d07e4491 100644 --- a/pangocairo/sys/src/lib.rs +++ b/pangocairo/sys/src/lib.rs @@ -15,14 +15,15 @@ use cairo_sys as cairo; use glib_sys as glib; use pango_sys as pango; -#[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; +#[allow(unused_imports)] +use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE}; +#[allow(unused_imports)] +use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, +}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -59,7 +60,6 @@ impl ::std::fmt::Debug for PangoCairoFontMap { } } -#[link(name = "pangocairo-1.0")] extern "C" { //========================================================================= diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 76de54a00b34..79ce045ac9cd 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 8c3ba91da566) +Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) From 21536cab286a8e27a21d5a511cbe76c5091d98b3 Mon Sep 17 00:00:00 2001 From: eri Date: Wed, 4 Sep 2024 12:04:37 +0200 Subject: [PATCH 3/6] generate gir without link attribute --- gio/sys/src/manual.rs | 1 - glib/src/param_spec.rs | 98 +++++++++++++++++++++++++++--------------- glib/sys/src/manual.rs | 1 - 3 files changed, 63 insertions(+), 37 deletions(-) diff --git a/gio/sys/src/manual.rs b/gio/sys/src/manual.rs index 10ddd2042d71..adf976e32cef 100644 --- a/gio/sys/src/manual.rs +++ b/gio/sys/src/manual.rs @@ -52,7 +52,6 @@ mod windows_streams { gboolean, GInputStream, GInputStreamClass, GOutputStream, GOutputStreamClass, GType, }; - #[link(name = "gio-2.0")] extern "C" { //========================================================================= // GWin32InputStream diff --git a/glib/src/param_spec.rs b/glib/src/param_spec.rs index 631607424ed6..64fdf0f46e81 100644 --- a/glib/src/param_spec.rs +++ b/glib/src/param_spec.rs @@ -296,20 +296,16 @@ pub unsafe trait ParamSpecType: { } -#[link(name = "gobject-2.0")] -extern "C" { - pub static g_param_spec_types: *const ffi::GType; -} - macro_rules! define_param_spec { - ($rust_type:ident, $ffi_type:path, $rust_type_offset:expr) => { - // Can't use get_type here as this is not a boxed type but another fundamental type + ($rust_type:ident, $ffi_type:path, $type_name:literal) => { impl StaticType for $rust_type { #[inline] fn static_type() -> Type { - unsafe { - from_glib(*g_param_spec_types.add($rust_type_offset)) - } + // Instead of using the direct reference to the `g_param_spec_types` table, we + // use `g_type_from_name` to query for each of the param spec types. This is + // because rust currently has issues properly linking variables from external + // libraries without using a `#[link]` attribute. + unsafe { from_glib(gobject_ffi::g_type_from_name(concat!($type_name, "\0").as_ptr() as *const _)) } } } @@ -557,8 +553,8 @@ macro_rules! define_param_spec_min_max { } macro_rules! define_param_spec_numeric { - ($rust_type:ident, $ffi_type:path, $value_type:ty, $rust_type_offset:expr, $ffi_fun:ident) => { - define_param_spec!($rust_type, $ffi_type, $rust_type_offset); + ($rust_type:ident, $ffi_type:path, $value_type:ty, $type_name:literal, $ffi_fun:ident) => { + define_param_spec!($rust_type, $ffi_type, $type_name); define_param_spec_default!($rust_type, $ffi_type, $value_type, |x| x); define_param_spec_min_max!($rust_type, $ffi_type, $value_type); @@ -788,7 +784,7 @@ define_param_spec_numeric!( ParamSpecChar, gobject_ffi::GParamSpecChar, i8, - 0, + "GParamChar", g_param_spec_char ); @@ -808,7 +804,7 @@ define_param_spec_numeric!( ParamSpecUChar, gobject_ffi::GParamSpecUChar, u8, - 1, + "GParamUChar", g_param_spec_uchar ); @@ -829,7 +825,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecBoolean, gobject_ffi::GParamSpecBoolean, 2); +define_param_spec!( + ParamSpecBoolean, + gobject_ffi::GParamSpecBoolean, + "GParamBoolean" +); define_param_spec_default!( ParamSpecBoolean, @@ -880,7 +880,7 @@ define_param_spec_numeric!( ParamSpecInt, gobject_ffi::GParamSpecInt, i32, - 3, + "GParamInt", g_param_spec_int ); @@ -900,7 +900,7 @@ define_param_spec_numeric!( ParamSpecUInt, gobject_ffi::GParamSpecUInt, u32, - 4, + "GParamUInt", g_param_spec_uint ); @@ -925,7 +925,7 @@ define_param_spec_numeric!( ParamSpecLong, gobject_ffi::GParamSpecLong, libc::c_long, - 5, + "GParamLong", g_param_spec_long ); @@ -950,7 +950,7 @@ define_param_spec_numeric!( ParamSpecULong, gobject_ffi::GParamSpecULong, libc::c_ulong, - 6, + "GParamULong", g_param_spec_ulong ); @@ -975,7 +975,7 @@ define_param_spec_numeric!( ParamSpecInt64, gobject_ffi::GParamSpecInt64, i64, - 7, + "GParamInt64", g_param_spec_int64 ); @@ -1000,7 +1000,7 @@ define_param_spec_numeric!( ParamSpecUInt64, gobject_ffi::GParamSpecUInt64, u64, - 8, + "GParamUInt64", g_param_spec_uint64 ); @@ -1021,7 +1021,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecUnichar, gobject_ffi::GParamSpecUnichar, 9); +define_param_spec!( + ParamSpecUnichar, + gobject_ffi::GParamSpecUnichar, + "GParamUnichar" +); define_param_spec_default!(ParamSpecUnichar, gobject_ffi::GParamSpecUnichar, Result, TryFrom::try_from); impl ParamSpecUnichar { @@ -1063,7 +1067,7 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecEnum, gobject_ffi::GParamSpecEnum, 10); +define_param_spec!(ParamSpecEnum, gobject_ffi::GParamSpecEnum, "GParamEnum"); impl ParamSpecEnum { unsafe fn new_unchecked<'a>( @@ -1207,7 +1211,7 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecFlags, gobject_ffi::GParamSpecFlags, 11); +define_param_spec!(ParamSpecFlags, gobject_ffi::GParamSpecFlags, "GParamFlags"); impl ParamSpecFlags { unsafe fn new_unchecked<'a>( @@ -1350,7 +1354,7 @@ define_param_spec_numeric!( ParamSpecFloat, gobject_ffi::GParamSpecFloat, f32, - 12, + "GParamFloat", g_param_spec_float ); @@ -1375,7 +1379,7 @@ define_param_spec_numeric!( ParamSpecDouble, gobject_ffi::GParamSpecDouble, f64, - 13, + "GParamDouble", g_param_spec_double ); @@ -1396,7 +1400,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecString, gobject_ffi::GParamSpecString, 14); +define_param_spec!( + ParamSpecString, + gobject_ffi::GParamSpecString, + "GParamString" +); define_param_spec_default!( ParamSpecString, @@ -1505,7 +1513,7 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecParam, gobject_ffi::GParamSpecParam, 15); +define_param_spec!(ParamSpecParam, gobject_ffi::GParamSpecParam, "GParamParam"); impl ParamSpecParam { unsafe fn new_unchecked<'a>( @@ -1547,7 +1555,7 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecBoxed, gobject_ffi::GParamSpecBoxed, 16); +define_param_spec!(ParamSpecBoxed, gobject_ffi::GParamSpecBoxed, "GParamBoxed"); impl ParamSpecBoxed { unsafe fn new_unchecked<'a>( @@ -1635,7 +1643,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecPointer, gobject_ffi::GParamSpecPointer, 17); +define_param_spec!( + ParamSpecPointer, + gobject_ffi::GParamSpecPointer, + "GParamPointer" +); impl ParamSpecPointer { unsafe fn new_unchecked<'a>( @@ -1671,7 +1683,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecValueArray, gobject_ffi::GParamSpecValueArray, 18); +define_param_spec!( + ParamSpecValueArray, + gobject_ffi::GParamSpecValueArray, + "GParamValueArray" +); impl ParamSpecValueArray { unsafe fn new_unchecked<'a>( @@ -1791,7 +1807,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecObject, gobject_ffi::GParamSpecObject, 19); +define_param_spec!( + ParamSpecObject, + gobject_ffi::GParamSpecObject, + "GParamObject" +); impl ParamSpecObject { unsafe fn new_unchecked<'a>( @@ -1879,7 +1899,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecOverride, gobject_ffi::GParamSpecOverride, 20); +define_param_spec!( + ParamSpecOverride, + gobject_ffi::GParamSpecOverride, + "GParamOverride" +); impl ParamSpecOverride { unsafe fn new_unchecked(name: &str, overridden: impl AsRef) -> ParamSpec { @@ -1987,7 +2011,7 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecGType, gobject_ffi::GParamSpecGType, 21); +define_param_spec!(ParamSpecGType, gobject_ffi::GParamSpecGType, "GParamGType"); impl ParamSpecGType { unsafe fn new_unchecked<'a>( @@ -2027,7 +2051,11 @@ wrapper! { unref => |ptr| gobject_ffi::g_param_spec_unref(ptr as *mut gobject_ffi::GParamSpec), } } -define_param_spec!(ParamSpecVariant, gobject_ffi::GParamSpecVariant, 22); +define_param_spec!( + ParamSpecVariant, + gobject_ffi::GParamSpecVariant, + "GParamVariant" +); define_param_spec_default!( ParamSpecVariant, diff --git a/glib/sys/src/manual.rs b/glib/sys/src/manual.rs index af23d450d0b0..f6152c3fd1a1 100644 --- a/glib/sys/src/manual.rs +++ b/glib/sys/src/manual.rs @@ -84,7 +84,6 @@ mod win32 { pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; pub const G_WIN32_OS_SERVER: GWin32OSType = 2; - #[link(name = "glib-2.0")] extern "C" { pub fn g_win32_check_windows_version( major: c_int, From 67ce831e8c85c9a5f775c09ebc15b393cfd4d3c1 Mon Sep 17 00:00:00 2001 From: Tomoaki Kawada Date: Fri, 20 Sep 2024 15:33:57 +0900 Subject: [PATCH 4/6] glib: Make `::BuilderFn` generic over lifetimes --- glib-macros/tests/properties.rs | 2 ++ glib/src/param_spec.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/glib-macros/tests/properties.rs b/glib-macros/tests/properties.rs index b9ae8e289a71..e4ca1da704bd 100644 --- a/glib-macros/tests/properties.rs +++ b/glib-macros/tests/properties.rs @@ -93,6 +93,8 @@ mod foo { string_vec: RefCell>, #[property(get, set, builder(glib::VariantTy::DOUBLE))] variant: RefCell>, + #[property(get, set, builder(&>::static_variant_type()))] + variant2: RefCell>, #[property(get = |_| 42.0, set)] infer_inline_type: RefCell, // The following property doesn't store any data. The value of the property is calculated diff --git a/glib/src/param_spec.rs b/glib/src/param_spec.rs index 64fdf0f46e81..ec6628e970c4 100644 --- a/glib/src/param_spec.rs +++ b/glib/src/param_spec.rs @@ -2307,8 +2307,7 @@ has_simple_spec!(bool, ParamSpecBoolean, ParamSpecBooleanBuilder); impl HasParamSpec for crate::Variant { type ParamSpec = ParamSpecVariant; type SetValue = Self; - type BuilderFn = - fn(&'static str, ty: &'static crate::VariantTy) -> ParamSpecVariantBuilder<'static>; + type BuilderFn = for<'a> fn(&'a str, ty: &'a crate::VariantTy) -> ParamSpecVariantBuilder<'a>; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder From 3693128191f7196f5c2ba29a256089be2a534df6 Mon Sep 17 00:00:00 2001 From: Fina Wilke Date: Tue, 24 Sep 2024 19:49:51 +0200 Subject: [PATCH 5/6] glib-macros: Remove &mut to static mut in object_subclass --- glib-macros/src/object_impl_attributes/subclass.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib-macros/src/object_impl_attributes/subclass.rs b/glib-macros/src/object_impl_attributes/subclass.rs index 29357471b98f..efe3a977741f 100644 --- a/glib-macros/src/object_impl_attributes/subclass.rs +++ b/glib-macros/src/object_impl_attributes/subclass.rs @@ -103,7 +103,7 @@ pub fn impl_object_subclass(input: super::Input) -> TokenStream { fn type_data() -> ::std::ptr::NonNull<#crate_ident::subclass::TypeData> { static mut DATA: #crate_ident::subclass::TypeData = #crate_ident::subclass::types::TypeData::new(); - unsafe { ::std::ptr::NonNull::from(&mut DATA) } + unsafe { ::std::ptr::NonNull::new_unchecked(::std::ptr::addr_of_mut!(DATA)) } } #[inline] From 9eb0812e371eb5b1082eac026161b03c2f29ccd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Sep 2024 11:03:24 +0300 Subject: [PATCH 6/6] Update Cargo.lock --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 412f24c74a88..3f23bbece035 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,18 +102,18 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "shlex", ] [[package]] name = "cfg-expr" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8" +checksum = "d0890061c4d3223e7267f3bad2ec40b997d64faac1c2815a4a9d95018e2b9e9c" dependencies = [ "smallvec", "target-lexicon", @@ -642,9 +642,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "linux-raw-sys" @@ -780,9 +780,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" @@ -861,9 +861,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ "bitflags", ] @@ -929,9 +929,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags", "errno", @@ -1041,9 +1041,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1125,9 +1125,9 @@ dependencies = [ [[package]] name = "system-deps" -version = "7.0.2" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031" +checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ "cfg-expr", "heck", @@ -1197,9 +1197,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -1225,9 +1225,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "untrusted" @@ -1462,9 +1462,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ]