@@ -33,10 +33,10 @@ pub const unwinder_private_data_size: usize = 2;
33
33
#[ cfg( all( target_arch = "x86_64" , target_os = "windows" ) ) ]
34
34
pub const unwinder_private_data_size: usize = 6 ;
35
35
36
- #[ cfg( all( target_arch = "arm" , not( any ( target_os = "ios " , target_os = "watchos" ) ) ) ) ]
36
+ #[ cfg( all( target_arch = "arm" , not( all ( target_vendor = "apple " , not ( target_os = "watchos" ) ) ) ) ) ]
37
37
pub const unwinder_private_data_size: usize = 20 ;
38
38
39
- #[ cfg( all( target_arch = "arm" , any ( target_os = "ios " , target_os = "watchos" ) ) ) ]
39
+ #[ cfg( all( target_arch = "arm" , all ( target_vendor = "apple " , not ( target_os = "watchos" ) ) ) ) ]
40
40
pub const unwinder_private_data_size: usize = 5 ;
41
41
42
42
#[ cfg( all( target_arch = "aarch64" , target_pointer_width = "64" , not( target_os = "windows" ) ) ) ]
@@ -123,7 +123,7 @@ extern "C" {
123
123
}
124
124
125
125
cfg_if:: cfg_if! {
126
- if #[ cfg( any( target_os = "ios " , target_os = "tvos" , target_os = " watchos", target_os = "visionos" , target_os = "netbsd" , not( target_arch = "arm" ) ) ) ] {
126
+ if #[ cfg( any( all ( target_vendor = "apple " , not ( target_os = "watchos" ) ) , target_os = "netbsd" , not( target_arch = "arm" ) ) ) ] {
127
127
// Not ARM EHABI
128
128
#[ repr( C ) ]
129
129
#[ derive( Copy , Clone , PartialEq ) ]
@@ -258,8 +258,15 @@ if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", targe
258
258
} // cfg_if!
259
259
260
260
cfg_if:: cfg_if! {
261
- if #[ cfg( not( all( target_os = "ios" , target_arch = "arm" ) ) ) ] {
262
- // Not 32-bit iOS
261
+ if #[ cfg( all( target_vendor = "apple" , not( target_os = "watchos" ) , target_arch = "arm" ) ) ] {
262
+ // 32-bit ARM Apple (except for watchOS) uses SjLj and does not provide
263
+ // _Unwind_Backtrace()
264
+ extern "C-unwind" {
265
+ pub fn _Unwind_SjLj_RaiseException( e: * mut _Unwind_Exception) -> _Unwind_Reason_Code;
266
+ }
267
+
268
+ pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
269
+ } else {
263
270
#[ cfg_attr(
264
271
all( feature = "llvm-libunwind" , any( target_os = "fuchsia" , target_os = "linux" , target_os = "xous" ) ) ,
265
272
link( name = "unwind" , kind = "static" , modifiers = "-bundle" )
@@ -276,13 +283,6 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
276
283
trace_argument: * mut c_void)
277
284
-> _Unwind_Reason_Code;
278
285
}
279
- } else {
280
- // 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
281
- extern "C-unwind" {
282
- pub fn _Unwind_SjLj_RaiseException( e: * mut _Unwind_Exception) -> _Unwind_Reason_Code;
283
- }
284
-
285
- pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
286
286
}
287
287
} // cfg_if!
288
288
0 commit comments