mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
32 lines
435 B
C++
32 lines
435 B
C++
/*
|
|
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
|
*/
|
|
|
|
#include <uavcan/error.hpp>
|
|
#include <cassert>
|
|
#include <cstdlib>
|
|
|
|
#ifndef UAVCAN_EXCEPTIONS
|
|
# error UAVCAN_EXCEPTIONS
|
|
#endif
|
|
|
|
#if UAVCAN_EXCEPTIONS
|
|
# include <stdexcept>
|
|
#endif
|
|
|
|
namespace uavcan
|
|
{
|
|
|
|
void handleFatalError(const char* msg)
|
|
{
|
|
#if UAVCAN_EXCEPTIONS
|
|
throw std::runtime_error(msg);
|
|
#else
|
|
(void)msg;
|
|
assert(0);
|
|
std::abort();
|
|
#endif
|
|
}
|
|
|
|
}
|