MCPcopy Create free account
hub / github.com/FastLED/FastLED / setup

Method setup

tests/crash_handler_win.h:657–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655 // --- Setup ---
656
657 void setup() {
658 const char* disable_handler = getenv("FASTLED_DISABLE_CRASH_HANDLER");
659 if (disable_handler && (strcmp(disable_handler, "1") == 0 || strcmp(disable_handler, "true") == 0)) {
660 printf("Crash handler disabled (FASTLED_DISABLE_CRASH_HANDLER set)\n");
661 printf("This allows external debuggers to attach for deadlock detection.\n");
662 return;
663 }
664
665 if (GetModuleHandleA("clang_rt.asan_dynamic-x86_64.dll") != NULL ||
666 GetModuleHandleA("libclang_rt.asan_dynamic-x86_64.dll") != NULL) {
667 printf("Crash handler disabled (AddressSanitizer detected)\n");
668 return;
669 }
670
671 printf("Setting up Windows crash handler...\n");
672
673 AddVectoredExceptionHandler(1, exception_handler_callback);
674 SetUnhandledExceptionFilter(exception_handler_callback);
675
676 signal(SIGABRT, signal_handler_callback);
677 signal(SIGFPE, signal_handler_callback);
678 signal(SIGILL, signal_handler_callback);
679 signal(SIGINT, signal_handler_callback);
680 signal(SIGSEGV, signal_handler_callback);
681 signal(SIGTERM, signal_handler_callback);
682
683 printf("Windows crash handler setup complete.\n");
684 }
685};
686
687// --- Free-function API (delegates to singleton) ---

Callers 1

setup_crash_handlerFunction · 0.45

Calls 3

getenvFunction · 0.85
strcmpFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected