main
 1//
 2// Licensed under the terms in License.txt
 3//
 4// Copyright 2010 Allen Ding. All rights reserved.
 5//
 6
 7#import "KWWorkarounds.h"
 8
 9#if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG
10
11static NSException *KWExceptionAcrossInvokeBoundary = nil;
12
13void KWSetExceptionFromAcrossInvocationBoundary(NSException *anException) {
14    if (KWExceptionAcrossInvokeBoundary != nil)
15        return;
16
17    KWExceptionAcrossInvokeBoundary = [anException retain];
18}
19
20NSException *KWGetAndClearExceptionFromAcrossInvocationBoundary(void) {
21    NSException *exception = [KWExceptionAcrossInvokeBoundary autorelease];
22    KWExceptionAcrossInvokeBoundary = nil;
23    return exception;
24}
25
26#endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG