Centralized fatal error handling via handleFatalError(msg)

This commit is contained in:
Pavel Kirienko
2014-03-09 20:48:06 +04:00
parent 1b7efa45f5
commit 3dc5183317
6 changed files with 53 additions and 40 deletions
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#pragma once
namespace uavcan
{
/**
* Fatal error handler.
* Throws std::runtime_error() if exceptions are available, otherwise calls assert(0) then std::abort().
*/
#if __GNUC__
__attribute__ ((noreturn))
#endif
void handleFatalError(const char* msg);
}