From 96fd7a0316c2f51a36bc139eb03e22626ed63364 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 11 Feb 2014 18:04:45 -0800 Subject: [PATCH] Fix macro redefinition errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes a race condition between both qwt and qt against math.h on windows with _USE_MATH_DEFINES set. If math.h comes after qwt or qt math headers the math defines will be redefined. Really nasty to track down and ordering problems. So instead I just removed using math defines on windows and fall back to asin definition of M_PI_2. This will have some slight perf impact since it calls function instead of using constant. But I doubt on any of today’s machine it really makes a difference. --- libs/mavlink/include/mavlink/v1.0/mavlink_conversions.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libs/mavlink/include/mavlink/v1.0/mavlink_conversions.h b/libs/mavlink/include/mavlink/v1.0/mavlink_conversions.h index 51afac87c..45528d61d 100644 --- a/libs/mavlink/include/mavlink/v1.0/mavlink_conversions.h +++ b/libs/mavlink/include/mavlink/v1.0/mavlink_conversions.h @@ -1,16 +1,10 @@ #ifndef _MAVLINK_CONVERSIONS_H_ #define _MAVLINK_CONVERSIONS_H_ -/* enable math defines on Windows */ -#ifdef _MSC_VER -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES -#endif -#endif #include #ifndef M_PI_2 - #define M_PI_2 ((float)asin(1)) + #define M_PI_2 ((float)asin(1.0f)) #endif /** -- 2.22.0