diff --git a/libuavcan/include/uavcan/error.hpp b/libuavcan/include/uavcan/error.hpp index 7f559ac77e..9ae596166e 100644 --- a/libuavcan/include/uavcan/error.hpp +++ b/libuavcan/include/uavcan/error.hpp @@ -26,4 +26,13 @@ enum ErrLogic }; +/** + * 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); + } diff --git a/libuavcan/include/uavcan/fatal_error.hpp b/libuavcan/include/uavcan/fatal_error.hpp deleted file mode 100644 index 0f88a14328..0000000000 --- a/libuavcan/include/uavcan/fatal_error.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#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); - -} diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index c8a6c0ca94..49c5e78b21 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/libuavcan/include/uavcan/node/global_data_type_registry.hpp b/libuavcan/include/uavcan/node/global_data_type_registry.hpp index 968fbbb11a..3d98aa4af3 100644 --- a/libuavcan/include/uavcan/node/global_data_type_registry.hpp +++ b/libuavcan/include/uavcan/node/global_data_type_registry.hpp @@ -7,10 +7,10 @@ #include #include #include +#include #include #include #include -#include #include #if UAVCAN_DEBUG # include diff --git a/libuavcan/include/uavcan/node/timer.hpp b/libuavcan/include/uavcan/node/timer.hpp index 090f98446e..3f291677b3 100644 --- a/libuavcan/include/uavcan/node/timer.hpp +++ b/libuavcan/include/uavcan/node/timer.hpp @@ -5,12 +5,12 @@ #pragma once #include +#include #include +#include #include #include #include -#include -#include #if !defined(UAVCAN_CPP11) || !defined(UAVCAN_CPP_VERSION) # error UAVCAN_CPP_VERSION diff --git a/libuavcan/include/uavcan/util/lazy_constructor.hpp b/libuavcan/include/uavcan/util/lazy_constructor.hpp index b5b23c2ad1..5d6255b0f8 100644 --- a/libuavcan/include/uavcan/util/lazy_constructor.hpp +++ b/libuavcan/include/uavcan/util/lazy_constructor.hpp @@ -5,7 +5,7 @@ #pragma once #include -#include +#include #include #ifndef UAVCAN_CPP_VERSION diff --git a/libuavcan/include/uavcan/util/method_binder.hpp b/libuavcan/include/uavcan/util/method_binder.hpp index 031a2261e8..778b92e600 100644 --- a/libuavcan/include/uavcan/util/method_binder.hpp +++ b/libuavcan/include/uavcan/util/method_binder.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include #include #include diff --git a/libuavcan/src/fatal_error.cpp b/libuavcan/src/error.cpp similarity index 92% rename from libuavcan/src/fatal_error.cpp rename to libuavcan/src/error.cpp index c2b3b94dcc..03764ff6e0 100644 --- a/libuavcan/src/fatal_error.cpp +++ b/libuavcan/src/error.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #ifndef UAVCAN_EXCEPTIONS diff --git a/libuavcan/src/protocol/node_status_monitor.cpp b/libuavcan/src/protocol/node_status_monitor.cpp index ebd67e29c9..5f8d63821a 100644 --- a/libuavcan/src/protocol/node_status_monitor.cpp +++ b/libuavcan/src/protocol/node_status_monitor.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include namespace uavcan