From e83b10cbc590479da8665f3d369d8dd89d6fb0f6 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 27 Apr 2016 14:21:28 +1000 Subject: [PATCH] AP_HAL: move definition of callbacks structure out of C linkage This fixes all the examples which use the AP_HAL_MAIN macro. --- libraries/AP_HAL/AP_HAL_Main.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL/AP_HAL_Main.h b/libraries/AP_HAL/AP_HAL_Main.h index 2a3954936b..f01e42a521 100644 --- a/libraries/AP_HAL/AP_HAL_Main.h +++ b/libraries/AP_HAL/AP_HAL_Main.h @@ -37,10 +37,11 @@ #else -#define AP_HAL_MAIN() extern "C" { \ +#define AP_HAL_MAIN() \ + AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \ + extern "C" { \ int AP_MAIN(int argc, char* const argv[]); \ int AP_MAIN(int argc, char* const argv[]) { \ - AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \ hal.run(argc, argv, &callbacks); \ return 0; \ } \