@@ -79,8 +79,8 @@ pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
79
79
let exception_param = Box :: into_raw ( exception) as * mut uw:: _Unwind_Exception ;
80
80
return uw:: _Unwind_RaiseException ( exception_param) as u32 ;
81
81
82
- extern fn exception_cleanup ( _unwind_code : uw:: _Unwind_Reason_Code ,
83
- exception : * mut uw:: _Unwind_Exception ) {
82
+ extern "C" fn exception_cleanup ( _unwind_code : uw:: _Unwind_Reason_Code ,
83
+ exception : * mut uw:: _Unwind_Exception ) {
84
84
unsafe {
85
85
let _: Box < Exception > = Box :: from_raw ( exception as * mut Exception ) ;
86
86
}
@@ -130,50 +130,41 @@ pub mod eabi {
130
130
use unwind as uw;
131
131
use libc:: c_int;
132
132
133
- extern {
133
+ extern "C" {
134
134
fn __gcc_personality_v0 ( version : c_int ,
135
135
actions : uw:: _Unwind_Action ,
136
136
exception_class : uw:: _Unwind_Exception_Class ,
137
137
ue_header : * mut uw:: _Unwind_Exception ,
138
138
context : * mut uw:: _Unwind_Context )
139
- -> uw:: _Unwind_Reason_Code ;
139
+ -> uw:: _Unwind_Reason_Code ;
140
140
}
141
141
142
142
#[ lang = "eh_personality" ]
143
143
#[ no_mangle]
144
- extern fn rust_eh_personality (
145
- version : c_int ,
146
- actions : uw:: _Unwind_Action ,
147
- exception_class : uw:: _Unwind_Exception_Class ,
148
- ue_header : * mut uw:: _Unwind_Exception ,
149
- context : * mut uw:: _Unwind_Context
150
- ) -> uw:: _Unwind_Reason_Code
151
- {
152
- unsafe {
153
- __gcc_personality_v0 ( version, actions, exception_class, ue_header,
154
- context)
155
- }
144
+ extern "C" fn rust_eh_personality ( version : c_int ,
145
+ actions : uw:: _Unwind_Action ,
146
+ exception_class : uw:: _Unwind_Exception_Class ,
147
+ ue_header : * mut uw:: _Unwind_Exception ,
148
+ context : * mut uw:: _Unwind_Context )
149
+ -> uw:: _Unwind_Reason_Code {
150
+ unsafe { __gcc_personality_v0 ( version, actions, exception_class, ue_header, context) }
156
151
}
157
152
158
153
#[ lang = "eh_personality_catch" ]
159
154
#[ no_mangle]
160
- pub extern fn rust_eh_personality_catch (
161
- version : c_int ,
162
- actions : uw:: _Unwind_Action ,
163
- exception_class : uw:: _Unwind_Exception_Class ,
164
- ue_header : * mut uw:: _Unwind_Exception ,
165
- context : * mut uw:: _Unwind_Context
166
- ) -> uw:: _Unwind_Reason_Code
167
- {
155
+ pub extern "C" fn rust_eh_personality_catch ( version : c_int ,
156
+ actions : uw:: _Unwind_Action ,
157
+ exception_class : uw:: _Unwind_Exception_Class ,
158
+ ue_header : * mut uw:: _Unwind_Exception ,
159
+ context : * mut uw:: _Unwind_Context )
160
+ -> uw:: _Unwind_Reason_Code {
168
161
169
- if ( actions as c_int & uw:: _UA_SEARCH_PHASE as c_int ) != 0 { // search phase
162
+ if ( actions as c_int & uw:: _UA_SEARCH_PHASE as c_int ) != 0 {
163
+ // search phase
170
164
uw:: _URC_HANDLER_FOUND // catch!
171
- }
172
- else { // cleanup phase
173
- unsafe {
174
- __gcc_personality_v0 ( version, actions, exception_class, ue_header,
175
- context)
176
- }
165
+ } else {
166
+ // cleanup phase
167
+ unsafe { __gcc_personality_v0 ( version, actions, exception_class, ue_header, context) }
177
168
}
178
169
}
179
170
}
@@ -186,49 +177,40 @@ pub mod eabi {
186
177
use unwind as uw;
187
178
use libc:: c_int;
188
179
189
- extern {
180
+ extern "C" {
190
181
fn __gcc_personality_sj0 ( version : c_int ,
191
- actions : uw:: _Unwind_Action ,
192
- exception_class : uw:: _Unwind_Exception_Class ,
193
- ue_header : * mut uw:: _Unwind_Exception ,
194
- context : * mut uw:: _Unwind_Context )
195
- -> uw:: _Unwind_Reason_Code ;
182
+ actions : uw:: _Unwind_Action ,
183
+ exception_class : uw:: _Unwind_Exception_Class ,
184
+ ue_header : * mut uw:: _Unwind_Exception ,
185
+ context : * mut uw:: _Unwind_Context )
186
+ -> uw:: _Unwind_Reason_Code ;
196
187
}
197
188
198
189
#[ lang = "eh_personality" ]
199
190
#[ no_mangle]
200
- pub extern fn rust_eh_personality (
201
- version : c_int ,
202
- actions : uw:: _Unwind_Action ,
203
- exception_class : uw:: _Unwind_Exception_Class ,
204
- ue_header : * mut uw:: _Unwind_Exception ,
205
- context : * mut uw:: _Unwind_Context
206
- ) -> uw:: _Unwind_Reason_Code
207
- {
208
- unsafe {
209
- __gcc_personality_sj0 ( version, actions, exception_class, ue_header,
210
- context)
211
- }
191
+ pub extern "C" fn rust_eh_personality ( version : c_int ,
192
+ actions : uw:: _Unwind_Action ,
193
+ exception_class : uw:: _Unwind_Exception_Class ,
194
+ ue_header : * mut uw:: _Unwind_Exception ,
195
+ context : * mut uw:: _Unwind_Context )
196
+ -> uw:: _Unwind_Reason_Code {
197
+ unsafe { __gcc_personality_sj0 ( version, actions, exception_class, ue_header, context) }
212
198
}
213
199
214
200
#[ lang = "eh_personality_catch" ]
215
201
#[ no_mangle]
216
- pub extern fn rust_eh_personality_catch (
217
- version : c_int ,
218
- actions : uw:: _Unwind_Action ,
219
- exception_class : uw:: _Unwind_Exception_Class ,
220
- ue_header : * mut uw:: _Unwind_Exception ,
221
- context : * mut uw:: _Unwind_Context
222
- ) -> uw:: _Unwind_Reason_Code
223
- {
224
- if ( actions as c_int & uw:: _UA_SEARCH_PHASE as c_int ) != 0 { // search phase
202
+ pub extern "C" fn rust_eh_personality_catch ( version : c_int ,
203
+ actions : uw:: _Unwind_Action ,
204
+ exception_class : uw:: _Unwind_Exception_Class ,
205
+ ue_header : * mut uw:: _Unwind_Exception ,
206
+ context : * mut uw:: _Unwind_Context )
207
+ -> uw:: _Unwind_Reason_Code {
208
+ if ( actions as c_int & uw:: _UA_SEARCH_PHASE as c_int ) != 0 {
209
+ // search phase
225
210
uw:: _URC_HANDLER_FOUND // catch!
226
- }
227
- else { // cleanup phase
228
- unsafe {
229
- __gcc_personality_sj0 ( version, actions, exception_class, ue_header,
230
- context)
231
- }
211
+ } else {
212
+ // cleanup phase
213
+ unsafe { __gcc_personality_sj0 ( version, actions, exception_class, ue_header, context) }
232
214
}
233
215
}
234
216
}
@@ -241,47 +223,40 @@ pub mod eabi {
241
223
use unwind as uw;
242
224
use libc:: c_int;
243
225
244
- extern {
226
+ extern "C" {
245
227
fn __gcc_personality_v0 ( state : uw:: _Unwind_State ,
246
228
ue_header : * mut uw:: _Unwind_Exception ,
247
229
context : * mut uw:: _Unwind_Context )
248
- -> uw:: _Unwind_Reason_Code ;
230
+ -> uw:: _Unwind_Reason_Code ;
249
231
}
250
232
251
233
#[ lang = "eh_personality" ]
252
234
#[ no_mangle]
253
- extern fn rust_eh_personality (
254
- state : uw:: _Unwind_State ,
255
- ue_header : * mut uw:: _Unwind_Exception ,
256
- context : * mut uw:: _Unwind_Context
257
- ) -> uw:: _Unwind_Reason_Code
258
- {
259
- unsafe {
260
- __gcc_personality_v0 ( state, ue_header, context)
261
- }
235
+ extern "C" fn rust_eh_personality ( state : uw:: _Unwind_State ,
236
+ ue_header : * mut uw:: _Unwind_Exception ,
237
+ context : * mut uw:: _Unwind_Context )
238
+ -> uw:: _Unwind_Reason_Code {
239
+ unsafe { __gcc_personality_v0 ( state, ue_header, context) }
262
240
}
263
241
264
242
#[ lang = "eh_personality_catch" ]
265
243
#[ no_mangle]
266
- pub extern fn rust_eh_personality_catch (
267
- state : uw:: _Unwind_State ,
268
- ue_header : * mut uw:: _Unwind_Exception ,
269
- context : * mut uw:: _Unwind_Context
270
- ) -> uw:: _Unwind_Reason_Code
271
- {
244
+ pub extern "C" fn rust_eh_personality_catch ( state : uw:: _Unwind_State ,
245
+ ue_header : * mut uw:: _Unwind_Exception ,
246
+ context : * mut uw:: _Unwind_Context )
247
+ -> uw:: _Unwind_Reason_Code {
272
248
// Backtraces on ARM will call the personality routine with
273
249
// state == _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND. In those cases
274
250
// we want to continue unwinding the stack, otherwise all our backtraces
275
251
// would end at __rust_try.
276
- if ( state as c_int & uw:: _US_ACTION_MASK as c_int )
277
- == uw:: _US_VIRTUAL_UNWIND_FRAME as c_int
278
- && ( state as c_int & uw:: _US_FORCE_UNWIND as c_int ) == 0 { // search phase
252
+ if ( state as c_int & uw:: _US_ACTION_MASK as c_int ) ==
253
+ uw:: _US_VIRTUAL_UNWIND_FRAME as c_int &&
254
+ ( state as c_int & uw:: _US_FORCE_UNWIND as c_int ) == 0 {
255
+ // search phase
279
256
uw:: _URC_HANDLER_FOUND // catch!
280
- }
281
- else { // cleanup phase
282
- unsafe {
283
- __gcc_personality_v0 ( state, ue_header, context)
284
- }
257
+ } else {
258
+ // cleanup phase
259
+ unsafe { __gcc_personality_v0 ( state, ue_header, context) }
285
260
}
286
261
}
287
262
}
@@ -290,7 +265,7 @@ pub mod eabi {
290
265
#[ cfg( all( target_os="windows" , target_arch = "x86" , target_env="gnu" ) ) ]
291
266
#[ lang = "eh_unwind_resume" ]
292
267
#[ unwind]
293
- unsafe extern fn rust_eh_unwind_resume ( panic_ctx : * mut u8 ) -> ! {
268
+ unsafe extern "C" fn rust_eh_unwind_resume ( panic_ctx : * mut u8 ) -> ! {
294
269
uw:: _Unwind_Resume ( panic_ctx as * mut uw:: _Unwind_Exception ) ;
295
270
}
296
271
@@ -314,22 +289,21 @@ unsafe extern fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
314
289
pub mod eh_frame_registry {
315
290
#[ link( name = "gcc_eh" ) ]
316
291
#[ cfg( not( cargobuild) ) ]
317
- extern { }
292
+ extern "C" { }
318
293
319
- extern {
294
+ extern "C" {
320
295
fn __register_frame_info ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
321
296
fn __deregister_frame_info ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
322
297
}
323
298
324
299
#[ no_mangle]
325
- pub unsafe extern fn rust_eh_register_frames ( eh_frame_begin : * const u8 ,
326
- object : * mut u8 ) {
300
+ pub unsafe extern "C" fn rust_eh_register_frames ( eh_frame_begin : * const u8 , object : * mut u8 ) {
327
301
__register_frame_info ( eh_frame_begin, object) ;
328
302
}
329
303
330
304
#[ no_mangle]
331
- pub unsafe extern fn rust_eh_unregister_frames ( eh_frame_begin : * const u8 ,
332
- object : * mut u8 ) {
305
+ pub unsafe extern "C" fn rust_eh_unregister_frames ( eh_frame_begin : * const u8 ,
306
+ object : * mut u8 ) {
333
307
__deregister_frame_info ( eh_frame_begin, object) ;
334
308
}
335
309
}
0 commit comments