@@ -38,7 +38,7 @@ pub enum _Unwind_State {
38
38
_US_UNWIND_FRAME_RESUME = 2 ,
39
39
_US_ACTION_MASK = 3 ,
40
40
_US_FORCE_UNWIND = 8 ,
41
- _US_END_OF_STACK = 16
41
+ _US_END_OF_STACK = 16 ,
42
42
}
43
43
44
44
#[ repr( C ) ]
@@ -59,9 +59,8 @@ pub type _Unwind_Exception_Class = u64;
59
59
60
60
pub type _Unwind_Word = libc:: uintptr_t ;
61
61
62
- pub type _Unwind_Trace_Fn =
63
- extern fn ( ctx : * mut _Unwind_Context ,
64
- arg : * mut libc:: c_void ) -> _Unwind_Reason_Code ;
62
+ pub type _Unwind_Trace_Fn = extern "C" fn ( ctx : * mut _Unwind_Context , arg : * mut libc:: c_void )
63
+ -> _Unwind_Reason_Code ;
65
64
66
65
#[ cfg( target_arch = "x86" ) ]
67
66
pub const unwinder_private_data_size: usize = 5 ;
@@ -97,9 +96,8 @@ pub struct _Unwind_Exception {
97
96
98
97
pub enum _Unwind_Context { }
99
98
100
- pub type _Unwind_Exception_Cleanup_Fn =
101
- extern "C" fn ( unwind_code : _Unwind_Reason_Code ,
102
- exception : * mut _Unwind_Exception ) ;
99
+ pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn ( unwind_code : _Unwind_Reason_Code ,
100
+ exception : * mut _Unwind_Exception ) ;
103
101
104
102
#[ cfg_attr( any( all( target_os = "linux" , not( target_env = "musl" ) ) ,
105
103
target_os = "freebsd" ,
@@ -127,20 +125,18 @@ pub type _Unwind_Exception_Cleanup_Fn =
127
125
#[ cfg_attr( all( target_os = "windows" , target_env = "gnu" ) ,
128
126
link( name = "gcc_eh" ) ) ]
129
127
#[ cfg( not( cargobuild) ) ]
130
- extern { }
128
+ extern "C" { }
131
129
132
- extern {
130
+ extern "C" {
133
131
// iOS on armv7 uses SjLj exceptions and requires to link
134
132
// against corresponding routine (..._SjLj_...)
135
133
#[ cfg( not( all( target_os = "ios" , target_arch = "arm" ) ) ) ]
136
134
#[ unwind]
137
- pub fn _Unwind_RaiseException ( exception : * mut _Unwind_Exception )
138
- -> _Unwind_Reason_Code ;
135
+ pub fn _Unwind_RaiseException ( exception : * mut _Unwind_Exception ) -> _Unwind_Reason_Code ;
139
136
140
137
#[ cfg( all( target_os = "ios" , target_arch = "arm" ) ) ]
141
138
#[ unwind]
142
- fn _Unwind_SjLj_RaiseException ( e : * mut _Unwind_Exception )
143
- -> _Unwind_Reason_Code ;
139
+ fn _Unwind_SjLj_RaiseException ( e : * mut _Unwind_Exception ) -> _Unwind_Reason_Code ;
144
140
145
141
pub fn _Unwind_DeleteException ( exception : * mut _Unwind_Exception ) ;
146
142
@@ -151,28 +147,26 @@ extern {
151
147
#[ cfg( not( all( target_os = "ios" , target_arch = "arm" ) ) ) ]
152
148
pub fn _Unwind_Backtrace ( trace : _Unwind_Trace_Fn ,
153
149
trace_argument : * mut libc:: c_void )
154
- -> _Unwind_Reason_Code ;
150
+ -> _Unwind_Reason_Code ;
155
151
156
152
// available since GCC 4.2.0, should be fine for our purpose
157
153
#[ cfg( all( not( all( target_os = "android" , target_arch = "arm" ) ) ,
158
154
not( all( target_os = "linux" , target_arch = "arm" ) ) ) ) ]
159
155
pub fn _Unwind_GetIPInfo ( ctx : * mut _Unwind_Context ,
160
156
ip_before_insn : * mut libc:: c_int )
161
- -> libc:: uintptr_t ;
157
+ -> libc:: uintptr_t ;
162
158
163
159
#[ cfg( all( not( target_os = "android" ) ,
164
160
not( all( target_os = "linux" , target_arch = "arm" ) ) ) ) ]
165
- pub fn _Unwind_FindEnclosingFunction ( pc : * mut libc:: c_void )
166
- -> * mut libc:: c_void ;
161
+ pub fn _Unwind_FindEnclosingFunction ( pc : * mut libc:: c_void ) -> * mut libc:: c_void ;
167
162
}
168
163
169
164
// ... and now we just providing access to SjLj counterspart
170
165
// through a standard name to hide those details from others
171
166
// (see also comment above regarding _Unwind_RaiseException)
172
167
#[ cfg( all( target_os = "ios" , target_arch = "arm" ) ) ]
173
168
#[ inline]
174
- pub unsafe fn _Unwind_RaiseException ( exc : * mut _Unwind_Exception )
175
- -> _Unwind_Reason_Code {
169
+ pub unsafe fn _Unwind_RaiseException ( exc : * mut _Unwind_Exception ) -> _Unwind_Reason_Code {
176
170
_Unwind_SjLj_RaiseException ( exc)
177
171
}
178
172
@@ -207,18 +201,20 @@ pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
207
201
}
208
202
209
203
type _Unwind_Word = libc:: c_uint ;
210
- extern {
204
+ extern "C" {
211
205
fn _Unwind_VRS_Get ( ctx : * mut _Unwind_Context ,
212
206
klass : _Unwind_VRS_RegClass ,
213
207
word : _Unwind_Word ,
214
208
repr : _Unwind_VRS_DataRepresentation ,
215
209
data : * mut libc:: c_void )
216
- -> _Unwind_VRS_Result ;
210
+ -> _Unwind_VRS_Result ;
217
211
}
218
212
219
213
let mut val: _Unwind_Word = 0 ;
220
214
let ptr = & mut val as * mut _Unwind_Word ;
221
- let _ = _Unwind_VRS_Get ( ctx, _Unwind_VRS_RegClass:: _UVRSC_CORE, 15 ,
215
+ let _ = _Unwind_VRS_Get ( ctx,
216
+ _Unwind_VRS_RegClass:: _UVRSC_CORE,
217
+ 15 ,
222
218
_Unwind_VRS_DataRepresentation:: _UVRSD_UINT32,
223
219
ptr as * mut libc:: c_void ) ;
224
220
( val & !1 ) as libc:: uintptr_t
@@ -230,8 +226,7 @@ pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
230
226
all( target_os = "linux" , target_arch = "arm" ) ) ) ]
231
227
pub unsafe fn _Unwind_GetIPInfo ( ctx : * mut _Unwind_Context ,
232
228
ip_before_insn : * mut libc:: c_int )
233
- -> libc:: uintptr_t
234
- {
229
+ -> libc:: uintptr_t {
235
230
* ip_before_insn = 0 ;
236
231
_Unwind_GetIP ( ctx)
237
232
}
@@ -240,8 +235,6 @@ pub unsafe fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context,
240
235
// a no-op
241
236
#[ cfg( any( target_os = "android" ,
242
237
all( target_os = "linux" , target_arch = "arm" ) ) ) ]
243
- pub unsafe fn _Unwind_FindEnclosingFunction ( pc : * mut libc:: c_void )
244
- -> * mut libc:: c_void
245
- {
238
+ pub unsafe fn _Unwind_FindEnclosingFunction ( pc : * mut libc:: c_void ) -> * mut libc:: c_void {
246
239
pc
247
240
}
0 commit comments