mirror of
https://github.com/NixOS/nix
synced 2025-07-06 17:31:47 +02:00
Make abort() call sites log first
This commit is contained in:
parent
e48e0cbab0
commit
3172e88af5
35 changed files with 88 additions and 45 deletions
|
@ -273,4 +273,28 @@ using NativeSysError =
|
|||
*/
|
||||
void throwExceptionSelfCheck();
|
||||
|
||||
/**
|
||||
* Print a message and abort().
|
||||
*
|
||||
* @note: This assumes that the logger is operational
|
||||
*/
|
||||
[[noreturn]]
|
||||
void panic(std::string_view msg);
|
||||
|
||||
/**
|
||||
* Print a basic error message with source position and abort().
|
||||
* Use the unreachable macro to call this.
|
||||
*
|
||||
* @note: This assumes that the logger is operational
|
||||
*/
|
||||
[[noreturn]]
|
||||
void panic(const char * file, int line, const char * func);
|
||||
|
||||
/**
|
||||
* Print a basic error message with source position and abort().
|
||||
*
|
||||
* @note: This assumes that the logger is operational
|
||||
*/
|
||||
#define unreachable() (panic(__FILE__, __LINE__, __func__))
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue