AP_HAL: rearrange headers for consistency

Move attribute definitions all into AP_Common, rather than being split between two files

Remove unused SITL_printf macros

Stop AP_Common including board information

Include AP_Common.h in AP_HAL::Sempahore for WARN_IF_UNUSED; this was the cause of a circular import problem fixed by other commits in this patch.
This commit is contained in:
Peter Barker 2019-02-11 16:39:37 +11:00 committed by Peter Barker
parent effeebfeb8
commit e4e453402c
2 changed files with 4 additions and 14 deletions

View File

@ -1,23 +1,11 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
/*
macros to allow code to build on multiple platforms more easily
*/
#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))
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX
/*
allow double maths on Linux and SITL to avoid problems with system headers

View File

@ -2,6 +2,8 @@
#include "AP_HAL_Namespace.h"
#include <AP_Common/AP_Common.h>
#define HAL_SEMAPHORE_BLOCK_FOREVER 0
class AP_HAL::Semaphore {