This commit is contained in:
Antonio SJ Musumeci 2025-11-21 13:47:53 -06:00
parent a7485231fd
commit f22b1903bc

View file

@ -1,13 +1,13 @@
#pragma once
#include "fmt/core.h"
#include <cstdlib>
[[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)