File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,18 @@ impl Symbol {
73
73
struct Aligned8 < T > ( T ) ;
74
74
75
75
pub unsafe fn resolve ( addr : * mut c_void , cb : & mut FnMut ( & super :: Symbol ) ) {
76
- let size: usize = 2 * MAX_SYM_NAME + mem:: size_of :: < SYMBOL_INFOW > ( ) ;
77
76
#[ cfg( rustc_1_25) ]
78
- let mut data = Aligned8 ( [ 0u8 ; size] ) ;
79
- #[ cfg( not( rustc_1_25) ) ]
80
- let mut data = vec ! [ 0u8 ; size] ;
81
-
77
+ const SIZE : usize = 2 * MAX_SYM_NAME + mem:: size_of :: < SYMBOL_INFOW > ( ) ;
78
+ #[ cfg( rustc_1_25) ]
79
+ let mut data = Aligned8 ( [ 0u8 ; SIZE ] ) ;
82
80
#[ cfg( rustc_1_25) ]
83
81
let data = & mut data. 0 ;
84
82
83
+ #[ cfg( not( rustc_1_25) ) ]
84
+ let size: usize = 2 * MAX_SYM_NAME + mem:: size_of :: < SYMBOL_INFOW > ( ) ;
85
+ #[ cfg( not( rustc_1_25) ) ]
86
+ let mut data = vec ! [ 0u8 ; size] ;
87
+
85
88
let info = & mut * ( data. as_mut_ptr ( ) as * mut SYMBOL_INFOW ) ;
86
89
info. MaxNameLen = MAX_SYM_NAME as ULONG ;
87
90
// the struct size in C. the value is different to
You can’t perform that action at this time.
0 commit comments