File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ gimli = { version = "0.16.0", optional = true }
32
32
memmap = { version = " 0.7.0" , optional = true }
33
33
object = { version = " 0.9.0" , optional = true }
34
34
35
+ [build-dependencies ]
36
+ autocfg = " 0.1"
37
+
35
38
[target .'cfg(unix)' .dependencies ]
36
39
libc = { version = " 0.2" , default-features = false }
37
40
Original file line number Diff line number Diff line change
1
+ extern crate autocfg;
2
+
3
+ fn main ( ) {
4
+ let ac = autocfg:: new ( ) ;
5
+
6
+ // `repr_align` was stabilized in Rust 1.25:
7
+ //
8
+ // https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1250-2018-03-29
9
+ ac. emit_rustc_version ( 1 , 25 ) ;
10
+ }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ impl Frame {
37
37
38
38
// This beast is to maintain Rust 1.18 Compatibility
39
39
cfg_if ! {
40
- if #[ cfg( feature = "repr_align" ) ] {
40
+ if #[ cfg( rustc_1_25 ) ] {
41
41
#[ repr( C , align( 16 ) ) ] // required by `CONTEXT`, is a FIXME in winapi right now
42
42
struct MyContext ( CONTEXT ) ;
43
43
@@ -122,7 +122,7 @@ cfg_if! {
122
122
}
123
123
}
124
124
} else {
125
- compile_error!( "`no_std` is not supported for versions of Rust prior to 1.24 ." ) ;
125
+ compile_error!( "`no_std` is not supported for versions of Rust prior to 1.25 ." ) ;
126
126
}
127
127
}
128
128
Original file line number Diff line number Diff line change @@ -68,18 +68,18 @@ impl Symbol {
68
68
}
69
69
70
70
// Maintain Rust 1.18 Compatibility
71
- #[ cfg( feature = "repr_align" ) ]
71
+ #[ cfg( rustc_1_25 ) ]
72
72
#[ repr( C , align( 8 ) ) ]
73
73
struct Aligned8 < T > ( T ) ;
74
74
75
75
pub unsafe fn resolve ( addr : * mut c_void , cb : & mut FnMut ( & super :: Symbol ) ) {
76
76
let size: usize = 2 * MAX_SYM_NAME + mem:: size_of :: < SYMBOL_INFOW > ( ) ;
77
- #[ cfg( feature = "repr_align" ) ]
77
+ #[ cfg( rustc_1_25 ) ]
78
78
let mut data = Aligned8 ( [ 0u8 ; size] ) ;
79
- #[ cfg( not( feature = "repr_align" ) ) ]
79
+ #[ cfg( not( rustc_1_25 ) ) ]
80
80
let mut data = vec ! [ 0u8 ; size] ;
81
81
82
- #[ cfg( feature = "repr_align" ) ]
82
+ #[ cfg( rustc_1_25 ) ]
83
83
let data = & mut data. 0 ;
84
84
85
85
let info = & mut * ( data. as_mut_ptr ( ) as * mut SYMBOL_INFOW ) ;
You can’t perform that action at this time.
0 commit comments