File tree Expand file tree Collapse file tree 4 files changed +28
-44
lines changed Expand file tree Collapse file tree 4 files changed +28
-44
lines changed Original file line number Diff line number Diff line change 2
2
// from gir-files (https://github.com/gtk-rs/gir-files)
3
3
// DO NOT EDIT
4
4
5
- mod build_manual;
6
-
7
5
#[ cfg( not( docsrs) ) ]
8
6
use std:: process;
9
7
@@ -16,6 +14,4 @@ fn main() {
16
14
println ! ( "cargo:warning={s}" ) ;
17
15
process:: exit ( 1 ) ;
18
16
}
19
-
20
- build_manual:: main ( ) ;
21
17
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
use glib_sys:: GType ;
2
2
3
- // `g_param_spec_types` extern binding generated by build.rs
4
- include ! ( concat! ( env! ( "OUT_DIR" ) , "/param_spec.rs" ) ) ;
3
+ # [ cfg ( not ( target_os = "windows" ) ) ]
4
+ pub type GParamSpecType = * const GType ;
5
5
6
- /// # Safety
7
- /// This should be safe as long as the offset added to g_param_spec_types is in bounds.
8
- pub unsafe fn g_param_spec_types_get_type ( offset : usize ) -> GType {
9
- * g_param_spec_types. add ( offset)
6
+ #[ cfg( target_os = "windows" ) ]
7
+ pub type GParamSpecType = usize ;
8
+
9
+ #[ repr( C ) ]
10
+ pub struct GParamSpecTypesWrapper ( & ' static GParamSpecType ) ;
11
+
12
+ unsafe impl Sync for GParamSpecTypesWrapper { }
13
+
14
+ impl GParamSpecTypesWrapper {
15
+ /// # Safety
16
+ /// This should be safe as long as the offset added to g_param_spec_types is in bounds.
17
+ pub unsafe fn get_type ( & self , offset : usize ) -> GType {
18
+ * ( * self . 0 as * const GType ) . add ( offset)
19
+ }
10
20
}
21
+
22
+ extern "C" {
23
+ #[ cfg_attr( target_os = "windows" , link_name = "__imp_g_param_spec_types" ) ]
24
+ static g_param_spec_types: GParamSpecType ;
25
+ }
26
+
27
+ pub static g_param_spec_types_ref: GParamSpecTypesWrapper =
28
+ unsafe { GParamSpecTypesWrapper ( & g_param_spec_types) } ;
29
+
30
+ //#[cfg(all(target_env = "msvc", not(feature = "static")))]
31
+ //pub static __imp_g_param_spec_types: &'static GParamSpecTypes = unsafe { &g_param_spec_types };
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ macro_rules! define_param_spec {
302
302
#[ inline]
303
303
fn static_type( ) -> Type {
304
304
unsafe {
305
- from_glib( gobject_ffi :: g_param_spec_types_get_type ( $rust_type_offset) )
305
+ from_glib( gobject_sys :: g_param_spec_types_ref . get_type ( $rust_type_offset) )
306
306
}
307
307
}
308
308
}
You can’t perform that action at this time.
0 commit comments