mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_HAL: added AP_HAL_Macros.h
this adds a define for constexpr, allowing code to build either with or without -std=gnu++0x
This commit is contained in:
parent
53ea7c564e
commit
2ce18f588b
@ -7,12 +7,7 @@
|
||||
|
||||
#include "AP_HAL_Namespace.h"
|
||||
#include "AP_HAL_Boards.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define WARN_IF_UNUSED __attribute__ ((warn_unused_result))
|
||||
#else
|
||||
#define WARN_IF_UNUSED
|
||||
#endif
|
||||
#include "AP_HAL_Macros.h"
|
||||
|
||||
/* HAL Module Classes (all pure virtual) */
|
||||
#include "UARTDriver.h"
|
||||
|
20
libraries/AP_HAL/AP_HAL_Macros.h
Normal file
20
libraries/AP_HAL/AP_HAL_Macros.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef __AP_HAL_MACROS_H__
|
||||
#define __AP_HAL_MACROS_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
|
||||
|
||||
#endif // __AP_HAL_MACROS_H__
|
Loading…
Reference in New Issue
Block a user