From f22b1903bc15bd776e20e1c601b182fd71f0a894 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Fri, 21 Nov 2025 13:47:53 -0600 Subject: [PATCH] die.hpp --- src/die.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/die.hpp b/src/die.hpp index 633b22ed..a21346fb 100644 --- a/src/die.hpp +++ b/src/die.hpp @@ -1,13 +1,13 @@ #pragma once #include "fmt/core.h" +#include -[[noreturn]] -static -inline -void -die(std::string_view msg_) -{ - fmt::println(stderr,"FATAL: {}",msg_); - std::abort(); -} +#define DIE(...) \ + do { \ + fmt::print(stderr, fmt::emphasis::bold | fg(fmt::color::red), \ + "{}:{} in {}: ", __FILE__, __LINE__, __func__); \ + fmt::print(stderr, __VA_ARGS__); \ + fmt::print(stderr, "\n"); \ + std::abort(); \ + } while(0)