From 8918325808f9e474c473f4e1c1b4e4e73b8187cf Mon Sep 17 00:00:00 2001 From: batsumaru <> Date: Mon, 10 Aug 2026 19:27:13 +0900 Subject: Fixed casting, added fatal error --- include/fatal_error.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 include/fatal_error.h (limited to 'include') diff --git a/include/fatal_error.h b/include/fatal_error.h new file mode 100644 index 0000000..06e1b88 --- /dev/null +++ b/include/fatal_error.h @@ -0,0 +1,16 @@ +#ifndef FATAL_ERROR_H +#define FATAL_ERROR_H + +#include +#include +#include + +template +[[noreturn]] void fatal_error(std::format_string fmt, Args&&... args) { + std::string msg = std::format(fmt, std::forward(args)...); + std::fputs(msg.c_str(), stderr); + std::fputc('\n', stderr); + std::abort(); +} + +#endif -- cgit v1.3