KWWorkarounds.m 685 B

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