mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 15:06:33 -05:00
die.hpp
This commit is contained in:
parent
a7485231fd
commit
f22b1903bc
1 changed files with 9 additions and 9 deletions
18
src/die.hpp
18
src/die.hpp
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue