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)