From 3f99cdd6075cac8e37e814ead7a7f65d7bfb8dc1 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 17 Mar 2014 20:48:03 +0400 Subject: [PATCH] Proper #define for UAVCAN_EXCEPTIONS --- libuavcan/include/uavcan/impl_constants.hpp | 6 ++++-- libuavcan/include/uavcan/marshal/array.hpp | 5 +++++ libuavcan/src/fatal_error.cpp | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) 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 {