From fbec098e2f83eb1e03854ce4b3316df82213be07 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Mar 2014 12:41:53 +1100 Subject: [PATCH] AP_Vehicle: added APM_BUILD_TYPE() macro this makes checking build type less fragile --- libraries/AP_Vehicle/AP_Vehicle.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index f6014f6a34..9c607600ef 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -58,4 +58,12 @@ public: #define APM_BUILD_ArduPlane 3 #define APM_BUILD_AntennaTracker 4 +/* + using this macro catches cases where we try to check vehicle type on + build systems that don't support it + */ +#ifdef APM_BUILD_DIRECTORY +#define APM_BUILD_TYPE(type) ((type) == APM_BUILD_DIRECTORY) +#endif + #endif // AP_VEHICLE_H