From 9f0af5b9cb92a728d0da71e597cdb9b1f924f174 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sun, 24 May 2015 19:39:23 -0300 Subject: [PATCH] AP_HAL: add fallback implementation of functor macros --- libraries/AP_HAL/AP_HAL_Namespace.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libraries/AP_HAL/AP_HAL_Namespace.h b/libraries/AP_HAL/AP_HAL_Namespace.h index 83fd40aa38..933d46ba25 100644 --- a/libraries/AP_HAL/AP_HAL_Namespace.h +++ b/libraries/AP_HAL/AP_HAL_Namespace.h @@ -35,6 +35,33 @@ #if APM_BUILD_FUNCTOR #include "utility/functor.h" + +// Also add the hacks for the delegate implementation. Here it's just an alias +#define FUNCTOR_BIND_VOID(obj, func, rettype, ...) \ + FUNCTOR_BIND(obj, func, rettype, ## __VA_ARGS__) + +#define FUNCTOR_TYPEDEF_VOID(name, rettype, ...) \ + FUNCTOR_TYPEDEF(name, rettype, ## __VA_ARGS__) + +#else +#define FUNCTOR_TYPEDEF(name, rettype, ...) \ + typedef DELEGATE_FUNCTION(rettype, ## __VA_ARGS__) name + +#define FUNCTOR_DECLARE(name, rettype, ...) \ + DELEGATE_FUNCTION(rettype, ## __VA_ARGS__) name + +#define FUNCTOR_BIND(obj, func, rettype, ...) \ + AP_HAL_CLASSPROC(obj, func) + +#define FUNCTOR_BIND_MEMBER(func, rettype, ...) \ + AP_HAL_MEMBERPROC(func) + +#define FUNCTOR_BIND_VOID(obj, func, rettype, ...) \ + AP_HAL_CLASSPROC_VOID(obj, func) + +#define FUNCTOR_TYPEDEF_VOID(name, rettype, ...) \ + DELEGATE_FUNCTION_VOID_TYPEDEF(name) + #endif namespace AP_HAL {