AP_HAL: move definition of callbacks structure out of C linkage

This fixes all the examples which use the AP_HAL_MAIN macro.
This commit is contained in:
Peter Barker 2016-04-27 14:21:28 +10:00
parent 4a10156b13
commit e83b10cbc5
1 changed files with 3 additions and 2 deletions

View File

@ -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; \
} \