44//! think it's fine...
55#[ cfg( any( not( objfw) , feature = "unstable-exception" ) ) ]
66use core:: ffi:: c_void;
7- #[ cfg( apple ) ]
7+ #[ cfg( apple_new ) ]
88use std:: os:: raw:: c_int;
99#[ cfg( feature = "unstable-exception" ) ]
1010use std:: os:: raw:: c_uchar;
1111
12- #[ cfg( apple ) ]
12+ #[ cfg( apple_new ) ]
1313use crate :: objc_class;
1414use crate :: objc_object;
1515
1616/// Remember that this is non-null!
17- #[ cfg( apple ) ]
17+ #[ cfg( apple_new ) ]
1818pub type objc_exception_matcher =
1919 unsafe extern "C" fn ( catch_type : * mut objc_class , exception : * mut objc_object ) -> c_int ;
2020
2121/// Remember that this is non-null!
22- #[ cfg( apple ) ]
22+ #[ cfg( apple_new ) ]
2323pub type objc_exception_preprocessor =
2424 unsafe extern "C" fn ( exception : * mut objc_object ) -> * mut objc_object ;
2525
2626/// Remember that this is non-null!
27- #[ cfg( apple ) ]
27+ #[ cfg( apple_new ) ]
2828pub type objc_uncaught_exception_handler = unsafe extern "C" fn ( exception : * mut objc_object ) ;
2929
3030#[ cfg( objfw) ]
@@ -34,40 +34,52 @@ pub type objc_uncaught_exception_handler =
3434/// Only available on macOS.
3535///
3636/// Remember that this is non-null!
37- #[ cfg( all( apple , target_os = "macos" ) ) ]
37+ #[ cfg( all( apple_new , target_os = "macos" ) ) ]
3838pub type objc_exception_handler =
3939 unsafe extern "C" fn ( unused : * mut objc_object , context : * mut c_void ) ;
4040
4141extern_c ! {
42- #[ cfg( not ( objfw ) ) ]
42+ #[ cfg( any ( gnustep , apple_new ) ) ]
4343 pub fn objc_begin_catch( exc_buf: * mut c_void) -> * mut objc_object;
44- #[ cfg( not ( objfw ) ) ]
44+ #[ cfg( any ( gnustep , apple_new ) ) ]
4545 pub fn objc_end_catch( ) ;
4646 /// See [`objc-exception.h`].
4747 ///
4848 /// [`objc-exception.h`]: https://github.com/apple-oss-distributions/objc4/blob/objc4-818.2/runtime/objc-exception.h
4949 pub fn objc_exception_throw( exception: * mut objc_object) -> !;
50- #[ cfg( apple ) ]
50+ #[ cfg( apple_new ) ]
5151 pub fn objc_exception_rethrow( ) -> !;
52+
53+ #[ cfg( apple_old) ]
54+ pub fn objc_exception_try_enter( exception_data: * const c_void) ;
55+
56+ #[ cfg( apple_old) ]
57+ pub fn objc_exception_try_exit( exception_data: * const c_void) ;
58+
59+ // objc_exception_extract
60+ // objc_exception_match
61+ // objc_exception_get_functions
62+ // objc_exception_set_functions
63+
5264 #[ cfg( any( gnustep, winobjc) ) ]
5365 pub fn objc_exception_rethrow( exc_buf: * mut c_void) -> !;
5466
55- #[ cfg( apple ) ]
67+ #[ cfg( apple_new ) ]
5668 pub fn objc_setExceptionMatcher( f: objc_exception_matcher) -> objc_exception_matcher;
57- #[ cfg( apple ) ]
69+ #[ cfg( apple_new ) ]
5870 pub fn objc_setExceptionPreprocessor(
5971 f: objc_exception_preprocessor,
6072 ) -> objc_exception_preprocessor;
61- #[ cfg( any( apple , objfw) ) ]
73+ #[ cfg( any( apple_new , objfw) ) ]
6274 pub fn objc_setUncaughtExceptionHandler(
6375 f: objc_uncaught_exception_handler,
6476 ) -> objc_uncaught_exception_handler;
6577
6678 /// Only available on macOS.
67- #[ cfg( all( apple , target_os = "macos" ) ) ]
79+ #[ cfg( all( apple_new , target_os = "macos" ) ) ]
6880 pub fn objc_addExceptionHandler( f: objc_exception_handler, context: * mut c_void) -> usize ;
6981 /// Only available on macOS.
70- #[ cfg( all( apple , target_os = "macos" ) ) ]
82+ #[ cfg( all( apple_new , target_os = "macos" ) ) ]
7183 pub fn objc_removeExceptionHandler( token: usize ) ;
7284
7385 // Only available when ENABLE_OBJCXX is set, and a useable C++ runtime is
0 commit comments