mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Expose 10.6-compatible interface for per-thread assertion handlers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31593 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
59ee016e3e
commit
a3d6bd2eab
2 changed files with 5 additions and 3 deletions
|
@ -389,6 +389,7 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
|
|||
description: (NSString*)format,...;
|
||||
|
||||
@end
|
||||
extern NSString *const NSAssertionHandlerKey;
|
||||
|
||||
#ifdef NS_BLOCK_ASSERTIONS
|
||||
#define _NSAssertArgs(condition, desc, args...)
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
@implementation NSAssertionHandler
|
||||
|
||||
/* Key for thread dictionary. */
|
||||
static NSString *dict_key = @"NSAssertionHandler";
|
||||
NSString *const NSAssertionHandlerKey = @"NSAssertionHandler";
|
||||
|
||||
|
||||
/**
|
||||
* Returns the assertion handler object for the current thread.<br />
|
||||
|
@ -69,11 +70,11 @@ static NSString *dict_key = @"NSAssertionHandler";
|
|||
NSAssertionHandler *handler;
|
||||
|
||||
dict = GSCurrentThreadDictionary();
|
||||
handler = [dict objectForKey: dict_key];
|
||||
handler = [dict objectForKey: NSAssertionHandlerKey];
|
||||
if (handler == nil)
|
||||
{
|
||||
handler = [[NSAssertionHandler alloc] init];
|
||||
[dict setObject: handler forKey: dict_key];
|
||||
[dict setObject: handler forKey: NSAssertionHandlerKey];
|
||||
RELEASE(handler);
|
||||
}
|
||||
return handler;
|
||||
|
|
Loading…
Reference in a new issue