Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 8e7f31f

Browse files
committed
Update to 2.42 as minimum GLib version
#436
1 parent 346e559 commit 8e7f31f

File tree

8 files changed

+15
-28
lines changed

8 files changed

+15
-28
lines changed

Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,21 @@ lazy_static = "1.2"
2525
libc = "0.2"
2626
bitflags = "1.0"
2727
futures-preview = { version = "0.2", optional = true }
28-
glib-sys = { git = "https://github.com/gtk-rs/sys" }
29-
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
28+
glib-sys = { git = "https://github.com/gtk-rs/sys", features = ["v2_40"] }
29+
gobject-sys = { git = "https://github.com/gtk-rs/sys", features = ["v2_42"] }
3030

3131
[dev-dependencies]
3232
tempfile = "3"
3333

3434
[features]
35-
v2_34 = ["glib-sys/v2_34", "gobject-sys/v2_34"]
36-
v2_36 = ["v2_34", "glib-sys/v2_36", "gobject-sys/v2_36"]
37-
v2_38 = ["v2_36", "glib-sys/v2_38", "gobject-sys/v2_38"]
38-
v2_40 = ["v2_38", "glib-sys/v2_40"]
39-
v2_44 = ["v2_40", "glib-sys/v2_44", "gobject-sys/v2_44"]
35+
v2_44 = ["glib-sys/v2_44", "gobject-sys/v2_44"]
4036
v2_46 = ["v2_44", "glib-sys/v2_46", "gobject-sys/v2_46"]
4137
v2_48 = ["v2_46", "glib-sys/v2_48"]
4238
v2_50 = ["v2_48", "glib-sys/v2_50"]
4339
v2_52 = ["v2_50", "glib-sys/v2_52"]
4440
v2_54 = ["v2_52", "glib-sys/v2_54", "gobject-sys/v2_54"]
4541
v2_56 = ["v2_54", "glib-sys/v2_56"]
4642
v2_58 = ["v2_56", "glib-sys/v2_58"]
47-
futures = ["futures-preview", "v2_36"]
43+
futures = ["futures-preview"]
4844
subclassing = []
4945
dox = ["glib-sys/dox", "gobject-sys/dox"]

Gir.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
girs_dir = "gir-files"
33
library = "GLib"
44
version = "2.0"
5-
min_cfg_version = "2.32"
5+
min_cfg_version = "2.42"
66
target_path = "."
77
work_mode = "normal"
88
single_version_file = true
9+
deprecate_by_min_version = true
910

1011
generate = [
1112
"GLib.DateDay",

Gir_GObject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
girs_dir = "gir-files"
33
library = "GObject"
44
version = "2.0"
5-
min_cfg_version = "2.32"
5+
min_cfg_version = "2.42"
66
target_path = "."
77
auto_path = "src/gobject/auto"
88
work_mode = "normal"
99
single_version_file = true
10+
deprecate_by_min_version = true
1011

1112
generate = [
1213
"GObject.BindingFlags",

src/key_file.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use gstring::GString;
1616
use KeyFile;
1717

1818
impl KeyFile {
19-
#[cfg(any(feature = "v2_40", feature = "dox"))]
2019
pub fn save_to_file<T: AsRef<std::path::Path>>(&self, filename: T) -> Result<(), Error> {
2120
unsafe {
2221
let mut error = ptr::null_mut();

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ pub mod value;
198198
pub mod variant;
199199
mod variant_type;
200200
mod main_context;
201-
#[cfg(any(feature="v2_36", feature = "dox"))]
202201
mod main_context_channel;
203-
#[cfg(any(feature="v2_36", feature = "dox"))]
204202
pub use main_context_channel::{Sender, SyncSender, Receiver};
205203
mod date;
206204
pub use date::Date;

src/param_spec.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//
55
// TODO: Implement custom subtyping here for things like GParamSpecInt to get
66
// default/min/max values and similar
7-
#[cfg(any(feature = "v2_38", feature = "dox"))]
87
use Value;
98
use gobject_ffi as ffi;
109
use gobject_ffi;
@@ -51,7 +50,6 @@ impl ParamSpec {
5150
}
5251
}
5352

54-
#[cfg(any(feature = "v2_38", feature = "dox"))]
5553
pub fn get_default_value(&self) -> Option<Value> {
5654
unsafe {
5755
from_glib_none(ffi::g_param_spec_get_default_value(self.to_glib_none().0))

src/source.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
use std::cell::RefCell;
66
use std::mem::transmute;
7-
#[cfg(all(unix, any(feature = "v2_36", feature = "dox")))]
7+
#[cfg(any(unix, feature = "dox"))]
88
use std::os::unix::io::RawFd;
99
#[cfg(all(not(unix), feature = "dox"))]
1010
use libc::c_int as RawFd;
1111
use std::process;
1212
use std::thread;
1313
use ffi as glib_ffi;
1414
use ffi::{gboolean, gpointer};
15-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
15+
#[cfg(any(unix, feature = "dox"))]
1616
use IOCondition;
1717
use translate::{from_glib, from_glib_full, FromGlib, ToGlib, ToGlibPtr};
1818
use libc;
@@ -131,19 +131,19 @@ fn into_raw_child_watch<F: FnMut(Pid, i32) + Send + 'static>(func: F) -> gpointe
131131
Box::into_raw(func) as gpointer
132132
}
133133

134-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
134+
#[cfg(any(unix, feature = "dox"))]
135135
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
136136
unsafe extern "C" fn trampoline_unix_fd(fd: i32, condition: glib_ffi::GIOCondition, func: gpointer) -> gboolean {
137137
let func: &RefCell<Box<FnMut(RawFd, IOCondition) -> Continue + 'static>> = transmute(func);
138138
(&mut *func.borrow_mut())(fd, from_glib(condition)).to_glib()
139139
}
140140

141-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
141+
#[cfg(any(unix, feature = "dox"))]
142142
unsafe extern "C" fn destroy_closure_unix_fd(ptr: gpointer) {
143143
Box::<RefCell<Box<FnMut(RawFd, IOCondition) + 'static>>>::from_raw(ptr as *mut _);
144144
}
145145

146-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
146+
#[cfg(any(unix, feature = "dox"))]
147147
fn into_raw_unix_fd<F: FnMut(RawFd, IOCondition) -> Continue + Send + 'static>(func: F) -> gpointer {
148148
let func: Box<RefCell<Box<FnMut(RawFd, IOCondition) -> Continue + Send + 'static>>> =
149149
Box::new(RefCell::new(Box::new(func)));
@@ -228,7 +228,7 @@ where F: FnMut() -> Continue + Send + 'static {
228228
}
229229
}
230230

231-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
231+
#[cfg(any(unix, feature = "dox"))]
232232
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a
233233
/// UNIX file descriptor reaches the given IO condition.
234234
///
@@ -400,7 +400,7 @@ where F: FnMut() -> Continue + Send + 'static {
400400
}
401401
}
402402

403-
#[cfg(any(all(feature = "v2_36", unix), feature = "dox"))]
403+
#[cfg(any(unix, feature = "dox"))]
404404
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a
405405
/// UNIX file descriptor reaches the given IO condition.
406406
///

src/variant.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,9 @@ impl StaticVariantType for str {
314314
}
315315

316316
impl ToVariant for str {
317-
#[cfg(any(feature = "v2_38"))]
318317
fn to_variant(&self) -> Variant {
319318
unsafe { from_glib_none(glib_ffi::g_variant_new_take_string(self.to_glib_full())) }
320319
}
321-
322-
#[cfg(not(feature = "v2_38"))]
323-
fn to_variant(&self) -> Variant {
324-
unsafe { from_glib_none(glib_ffi::g_variant_new_string(self.to_glib_none().0)) }
325-
}
326320
}
327321

328322
impl<T: ToVariant> From<T> for Variant {

0 commit comments

Comments
 (0)