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:
David Chisnall 2010-11-07 15:37:19 +00:00
parent 59ee016e3e
commit a3d6bd2eab
2 changed files with 5 additions and 3 deletions

View file

@ -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...)

View file

@ -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;