this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Path ExceptionHandler to compile

+16 -13
+16 -13
src/ExceptionHandling/src/ExceptionHandler.m
··· 1 - #include "ExceptionHandler.h" 1 + #include <ExceptionHandling/ExceptionHandler.h> 2 2 #include <pthread.h> 3 3 #include <sys/types.h> 4 4 #include <signal.h> 5 5 #include <unistd.h> 6 - #include <cstdlib> 6 + #include <stdlib.h> 7 7 8 8 static void LocalExceptionHandler(NSException* e); 9 9 ··· 13 13 @synthesize exceptionHangingMask = _hangingMask; 14 14 @synthesize delegate = _delegate; 15 15 16 + static NSExceptionHandler* instance; 17 + 18 + static void init_routine(void) 19 + { 20 + instance = [NSExceptionHandler new]; 21 + instance->_delegate = NULL; 22 + instance->_handlingMask = 0xffffffff; 23 + instance->_hangingMask = 0; 24 + 25 + NSSetUncaughtExceptionHandler(LocalExceptionHandler); 26 + } 27 + 16 28 + (NSExceptionHandler *)defaultExceptionHandler 17 29 { 18 30 static pthread_once_t once = PTHREAD_ONCE_INIT; 19 - static NSExceptionHandler* instance; 20 - 21 - pthread_once(&once, []() { 22 31 23 - instance = [NSExceptionHandler new]; 24 - instance->_delegate = NULL; 25 - instance->_handlingMask = 0xffffffff; 26 - instance->_hangingMask = 0; 27 - 28 - NSSetUncaughtExceptionHandler(LocalExceptionHandler); 29 - }); 30 - 32 + pthread_once(&once, &init_routine); 33 + 31 34 return instance; 32 35 } 33 36