AP_Vehicle: convert APM_BUILD_COPTER_OR_HELI() to APM_BUILD_COPTER_OR_HELI

force compilation failure if build type is unknown
This commit is contained in:
Andy Piper 2021-10-25 18:06:58 +01:00 committed by Andrew Tridgell
parent 78621668f8
commit 7010a6bf7e
1 changed files with 7 additions and 5 deletions

View File

@ -33,10 +33,7 @@
#define APM_BUILD_Blimp 12 #define APM_BUILD_Blimp 12
#define APM_BUILD_Heli 13 #define APM_BUILD_Heli 13
#ifndef APM_BUILD_DIRECTORY #ifdef APM_BUILD_DIRECTORY
#define APM_BUILD_DIRECTORY APM_BUILD_UNKNOWN
#endif
/* /*
using this macro catches cases where we try to check vehicle type on using this macro catches cases where we try to check vehicle type on
build systems that don't support it build systems that don't support it
@ -46,4 +43,9 @@
/* /*
Copter and heli share a lot of code. This macro makes it easier to check for both Copter and heli share a lot of code. This macro makes it easier to check for both
*/ */
#define APM_BUILD_COPTER_OR_HELI() (APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_Heli)) #define APM_BUILD_COPTER_OR_HELI (APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_Heli))
#else
#define APM_BUILD_TYPE(type) @Invalid_use_of_APM_BUILD_TYPE
#define APM_BUILD_COPTER_OR_HELI @Invalid_use_of_APM_BUILD_COPTER_OR_HELI
#endif