// SPDX-FileCopyrightText: Copyright 2026 Gloria Goertz, Mireille Meyer // SPDX-License-Identifier: BSD-2-Clause #include #include #include namespace atom { namespace detail { void DefaultPanicHandler(const char* file, int line, const char* message) { fmt::print("panic: {}:{}: {}\n", file, line, message); } static PanicHandlerFn PANIC_HANDLER_FN = &detail::DefaultPanicHandler; [[noreturn]] void CallPanicHandler(const char* file, int line, const char* message) { PANIC_HANDLER_FN(file, line, message); #ifdef ATOM_IS_DEBUG ATOM_DEBUGBREAK; #endif std::abort(); } } void SetPanicHandler(PanicHandlerFn handler) { detail::PANIC_HANDLER_FN = handler; } }