From 7010a6bf7e0026253e02b503ddc4d4c29de585fa Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Mon, 25 Oct 2021 18:06:58 +0100 Subject: [PATCH] AP_Vehicle: convert APM_BUILD_COPTER_OR_HELI() to APM_BUILD_COPTER_OR_HELI force compilation failure if build type is unknown --- libraries/AP_Vehicle/AP_Vehicle_Type.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Vehicle/AP_Vehicle_Type.h b/libraries/AP_Vehicle/AP_Vehicle_Type.h index e708ef76ba..0bc298658f 100644 --- a/libraries/AP_Vehicle/AP_Vehicle_Type.h +++ b/libraries/AP_Vehicle/AP_Vehicle_Type.h @@ -33,10 +33,7 @@ #define APM_BUILD_Blimp 12 #define APM_BUILD_Heli 13 -#ifndef APM_BUILD_DIRECTORY -#define APM_BUILD_DIRECTORY APM_BUILD_UNKNOWN -#endif - +#ifdef APM_BUILD_DIRECTORY /* using this macro catches cases where we try to check vehicle type on 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 */ -#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