Allow to change to functor implementation

Start to add code behind APM_BUILD_FUNCTOR to support changing the
functor implementation (without breaking the build while the change is
not complete).
This commit is contained in:
Lucas De Marchi 2015-05-24 18:43:22 -03:00 committed by Andrew Tridgell
parent a1e1503e1a
commit 4b5cf24a81
2 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,14 @@
#define DELEGATE_FUNCTION1(rettype, args...) fastdelegate::FastDelegate1<args, rettype>
#define DELEGATE_FUNCTION2(rettype, args...) fastdelegate::FastDelegate2<args, rettype>
#ifndef APM_BUILD_FUNCTOR
#define APM_BUILD_FUNCTOR 0
#endif
#if APM_BUILD_FUNCTOR
#include "utility/functor.h"
#endif
namespace AP_HAL {
/* Toplevel pure virtual class Hal.*/

View File

@ -74,6 +74,9 @@ public:
#define APM_BUILD_TYPE(type) ((type) == APM_BUILD_UNKNOWN)
#endif
#ifndef APM_BUILD_FUNCTOR
#define APM_BUILD_FUNCTOR 0
#endif
#if APM_BUILD_TYPE(APM_BUILD_APMrover2) || APM_BUILD_TYPE(APM_BUILD_ArduPlane)
# define APM_BUILD_DELEGATES 1