File tree Expand file tree Collapse file tree 4 files changed +19
-41
lines changed Expand file tree Collapse file tree 4 files changed +19
-41
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
+ type GParamSpecType = * const GType ;
5
+
6
+ #[ cfg( target_os = "windows" ) ]
7
+ type GParamSpecType = * const * const GType ;
8
+
9
+ extern "C" {
10
+ #[ cfg_attr( target_os = "windows" , link_name = "__imp_g_param_spec_types" ) ]
11
+ static g_param_spec_types: GParamSpecType ;
12
+ }
5
13
6
14
/// # Safety
7
15
/// This should be safe as long as the offset added to g_param_spec_types is in bounds.
8
16
pub unsafe fn g_param_spec_types_get_type ( offset : usize ) -> GType {
9
- * g_param_spec_types. add ( offset)
17
+ #[ cfg( not( target_os = "windows" ) ) ]
18
+ let ptr = g_param_spec_types;
19
+
20
+ // One more step of indirection on windows because of the __imp_ prefix
21
+ #[ cfg( target_os = "windows" ) ]
22
+ let ptr = * g_param_spec_types;
23
+
24
+ * ptr. add ( offset)
10
25
}
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_get_type( $rust_type_offset) )
306
306
}
307
307
}
308
308
}
You can’t perform that action at this time.
0 commit comments