diff --git a/libuavcan/include/uavcan/impl_constants.hpp b/libuavcan/include/uavcan/impl_constants.hpp index 8f8dedd96e..81e31ac374 100644 --- a/libuavcan/include/uavcan/impl_constants.hpp +++ b/libuavcan/include/uavcan/impl_constants.hpp @@ -35,8 +35,10 @@ namespace uavcan * UAVCAN can be explicitly told to ignore exceptions, or it can be detected automatically. */ #ifndef UAVCAN_EXCEPTIONS -# if defined(__EXCEPTIONS) || defined(_HAS_EXCEPTIONS) -# define UAVCAN_EXCEPTIONS 1 +# if __EXCEPTIONS || _HAS_EXCEPTIONS +# define UAVCAN_EXCEPTIONS 1 +# else +# define UAVCAN_EXCEPTIONS 0 # endif #endif diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index 84599734a4..ba50e111ee 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -13,6 +14,10 @@ #include #include +#ifndef UAVCAN_EXCEPTIONS +# error UAVCAN_EXCEPTIONS +#endif + namespace uavcan { diff --git a/libuavcan/src/fatal_error.cpp b/libuavcan/src/fatal_error.cpp index 52f4eaf2e7..c2b3b94dcc 100644 --- a/libuavcan/src/fatal_error.cpp +++ b/libuavcan/src/fatal_error.cpp @@ -8,6 +8,10 @@ #include #include +#ifndef UAVCAN_EXCEPTIONS +# error UAVCAN_EXCEPTIONS +#endif + namespace uavcan {