mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Apply patch from bug #16437
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22827 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a8cd3e4129
commit
87c36691ca
3 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2006-04-26 Saso Kiselkov
|
||||||
|
|
||||||
|
* Headers/Foundation/NSException.h: Support native exceptions.
|
||||||
|
|
||||||
2006-04-26 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-04-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSCalendarDate.m: Correction to millisecond fix ... for
|
* Source/NSCalendarDate.m: Correction to millisecond fix ... for
|
||||||
|
|
|
@ -254,11 +254,22 @@ GS_EXPORT NSUncaughtExceptionHandler *_NSUncaughtExceptionHandler;
|
||||||
resources allocated in the routine, possibly case on the error code
|
resources allocated in the routine, possibly case on the error code
|
||||||
and perform special processing, and default to RERAISE the error to
|
and perform special processing, and default to RERAISE the error to
|
||||||
the next handler. Within the scope of the handler, a local variable
|
the next handler. Within the scope of the handler, a local variable
|
||||||
called exception holds information about the exception raised.
|
called "localException" holds information about the exception raised.
|
||||||
|
|
||||||
It is illegal to exit the first block of code by any other means than
|
It is illegal to exit the first block of code by any other means than
|
||||||
NS_VALRETURN, NS_VOIDRETURN, or just falling out the bottom.
|
NS_VALRETURN, NS_VOIDRETURN, or just falling out the bottom.
|
||||||
*/
|
*/
|
||||||
|
#ifdef _NATIVE_OBJC_EXCEPTIONS
|
||||||
|
|
||||||
|
# define NS_DURING @try {
|
||||||
|
# define NS_HANDLER } @catch (NSException * localException) {
|
||||||
|
# define NS_ENDHANDLER }
|
||||||
|
|
||||||
|
# define NS_VALRETURN(val) return (val)
|
||||||
|
# define NS_VALUERETURN(object, id) return (object)
|
||||||
|
# define NS_VOIDRETURN return
|
||||||
|
|
||||||
|
#else // _NATIVE_OBJC_EXCEPTIONS
|
||||||
|
|
||||||
/** Private support routine. Do not call directly. */
|
/** Private support routine. Do not call directly. */
|
||||||
GS_EXPORT void _NSAddHandler( NSHandler *handler );
|
GS_EXPORT void _NSAddHandler( NSHandler *handler );
|
||||||
|
@ -287,6 +298,8 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
|
||||||
#define NS_VOIDRETURN do { _NSRemoveHandler(&NSLocalHandler); \
|
#define NS_VOIDRETURN do { _NSRemoveHandler(&NSLocalHandler); \
|
||||||
return; } while (0)
|
return; } while (0)
|
||||||
|
|
||||||
|
#endif // _NATIVE_OBJC_EXCEPTIONS
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
/* Assertion Handling */
|
/* Assertion Handling */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
|
@ -141,6 +141,9 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||||
|
|
||||||
- (void) raise
|
- (void) raise
|
||||||
{
|
{
|
||||||
|
#ifdef _NATIVE_OBJC_EXCEPTIONS
|
||||||
|
@throw self;
|
||||||
|
#else
|
||||||
NSThread *thread;
|
NSThread *thread;
|
||||||
NSHandler *handler;
|
NSHandler *handler;
|
||||||
|
|
||||||
|
@ -185,6 +188,7 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||||
thread->_exception_handler = handler->next;
|
thread->_exception_handler = handler->next;
|
||||||
handler->exception = self;
|
handler->exception = self;
|
||||||
longjmp(handler->jumpState, 1);
|
longjmp(handler->jumpState, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) name
|
- (NSString*) name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue