diff --git a/libraries/AP_Common/AP_Common.h b/libraries/AP_Common/AP_Common.h index 9c9b352e12..ad9834f91e 100644 --- a/libraries/AP_Common/AP_Common.h +++ b/libraries/AP_Common/AP_Common.h @@ -20,7 +20,6 @@ #pragma once -#include #include #include @@ -53,6 +52,20 @@ # define FALLTHROUGH #endif +#ifdef __GNUC__ + #define WARN_IF_UNUSED __attribute__ ((warn_unused_result)) +#else + #define WARN_IF_UNUSED +#endif + +// use this to avoid issues between C++11 with NuttX and C++10 on +// other platforms. +#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) +# define constexpr const +#endif + +#define NORETURN __attribute__ ((noreturn)) + #define ToRad(x) radians(x) // *pi/180 #define ToDeg(x) degrees(x) // *180/pi @@ -124,13 +137,3 @@ template struct assert_storage_size { False otherwise. */ bool is_bounded_int32(int32_t value, int32_t lower_bound, int32_t upper_bound); - -/* - useful debugging macro for SITL - */ -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL -#include -#define SITL_printf(fmt, args ...) do { ::printf("%s(%u): " fmt, __FILE__, __LINE__, ##args); } while(0) -#else -#define SITL_printf(fmt, args ...) -#endif