From cf19d86842d0c56189bf8f02f19ba88ff1dfc8c2 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 12 Jul 2014 17:16:44 +0400 Subject: [PATCH] Macro UAVCAN_ASSERT() instead of assert() (not used yet, see the next commit) --- libuavcan/include/uavcan/impl_constants.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libuavcan/include/uavcan/impl_constants.hpp b/libuavcan/include/uavcan/impl_constants.hpp index 0504628812..4acb92c605 100644 --- a/libuavcan/include/uavcan/impl_constants.hpp +++ b/libuavcan/include/uavcan/impl_constants.hpp @@ -99,6 +99,19 @@ # define UAVCAN_IMPLEMENT_PLACEMENT_NEW 0 #endif +/** + * Run time checks. + * Resolves to the standard assert() by default. + * Can be disabled completely. + */ +#ifndef UAVCAN_ASSERT +# if UAVCAN_NO_ASSERTIONS +# define UAVCAN_ASSERT(x) +# else +# define UAVCAN_ASSERT(x) assert(x) +# endif +#endif + namespace uavcan {